leds-blinkm.rst 2.7 KB

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