2019-06-28 09:20:20 -03:00
|
|
|
==================
|
|
|
|
Leds BlinkM driver
|
|
|
|
==================
|
|
|
|
|
2012-07-20 16:49:06 +08:00
|
|
|
The leds-blinkm driver supports the devices of the BlinkM family.
|
|
|
|
|
|
|
|
They are RGB-LED modules driven by a (AT)tiny microcontroller and
|
|
|
|
communicate through I2C. The default address of these modules is
|
|
|
|
0x09 but this can be changed through a command. By this you could
|
2024-05-08 01:37:11 +05:30
|
|
|
daisy-chain up to 127 BlinkMs on an I2C bus.
|
2012-07-20 16:49:06 +08:00
|
|
|
|
|
|
|
The device accepts RGB and HSB color values through separate commands.
|
|
|
|
Also you can store blinking sequences as "scripts" in
|
|
|
|
the controller and run them. Also fading is an option.
|
|
|
|
|
2024-07-10 13:48:44 -05:00
|
|
|
The interface this driver provides is 3-fold:
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2024-07-10 13:48:44 -05:00
|
|
|
a) LED multicolor class interface for use with triggers
|
|
|
|
#######################################################
|
|
|
|
|
|
|
|
The registration follows the scheme::
|
|
|
|
|
|
|
|
blinkm-<i2c-bus-nr>-<i2c-device-nr>:rgb:indicator
|
|
|
|
|
|
|
|
$ ls -h /sys/class/leds/blinkm-1-9:rgb:indicator
|
|
|
|
brightness device max_brightness multi_index multi_intensity power subsystem trigger uevent
|
|
|
|
|
|
|
|
Hue is controlled by the multi_intensity file and lightness is controlled by
|
|
|
|
the brightness file.
|
|
|
|
|
|
|
|
The order in which to write the intensity values can be found in multi_index.
|
|
|
|
Exactly three values between 0 and 255 must be written to multi_intensity to
|
|
|
|
change the color::
|
|
|
|
|
|
|
|
$ echo 255 100 50 > multi_intensity
|
|
|
|
|
|
|
|
The overall lightness be changed by writing a value between 0 and 255 to the
|
|
|
|
brightness file.
|
|
|
|
|
|
|
|
b) LED class interface for use with triggers
|
2012-07-20 16:49:06 +08:00
|
|
|
############################################
|
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
The registration follows the scheme::
|
|
|
|
|
|
|
|
blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color>
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ ls -h /sys/class/leds/blinkm-6-*
|
|
|
|
/sys/class/leds/blinkm-6-9-blue:
|
|
|
|
brightness device max_brightness power subsystem trigger uevent
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
/sys/class/leds/blinkm-6-9-green:
|
|
|
|
brightness device max_brightness power subsystem trigger uevent
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
/sys/class/leds/blinkm-6-9-red:
|
|
|
|
brightness device max_brightness power subsystem trigger uevent
|
2012-07-20 16:49:06 +08:00
|
|
|
|
|
|
|
(same is /sys/bus/i2c/devices/6-0009/leds)
|
|
|
|
|
|
|
|
We can control the colors separated into red, green and blue and
|
|
|
|
assign triggers on each color.
|
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
E.g.::
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ cat blinkm-6-9-blue/brightness
|
|
|
|
05
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ echo 200 > blinkm-6-9-blue/brightness
|
|
|
|
$
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ modprobe ledtrig-heartbeat
|
|
|
|
$ echo heartbeat > blinkm-6-9-green/trigger
|
|
|
|
$
|
2012-07-20 16:49:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
b) Sysfs group to control rgb, fade, hsb, scripts ...
|
|
|
|
#####################################################
|
|
|
|
|
|
|
|
This extended interface is available as folder blinkm
|
|
|
|
in the sysfs folder of the I2C device.
|
|
|
|
E.g. below /sys/bus/i2c/devices/6-0009/blinkm
|
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ ls -h /sys/bus/i2c/devices/6-0009/blinkm/
|
|
|
|
blue green red test
|
2012-07-20 16:49:06 +08:00
|
|
|
|
|
|
|
Currently supported is just setting red, green, blue
|
|
|
|
and a test sequence.
|
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
E.g.::
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ cat *
|
|
|
|
00
|
|
|
|
00
|
|
|
|
00
|
|
|
|
#Write into test to start test sequence!#
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ echo 1 > test
|
|
|
|
$
|
2012-07-20 16:49:06 +08:00
|
|
|
|
2019-06-28 09:20:20 -03:00
|
|
|
$ echo 255 > red
|
|
|
|
$
|
2012-07-20 16:49:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-10 13:48:44 -05:00
|
|
|
as of 07/2024
|
2012-07-20 16:49:06 +08:00
|
|
|
|
|
|
|
dl9pf <at> gmx <dot> de
|
2024-07-10 13:48:44 -05:00
|
|
|
jstrauss <at> mailbox <dot> org
|