1 What: /sys/class/leds/<led>/pattern
5 Specify a software pattern for the LED, that supports altering
6 the brightness for the specified duration with one software
7 timer. It can do gradual dimming and step change of brightness.
9 The pattern is given by a series of tuples, of brightness and
10 duration (ms). The LED is expected to traverse the series and
11 each brightness value for the specified duration. Duration of
12 0 means brightness should immediately change to new value, and
13 writing malformed pattern deactivates any active one.
15 1. For gradual dimming, the dimming interval now is set as 50
16 milliseconds. So the tuple with duration less than dimming
17 interval (50ms) is treated as a step change of brightness,
18 i.e. the subsequent brightness will be applied without adding
19 intervening dimming intervals.
21 The gradual dimming format of the software pattern values should be:
22 "brightness_1 duration_1 brightness_2 duration_2 brightness_3
23 duration_3 ...". For example:
25 echo 0 1000 255 2000 > pattern
27 It will make the LED go gradually from zero-intensity to max (255)
28 intensity in 1000 milliseconds, then back to zero intensity in 2000
38 +---0----1----2----3----4----5----6------------> time (s)
40 2. To make the LED go instantly from one brightness value to another,
41 we should use zero-time lengths (the brightness must be same as
42 the previous tuple's). So the format should be:
43 "brightness_1 duration_1 brightness_1 0 brightness_2 duration_2
44 brightness_2 0 ...". For example:
46 echo 0 1000 0 0 255 2000 255 0 > pattern
48 It will make the LED stay off for one second, then stay at max brightness
53 255-| +---------+ +---------+
57 0-| -----+ +----+ +----
58 +---0----1----2----3----4----5----6------------> time (s)
60 What: /sys/class/leds/<led>/hw_pattern
64 Specify a hardware pattern for the LED, for LED hardware that
65 supports autonomously controlling brightness over time, according
66 to some preprogrammed hardware patterns. It deactivates any active
69 Since different LED hardware can have different semantics of
70 hardware patterns, each driver is expected to provide its own
71 description for the hardware patterns in their ABI documentation
74 What: /sys/class/leds/<led>/repeat
78 Specify a pattern repeat number. -1 means repeat indefinitely,
79 other negative numbers and number 0 are invalid.
81 This file will always return the originally written repeat