108 lines · plain
1==================2Leds BlinkM driver3==================4 5The leds-blinkm driver supports the devices of the BlinkM family.6 7They are RGB-LED modules driven by a (AT)tiny microcontroller and8communicate through I2C. The default address of these modules is90x09 but this can be changed through a command. By this you could10daisy-chain up to 127 BlinkMs on an I2C bus.11 12The device accepts RGB and HSB color values through separate commands.13Also you can store blinking sequences as "scripts" in14the controller and run them. Also fading is an option.15 16The interface this driver provides is 3-fold:17 18a) LED multicolor class interface for use with triggers19#######################################################20 21The registration follows the scheme::22 23 blinkm-<i2c-bus-nr>-<i2c-device-nr>:rgb:indicator24 25 $ ls -h /sys/class/leds/blinkm-1-9:rgb:indicator26 brightness device max_brightness multi_index multi_intensity power subsystem trigger uevent27 28Hue is controlled by the multi_intensity file and lightness is controlled by29the brightness file.30 31The order in which to write the intensity values can be found in multi_index.32Exactly three values between 0 and 255 must be written to multi_intensity to33change the color::34 35 $ echo 255 100 50 > multi_intensity36 37The overall lightness be changed by writing a value between 0 and 255 to the38brightness file.39 40b) LED class interface for use with triggers41############################################42 43The registration follows the scheme::44 45 blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color>46 47 $ ls -h /sys/class/leds/blinkm-6-*48 /sys/class/leds/blinkm-6-9-blue:49 brightness device max_brightness power subsystem trigger uevent50 51 /sys/class/leds/blinkm-6-9-green:52 brightness device max_brightness power subsystem trigger uevent53 54 /sys/class/leds/blinkm-6-9-red:55 brightness device max_brightness power subsystem trigger uevent56 57(same is /sys/bus/i2c/devices/6-0009/leds)58 59We can control the colors separated into red, green and blue and60assign triggers on each color.61 62E.g.::63 64 $ cat blinkm-6-9-blue/brightness65 0566 67 $ echo 200 > blinkm-6-9-blue/brightness68 $69 70 $ modprobe ledtrig-heartbeat71 $ echo heartbeat > blinkm-6-9-green/trigger72 $73 74 75b) Sysfs group to control rgb, fade, hsb, scripts ...76#####################################################77 78This extended interface is available as folder blinkm79in the sysfs folder of the I2C device.80E.g. below /sys/bus/i2c/devices/6-0009/blinkm81 82 $ ls -h /sys/bus/i2c/devices/6-0009/blinkm/83 blue green red test84 85Currently supported is just setting red, green, blue86and a test sequence.87 88E.g.::89 90 $ cat *91 0092 0093 0094 #Write into test to start test sequence!#95 96 $ echo 1 > test97 $98 99 $ echo 255 > red100 $101 102 103 104as of 07/2024105 106dl9pf <at> gmx <dot> de107jstrauss <at> mailbox <dot> org108