Editing LED patterns

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 168: Line 168:
Although the trigger information for engine 3 is listed we have no control over the keyboard LED, so it has no effect. Attempting to add a pattern for engine 3 after the pattern for engine 2 causes the pattern to no longer function.
Although the trigger information for engine 3 is listed we have no control over the keyboard LED, so it has no effect. Attempting to add a pattern for engine 3 after the pattern for engine 2 causes the pattern to no longer function.
-
 
-
...and there's more. Engine can actually do sub/add arithmetics, branches, and select which leds it controls.
 
-
 
-
Pavel Machek created a simple compiler, it is at https://gitorious.org/tui/tui/source/5b3f5cacf8e208d3ea50d6066e549940d85e55be:maemo/notcc.py , and it can use more features of the chip than described here.
 
=== Default LED Patterns for Nokia N900 ===
=== Default LED Patterns for Nokia N900 ===
Line 250: Line 246:
=== Low Level ===
=== Low Level ===
-
'''see also [[N900_Hardware_LED]] !'''
+
'''this section should get merged with [[N900_Hardware_LED]] !'''
-
   
+
 
 +
The N8x0 had a LP5521<ref name="lp5521-spec">http://www.national.com/pf/LP/LP5521.html</ref> <ref name="lp5521-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/i2c/chips/lp5521.c</ref> programmable three channel controller LED Driver which handles the leds.
 +
The N900 has a LP5523 <ref name="lp5523-spec">http://www.national.com/pf/LP/LP5523.html</ref> <ref name="leds-lp5523-driver">http://mxr.maemo.org/fremantle/source/kernel/drivers/leds/leds-lp5523.c</ref>, which has 3 engines like LP5521 but can drive 9 LEDs via a multiplexer. Actually the multiplexer is between the engine (CPU) and the 9 PWM blocks for the 9 LED outputs - each of those 9 PWM blocks has its own accessable registers for current and brightness, and they are exposed to sysfs. This chip also has double the RAM size for 'programs', plus 2 per-machine and one global register variable and a true set of conditional branch and arithmetic commands.
Alas the LP5523 driver doesn't support any of those advanced features of LP5523, and uses one of those  engines for a kbd backlight ramp-up/down.<br>
Alas the LP5523 driver doesn't support any of those advanced features of LP5523, and uses one of those  engines for a kbd backlight ramp-up/down.<br>
Line 257: Line 255:
See [[N900_Hardware_LED]] for hardware programming details.
See [[N900_Hardware_LED]] for hardware programming details.
 +
 +
** engine1_leds is in the form "0000rgb00" (9 digits, "1" or "0"), where rgb control which leds should participate. The 6 "0" in the above pattern correspond to the 6 kbd white leds controlled by mce via engine3, so readout of engine3_leds gives 111100011 ;-)
 +
** engine1_load accepts a string as specified above (e.g. 9d804000427f0d7f7f007f0042000000). Though LP5523 has an absolute storage of 96 steps a 16bits, which can dynamically partitioned between the three engines, the driver is retarded and limits this to a fixed 16 words a 16bit per engine (<s>ToDo: check if driver supports >16 instructions / machine</s> no it doesn't :-/)
 +
After that, when the state is changed to "run", the program will be run by the controller.
 +
 +
In order for the leds to work, the led_current of the appropriate leds need to be set to non-zero values. This is accomplished by writing to files leds:lp5523:[bgr]/'''led_current''' under the same directory. '''Don't mess with''' the default settings here that come with driver init, they are suitable and changing to higher values may and for certain values '''will kill your LEDS'''!.
== References ==
== References ==

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: