TS-7970 LEDs

From embeddedTS Manuals

The TS-7970 has 4 user controllable LEDs.

On startup, the red LED turns on while the system is in u-boot. When execution switches to the Linux kernel, the green LED turns on, and red turns off (controlled by the default state in the device tree).

The blue LED is also driven by the supervisory microcontroller. By default this will turn on the LEDs when connected. When the system is in sleep mode it will turn off the led but blink on briefly on occasion to show activity. If USB has power, but VIN has been removed or is below the minimum threshold, the blue led will blink rapidly.

After startup, users can take over the LED behavior by writing to the files in /sys/class/leds/<name>/brightness. These include:

  • (1) blue-led
  • (2) green-led
  • (3) red-led
  • (4) yellow-led

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.
  1. See the Kernel documentation for more details
  2. 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
  3. See the Kernel documentation for more details