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 1: | Line 1: | ||
== N800 == | == N800 == | ||
- | The | + | The N800 has a single-colour (blue) LED behind the dpad. |
== N810 == | == N810 == | ||
- | The | + | The N810 has an RGB LED. |
== N900 == | == N900 == | ||
+ | The patterns in the /etc/mce/mce.ini are broken down as follows: | ||
- | + | :<tt>PatternName=Priority;ScreenOn;Timeout;LEDsToMap;Engine1Pattern;Engine2Pattern</tt> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
=== Pattern Format === | === Pattern Format === | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
==== Priority ==== | ==== Priority ==== | ||
Line 42: | Line 20: | ||
Since currently only a single pattern at a time can be displayed, this is used to assign importance to the LED patterns. Although only a single LED pattern can be displayed at any time, multiple patterns may be active, the pattern with the highest priority being displayed. | Since currently only a single pattern at a time can be displayed, this is used to assign importance to the LED patterns. Although only a single LED pattern can be displayed at any time, multiple patterns may be active, the pattern with the highest priority being displayed. | ||
- | A common example of this is where the | + | A common example of this is where the n900 is on charge, the battery is full (starting PatternBatteryFull with a priority of 40), and an SMS message is received (PatternCommunicationSMS with a priority of 30). On receipt of the SMS, the LED begins to display the flashing blue led of an SMS. Once that SMS has been dismissed, the green LED of the full battery notification is again displayed. |
==== ScreenOn ==== | ==== ScreenOn ==== | ||
Line 63: | Line 41: | ||
There are two engines that can be used to make custom LED patterns.<ref name="engines">Actually there are three, but the third engine is used exclusively for the keyboard LED.</ref> | There are two engines that can be used to make custom LED patterns.<ref name="engines">Actually there are three, but the third engine is used exclusively for the keyboard LED.</ref> | ||
- | r, g, or b maps the corresponding | + | r, g, or b maps the corresponding LED to Engine 1. |
- | R, G, or B maps the corresponding | + | R, G, or B maps the corresponding LED to Engine 2. |
- | For example, "rG" maps the red | + | For example, "rG" maps the red LED to Engine 1, and the green LED to Engine 2. |
- | You should avoid mapping the same | + | You should avoid mapping the same LED to both engines. |
==== Engine Pattern ==== | ==== Engine Pattern ==== | ||
- | This is a series of text that describes the speed and intensity of changes in the LED(s) | + | This is a series of text that describes the speed and intensity of changes in the LED(s) beign managed by that particular engine. See below for a breakdown of the patterns. Each can be at most 16 commands long. |
=== Lysti Format Engine Patterns and Commands === | === Lysti Format Engine Patterns and Commands === | ||
Line 80: | Line 58: | ||
:<tt>9d8040007f007f0040ff7f007f000000</tt> | :<tt>9d8040007f007f0040ff7f007f000000</tt> | ||
- | Breaking this down for ease of reading we get a list of 8 commands, each of which is four characters long. | + | Breaking this down for ease of reading we get a list of 8 commands, each of which is four characters long. |
:<tt>9d80 4000 7f00 7f00 40ff 7f00 7f00 0000</tt> | :<tt>9d80 4000 7f00 7f00 40ff 7f00 7f00 0000</tt> | ||
- | ==== 9d80 - Refresh Engine | + | ==== 9d80 - Refresh Engine Multiplexor ==== |
- | This is to be used as the first command of every pattern. If this is excluded from the pattern, the led won't flash. | + | This is to be used as the first command of every pattern). If this is excluded from the pattern, the led won't flash. |
==== 40xx - Set channel brightness ==== | ==== 40xx - Set channel brightness ==== | ||
Line 118: | Line 96: | ||
This command may not actually be needed to make the pattern repeat. If this is removed, the pattern will repeat anyway, although it's useful to have it there as an explicit command to repeat for clarity. If you wanted a pattern to run once and then terminate you would use the c000 command. | This command may not actually be needed to make the pattern repeat. If this is removed, the pattern will repeat anyway, although it's useful to have it there as an explicit command to repeat for clarity. If you wanted a pattern to run once and then terminate you would use the c000 command. | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
==== c000 - End pattern execution ==== | ==== c000 - End pattern execution ==== | ||
- | + | The pattern is terminated without repeating. It is important to note here that although that pattern has stopped, it is still active until the Timeout time has passed. As a consequence of this any higher priority patterns (patterns with a lower priority value, since 0 is the highest and 255 is the lowest) will not be displayed until the pattern has fully expired. In the case that the timeout is 0, it will not display until the notification is dismissed. | |
- | + | ||
- | The pattern is terminated without repeating. | + | |
- | + | ||
- | + | ||
- | + | ||
- | It is important to note here that although that pattern has stopped, it is still active | + | |
==== Sending and receiving engine triggers ==== | ==== Sending and receiving engine triggers ==== | ||
Line 145: | Line 106: | ||
The following pattern does exactly that: | The following pattern does exactly that: | ||
- | :<tt>PatternTest=29;1;0;rG; | + | :<tt>PatternTest=29;1;0;rG;9d80400008ffe0044000c000;9d80e08040ffc000</tt> |
===== e002, e004, e008 - Send engine trigger ===== | ===== e002, e004, e008 - Send engine trigger ===== | ||
Line 157: | Line 118: | ||
A signal is sent from the current engine to signal another engine. | A signal is sent from the current engine to signal another engine. | ||
- | 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. |
===== e080, e100, e200 - Wait for engine trigger ===== | ===== e080, e100, e200 - Wait for engine trigger ===== | ||
Line 168: | Line 129: | ||
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. | ||
- | |||
- | |||
- | |||
- | |||
=== Default LED Patterns for Nokia N900 === | === Default LED Patterns for Nokia N900 === | ||
- | + | The default LED patterns for the n900 are: | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | === | + | <tt> |
- | + | :PatternError=0;5;0;r;9d8040007f007f0040ff7f007f000000;9d800000 | |
- | + | :PatternDeviceOn=254;0;0;rgb;9d804000422043207f100000;9d800000 | |
+ | :PatternDeviceSoftOff=253;0;0;rg;9d804000423f433f7f100000;9d800000 | ||
+ | :PatternPowerOn=9;3;0;rgb;9d80400042ff02ffc000;9d800000 | ||
+ | :PatternPowerOff=10;3;0;rgb;9d80400001ff43ff7f007f00c000;9d800000 | ||
+ | :PatternCommunicationCall=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommunicationIM=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommunicationSMS=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommunicationEmail=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternCommonNotification=30;1;0;b;9d80400002ff03ff02ff03ff71080000;9d800000 | ||
+ | :PatternWebcamActive=20;1;0;r;9d80400004ffc0000000;9d800000 | ||
+ | :PatternBatteryCharging=50;4;0;rg;9d804000427f0d7f7f007f0042000000;9d800000 | ||
+ | :PatternBatteryFull=40;4;0;g;9d80407f0000;9d800000</tt> | ||
- | + | === Low Level === | |
- | + | ||
- | + | The N900 has 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 controller can be programmed via "/sys/class/i2c-adapter/i2c-2/2-0032" (FIXME: is this stable?). In that directory there are three files corresponding to the three channels: engine1_mode, engine2_mode and engine3_mode. Each file "stores" one of "run", "load", "disabled" (it seems that there is another mode "direct" but it doesn't work): | |
- | + | * run: The program runs | |
+ | * disabled: The channel is disabled - not running | ||
+ | * load: In that state, there are two more files in that directory: | ||
+ | ** engine1_leds is in the form "0000rgb00" (9 digits), where rgb control which leds should participate | ||
+ | ** engine1_load accepts a string as specified above (e.g. 9d804000427f0d7f7f007f0042000000). | ||
+ | After that, when the state is changed to "run", the program will be ran 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. Perhaps (?) not or values are suitable. | |
- | + | NOTE: There must be a delay (how much? The specs of LP5521 mentions it) between writes to sysfs files. | |
- | + | ||
- | + | {{Reflist}} | |
[[Category:N900 Hardware]] | [[Category:N900 Hardware]] | ||
- |
Learn more about Contributing to the wiki.