TS-TPC-7990 LEDs: Difference between revisions
From embeddedTS Manuals
(Created page with "The kernel provides access to control the LEDs using the sysfs: <source lang=bash> # Set Red led on echo 1 > /sys/class/leds/red-led/brightness # Set Red led off echo 0 > /sys...") |
m (Links auto-updated for 2022 re-branding ( https://github.com/embeddedarm/linux-3.10.17-imx6/blob/master/Documentation/leds/ledtrig-transient.txt → https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/leds/ledtrig-transient.txt https://github.com/embeddedarm/linux-3.10.17-imx6/blob/master/Documentation/leds/ledtrig-oneshot.txt → https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/leds/ledtrig-oneshot.txt)) |
||
Line 37: | Line 37: | ||
|- | |- | ||
| oneshot | | oneshot | ||
| Blinks after delay. <ref> See the [https://github.com/ | | Blinks after delay. <ref> See the [https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/leds/ledtrig-oneshot.txt Kernel documentation] for more details</ref> | ||
|- | |- | ||
| heartbeat | | heartbeat | ||
Line 64: | Line 64: | ||
|- | |- | ||
| transient | | transient | ||
| Specify on/off with time to turn off. <ref> See the [https://github.com/ | | Specify on/off with time to turn off. <ref> See the [https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/leds/ledtrig-transient.txt Kernel documentation] for more details</ref> | ||
|- | |- | ||
| flash/torch | | flash/torch |
Latest revision as of 17:45, 17 January 2022
The kernel provides access to control the LEDs using the sysfs:
# Set Red led on
echo 1 > /sys/class/leds/red-led/brightness
# Set Red led off
echo 0 > /sys/class/leds/red-led/brightness
# Set Green led on
echo 1 > /sys/class/leds/green-led/brightness
# Set Green led off
echo 0 > /sys/class/leds/green-led/brightness
The kernel provides various triggers that can be useful for debugging purposes. The trigger for a given LED is in its directory:
echo "heartbeat" > /sys/class/leds/red-led/trigger
Trigger value | LED toggles on |
---|---|
none | Default, no action |
mmc0 | MicroSD card activity |
mmc1 | eMMC activity |
mmc2 | WIFI SDIO activity |
timer | 2hz blink |
oneshot | Blinks after delay. [1] |
heartbeat | Similar to timer, but varies the period based on system load |
backlight | Toggles on FB_BLANK |
gpio | Toggle based on a specified gpio. [2] |
cpu0 | Blink on CPU core 0 activity |
cpu1 | Blink on CPU core 1 activity |
cpu2 | Blink on CPU core 2 activity |
cpu3 | Blink on CPU core 3 activity |
default-on | Only turns on by default. Only useful for device tree. |
transient | Specify on/off with time to turn off. [3] |
flash/torch | Toggle on Camera activation. Not currently used. |
- ↑ See the Kernel documentation for more details
- ↑ When this trigger is set, a "gpio" file appears in the same directory which can be used to specify what GPIO to follow when it blinks
- ↑ See the Kernel documentation for more details