@@ -18,69 +18,89 @@ array. These files are children under the LED parent node created by the
1818led_class framework. The led_class framework is documented in led-class.rst
1919within this documentation directory.
2020
21- Each colored LED will be indexed under the multi_* files. The order of the
22- colors will be arbitrary. The multi_index file can be read to determine the
21+ Each colored LED will be indexed under the `` multi_* `` files. The order of the
22+ colors will be arbitrary. The `` multi_index `` file can be read to determine the
2323color name to indexed value.
2424
25- The multi_index file is an array that contains the string list of the colors as
26- they are defined in each multi_* array file.
25+ The `` multi_index `` file is an array that contains the string list of the colors as
26+ they are defined in each `` multi_* `` array file.
2727
28- The multi_intensity is an array that can be read or written to for the
28+ The `` multi_intensity `` is an array that can be read or written to for the
2929individual color intensities. All elements within this array must be written in
3030order for the color LED intensities to be updated.
3131
3232Directory Layout Example
3333========================
34- root:/sys/class/leds/multicolor:status# ls -lR
35- -rw-r--r-- 1 root root 4096 Oct 19 16:16 brightness
36- -r--r--r-- 1 root root 4096 Oct 19 16:16 max_brightness
37- -r--r--r-- 1 root root 4096 Oct 19 16:16 multi_index
38- -rw-r--r-- 1 root root 4096 Oct 19 16:16 multi_intensity
34+ .. code-block :: console
35+
36+ root:/sys/class/leds/multicolor:status# ls -lR
37+ -rw-r--r-- 1 root root 4096 Oct 19 16:16 brightness
38+ -r--r--r-- 1 root root 4096 Oct 19 16:16 max_brightness
39+ -r--r--r-- 1 root root 4096 Oct 19 16:16 multi_index
40+ -rw-r--r-- 1 root root 4096 Oct 19 16:16 multi_intensity
41+
42+ ..
3943
4044Multicolor Class Brightness Control
4145===================================
4246The brightness level for each LED is calculated based on the color LED
4347intensity setting divided by the global max_brightness setting multiplied by
4448the requested brightness.
4549
46- led_brightness = brightness * multi_intensity/max_brightness
50+ `` led_brightness = brightness * multi_intensity/max_brightness ``
4751
4852Example:
4953A user first writes the multi_intensity file with the brightness levels
5054for each LED that are necessary to achieve a certain color output from a
5155multicolor LED group.
5256
53- cat /sys/class/leds/multicolor:status/multi_index
54- green blue red
57+ .. code-block :: console
58+
59+ # cat /sys/class/leds/multicolor:status/multi_index
60+ green blue red
5561
56- echo 43 226 138 > /sys/class/leds/multicolor:status/multi_intensity
62+ # echo 43 226 138 > /sys/class/leds/multicolor:status/multi_intensity
5763
58- red -
59- intensity = 138
60- max_brightness = 255
61- green -
62- intensity = 43
63- max_brightness = 255
64- blue -
65- intensity = 226
66- max_brightness = 255
64+ red -
65+ intensity = 138
66+ max_brightness = 255
67+ green -
68+ intensity = 43
69+ max_brightness = 255
70+ blue -
71+ intensity = 226
72+ max_brightness = 255
73+
74+ ..
6775
6876The user can control the brightness of that multicolor LED group by writing the
6977global 'brightness' control. Assuming a max_brightness of 255 the user
7078may want to dim the LED color group to half. The user would write a value of
7179128 to the global brightness file then the values written to each LED will be
7280adjusted base on this value.
7381
74- cat /sys/class/leds/multicolor:status/max_brightness
75- 255
76- echo 128 > /sys/class/leds/multicolor:status/brightness
82+ .. code-block :: console
83+
84+ # cat /sys/class/leds/multicolor:status/max_brightness
85+ 255
86+ # echo 128 > /sys/class/leds/multicolor:status/brightness
7787
78- adjusted_red_value = 128 * 138/255 = 69
79- adjusted_green_value = 128 * 43/255 = 21
80- adjusted_blue_value = 128 * 226/255 = 113
88+ ..
89+
90+ .. code-block :: none
91+
92+ adjusted_red_value = 128 * 138/255 = 69
93+ adjusted_green_value = 128 * 43/255 = 21
94+ adjusted_blue_value = 128 * 226/255 = 113
95+
96+ ..
8197
8298Reading the global brightness file will return the current brightness value of
8399the color LED group.
84100
85- cat /sys/class/leds/multicolor:status/brightness
86- 128
101+ .. code-block :: console
102+
103+ # cat /sys/class/leds/multicolor:status/brightness
104+ 128
105+
106+ ..
0 commit comments