Commit | Line | Data |
---|---|---|
8dab9197 MCC |
1 | ================== |
2 | Leds BlinkM driver | |
3 | ================== | |
4 | ||
b54cf35a JSM |
5 | The leds-blinkm driver supports the devices of the BlinkM family. |
6 | ||
7 | They are RGB-LED modules driven by a (AT)tiny microcontroller and | |
8 | communicate through I2C. The default address of these modules is | |
9 | 0x09 but this can be changed through a command. By this you could | |
dc628508 | 10 | daisy-chain up to 127 BlinkMs on an I2C bus. |
b54cf35a JSM |
11 | |
12 | The device accepts RGB and HSB color values through separate commands. | |
13 | Also you can store blinking sequences as "scripts" in | |
14 | the controller and run them. Also fading is an option. | |
15 | ||
56e8c56c | 16 | The interface this driver provides is 3-fold: |
b54cf35a | 17 | |
56e8c56c JS |
18 | a) LED multicolor class interface for use with triggers |
19 | ####################################################### | |
20 | ||
21 | The registration follows the scheme:: | |
22 | ||
23 | blinkm-<i2c-bus-nr>-<i2c-device-nr>:rgb:indicator | |
24 | ||
25 | $ ls -h /sys/class/leds/blinkm-1-9:rgb:indicator | |
26 | brightness device max_brightness multi_index multi_intensity power subsystem trigger uevent | |
27 | ||
28 | Hue is controlled by the multi_intensity file and lightness is controlled by | |
29 | the brightness file. | |
30 | ||
31 | The order in which to write the intensity values can be found in multi_index. | |
32 | Exactly three values between 0 and 255 must be written to multi_intensity to | |
33 | change the color:: | |
34 | ||
35 | $ echo 255 100 50 > multi_intensity | |
36 | ||
37 | The overall lightness be changed by writing a value between 0 and 255 to the | |
38 | brightness file. | |
39 | ||
40 | b) LED class interface for use with triggers | |
b54cf35a JSM |
41 | ############################################ |
42 | ||
8dab9197 MCC |
43 | The registration follows the scheme:: |
44 | ||
45 | blinkm-<i2c-bus-nr>-<i2c-device-nr>-<color> | |
b54cf35a | 46 | |
8dab9197 MCC |
47 | $ ls -h /sys/class/leds/blinkm-6-* |
48 | /sys/class/leds/blinkm-6-9-blue: | |
49 | brightness device max_brightness power subsystem trigger uevent | |
b54cf35a | 50 | |
8dab9197 MCC |
51 | /sys/class/leds/blinkm-6-9-green: |
52 | brightness device max_brightness power subsystem trigger uevent | |
b54cf35a | 53 | |
8dab9197 MCC |
54 | /sys/class/leds/blinkm-6-9-red: |
55 | brightness device max_brightness power subsystem trigger uevent | |
b54cf35a JSM |
56 | |
57 | (same is /sys/bus/i2c/devices/6-0009/leds) | |
58 | ||
59 | We can control the colors separated into red, green and blue and | |
60 | assign triggers on each color. | |
61 | ||
8dab9197 | 62 | E.g.:: |
b54cf35a | 63 | |
8dab9197 MCC |
64 | $ cat blinkm-6-9-blue/brightness |
65 | 05 | |
b54cf35a | 66 | |
8dab9197 MCC |
67 | $ echo 200 > blinkm-6-9-blue/brightness |
68 | $ | |
b54cf35a | 69 | |
8dab9197 MCC |
70 | $ modprobe ledtrig-heartbeat |
71 | $ echo heartbeat > blinkm-6-9-green/trigger | |
72 | $ | |
b54cf35a JSM |
73 | |
74 | ||
75 | b) Sysfs group to control rgb, fade, hsb, scripts ... | |
76 | ##################################################### | |
77 | ||
78 | This extended interface is available as folder blinkm | |
79 | in the sysfs folder of the I2C device. | |
80 | E.g. below /sys/bus/i2c/devices/6-0009/blinkm | |
81 | ||
8dab9197 MCC |
82 | $ ls -h /sys/bus/i2c/devices/6-0009/blinkm/ |
83 | blue green red test | |
b54cf35a JSM |
84 | |
85 | Currently supported is just setting red, green, blue | |
86 | and a test sequence. | |
87 | ||
8dab9197 | 88 | E.g.:: |
b54cf35a | 89 | |
8dab9197 MCC |
90 | $ cat * |
91 | 00 | |
92 | 00 | |
93 | 00 | |
94 | #Write into test to start test sequence!# | |
b54cf35a | 95 | |
8dab9197 MCC |
96 | $ echo 1 > test |
97 | $ | |
b54cf35a | 98 | |
8dab9197 MCC |
99 | $ echo 255 > red |
100 | $ | |
b54cf35a JSM |
101 | |
102 | ||
103 | ||
56e8c56c | 104 | as of 07/2024 |
b54cf35a JSM |
105 | |
106 | dl9pf <at> gmx <dot> de | |
56e8c56c | 107 | jstrauss <at> mailbox <dot> org |