LEDs - gemian/gemian GitHub Wiki

Gemini LED's

The gemini has a AW9120 to control the information LED's, it has 20 led controller outputs that are programmable to have looping patterns with fades etc. The twenty outputs are grouped into 3's for the R+G+B's for the block of 5 in the middle of the cover, and the one off to the right, with the final two outputs used for the inside indicator. The power indicator is to the left and not powered by this chip.

We use the LED inside the device to indicate Caps Lock (Red) and the right most LED to indicate Wifi (Green), BT (Bluetooth), Cellular (Red). The block of five indicator LED's in the middle of the outside of the device can be controlled with the LED service, including multi-step animations.

Debian LED service

We have started a DBUS service that lets multiple apps/system components signal the output to be shown.

https://github.com/gemian/gemian-leds

Unfortunately the chip only supports animations with PWM levels changed by a value of one per time step. eg. fading the red channel from 0-255 whilst also fading the green from 0-20 will have both red and green fading evenly from 0-20 where the red will then continue to 255 for the remaining time steps. So if you want to fade to a specific RGB value it makes for interesting other colours on the way. You can offset the start of the animations of each colour step.

Install 'gemian-leds-scripts' for some example scripts.

Manual LED control

You can also directly set power levels (not PWM) manually to the LEDs from the command line.

Main Set of LED's on the 20 output aw9120, grouped as RGB, 1-5 (block), 6 - opposite end to power LED, 7 - inside only red and blue:

echo 1 0 1 0 > /proc/aw9120_operation
echo 4 0 0 2 > /proc/aw9120_operation
echo 7 0 2 > /proc/aw9120_operation

Format LED# R G B, where R/G/B are 1-3 (android kernel), 1-9 (gemian patched kernel)

LED next to power LED:

echo 1 | sudo tee --append /sys/class/leds/green/brightness
echo 1 | sudo tee --append /sys/class/leds/red/brightness

Format 0 or 1 to turn it on/off appears to accept no level of brightness.


Cosmo LED's

The cosmo has a aw9524 to control LED's, I suspect this is just another aw9523 as used for the keyboard but addressed separately and wired for the LED's.

The keyboard backlight can be controlled (0%, 20%, 40%, 60%, 80%, 100%):

echo 40 > /proc/aw9524_led_proc
echo 41 > /proc/aw9524_led_proc
echo 42 > /proc/aw9524_led_proc
echo 43 > /proc/aw9524_led_proc
echo 44 > /proc/aw9524_led_proc
echo 45 > /proc/aw9524_led_proc

The internal RGB led next to tab/esc buttons can be controlled:

echo 110 > /proc/aw9524_led_proc # Red off
echo 119 > /proc/aw9524_led_proc # Red max
echo 120 > /proc/aw9524_led_proc # Green off
echo 129 > /proc/aw9524_led_proc # Green max
echo 130 > /proc/aw9524_led_proc # Blue off
echo 139 > /proc/aw9524_led_proc # Blue max

The rocker has a left and right LED which can be controlled:

echo 310 > /proc/aw9524_led_proc # Left red off
echo 319 > /proc/aw9524_led_proc # Left red max
echo 210 > /proc/aw9524_led_proc # Right red off
echo 219 > /proc/aw9524_led_proc # Right red max
echo 320 > /proc/aw9524_led_proc # Left green off
echo 329 > /proc/aw9524_led_proc # Left green max
echo 220 > /proc/aw9524_led_proc # Right green off
echo 229 > /proc/aw9524_led_proc # Right green max
echo 330 > /proc/aw9524_led_proc # Left blue off
echo 339 > /proc/aw9524_led_proc # Left blue max
echo 230 > /proc/aw9524_led_proc # Right blue off
echo 239 > /proc/aw9524_led_proc # Right blue max

The camera has an led just above it, which can be controlled:

echo 710 > /proc/aw9524_led_proc # Red off
echo 719 > /proc/aw9524_led_proc # Red max
echo 720 > /proc/aw9524_led_proc # Green off
echo 729 > /proc/aw9524_led_proc # Green max
echo 730 > /proc/aw9524_led_proc # Blue off
echo 739 > /proc/aw9524_led_proc # Blue max

The rocker and camera leds can all be controlled together:

echo 610 > /proc/aw9524_led_proc # Red off
echo 619 > /proc/aw9524_led_proc # Red max
echo 620 > /proc/aw9524_led_proc # Green off
echo 629 > /proc/aw9524_led_proc # Green max
echo 630 > /proc/aw9524_led_proc # Blue off
echo 639 > /proc/aw9524_led_proc # Blue max

See Hardware Hacking