Back to home page

OSCL-LXR

 
 

    


0001 * Pattern format for LED pattern trigger
0002 
0003 The pattern is given by a series of tuples, of brightness and duration (ms).
0004 The LED is expected to traverse the series and each brightness value for the
0005 specified duration. Duration of 0 means brightness should immediately change to
0006 new value, and writing malformed pattern deactivates any active one.
0007 
0008 1. For gradual dimming, the dimming interval now is set as 50 milliseconds. So
0009 the tuple with duration less than dimming interval (50ms) is treated as a step
0010 change of brightness, i.e. the subsequent brightness will be applied without
0011 adding intervening dimming intervals.
0012 
0013 The gradual dimming format of the software pattern values should be:
0014 "brightness_1 duration_1 brightness_2 duration_2 brightness_3 duration_3 ...".
0015 For example (using sysfs interface):
0016 
0017 echo 0 1000 255 2000 > pattern
0018 
0019 It will make the LED go gradually from zero-intensity to max (255) intensity in
0020 1000 milliseconds, then back to zero intensity in 2000 milliseconds:
0021 
0022 LED brightness
0023     ^
0024 255-|       / \            / \            /
0025     |      /    \         /    \         /
0026     |     /       \      /       \      /
0027     |    /          \   /          \   /
0028   0-|   /             \/             \/
0029     +---0----1----2----3----4----5----6------------> time (s)
0030 
0031 2. To make the LED go instantly from one brightness value to another, we should
0032 use zero-time lengths (the brightness must be same as the previous tuple's). So
0033 the format should be: "brightness_1 duration_1 brightness_1 0 brightness_2
0034 duration_2 brightness_2 0 ...".
0035 For example (using sysfs interface):
0036 
0037 echo 0 1000 0 0 255 2000 255 0 > pattern
0038 
0039 It will make the LED stay off for one second, then stay at max brightness for
0040 two seconds:
0041 
0042 LED brightness
0043     ^
0044 255-|        +---------+    +---------+
0045     |        |         |    |         |
0046     |        |         |    |         |
0047     |        |         |    |         |
0048   0-|   -----+         +----+         +----
0049     +---0----1----2----3----4----5----6------------> time (s)