GUF-Yocto-jethro-9.0-r7707-0
i.MX6
User Manual
root@santaro:~# cat /sys/class/backlight/pwm-backlight.0/brightness
255
root@santaro:~# echo 100 > /sys/class/backlight/pwm-backlight.0/brightness
Please note that this value is not persistent, i.e. it gets lost when the device is rebooted. In order to change the
brightness permanently, it has to be set in the XML configuration, which can be done using the
xconfig
tool.
Example 2:
Adjusting the backlight brightness permanently on the console:
root@santaro:~# xconfig addattribute -p /configurationFile/variables/display/
,!
backlight -n level_ac -v 100
Please note that adjusting this value does not affect the brightness immediately. A reboot is required for this
setting to take effect. If you want to adjust the brightness immediately and permanently, you have to execute both
examples.
6.12
SD cards and USB mass storage
SD cards and USB mass storage devices can be accessed directly by using their devices nodes. The SD card can
be found under
/dev/mmcblk1
, its single partitions are located under
/dev/mmcblk1pX
with X being a positive
number. The USB mass storage devices can be found under
/dev/sdX
with X=a..z, its single partitions under
/dev/sdXY
with Y being a positive number.
Example 1:
Create a FAT32 file system on the first partition of an SD card:
root@santaro:~# mkfs.vfat /dev/mmcblk1p1
If the first partition on an SD card or a USB mass storage device already contains a file system when it is plugged
into the device, it is mounted automatically by the
udev
service. SD card partitions are mounted to mount point
/media/mmcblk1pX
with X being a positive number, and USB mass storage devices are mounted to mount point
/media/sdXY
with X=a..z and Y being a positive number.
All further partitions or partitions with a newly created file system have to be mounted manually, like shown in the
following examples.
Example 2:
Mount the first partition on an SD Card into a newly created directory:
root@santaro:~# mkdir /my_sdcard
root@santaro:~# mount /dev/mmcblk1p1 /my_sdcard
Example 3:
Mount the first partition on a USB mass storage device into a newly created directory:
root@santaro:~# mkdir /my_usb_drive
root@santaro:~# mount /dev/sda1 /my_usb_drive
6.13
Temperature Sensor
Most Garz & Fricke systems are equipped with an on-board hardware temperature sensor. The sensor is a Texas
Instruments LM73 connected via I
2
C. To poll the currently measured temperature you can read the corresponding
sysfs file in
/sys/class/hwmon/hwmon0/device/
.
For example:
root@santaro:~# cat /sys/class/hwmon/hwmon0/temp1_input
+38.0
The sensor generates an alert when the measured temperature exceeds the maximum temperature defined in
temp1_max
. The alert flag will be set to 1 (active low) and an interrupt is generated. The interrupt will trigger an
event on the
temp1_max_alarm
sysfs entry, that can be catched using the
poll()
function. Additionally there is a
temp1_min
that works similar.
Read the temperature alert flag:
43