diff options
Diffstat (limited to 'firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c')
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c index d707e95ca6..46e1eba1fd 100755 --- a/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c +++ b/firmware/target/coldfire/iaudio/x5/lcd-remote-x5.c | |||
@@ -23,23 +23,23 @@ | |||
23 | 23 | ||
24 | /* The LCD in the iAudio M3/M5/X5 remote control is a Tomato LSI 0350 */ | 24 | /* The LCD in the iAudio M3/M5/X5 remote control is a Tomato LSI 0350 */ |
25 | 25 | ||
26 | #define LCD_SET_DUTY_RATIO 0x48 | 26 | #define LCD_SET_DUTY_RATIO 0x48 |
27 | #define LCD_SELECT_ADC 0xa0 | 27 | #define LCD_SELECT_ADC 0xa0 |
28 | #define LCD_SELECT_SHL 0xc0 | 28 | #define LCD_SELECT_SHL 0xc0 |
29 | #define LCD_SET_COM0 0x44 | 29 | #define LCD_SET_COM0 0x44 |
30 | #define LCD_OSC_ON 0xab | 30 | #define LCD_OSC_ON 0xab |
31 | #define LCD_SELECT_DCDC 0x64 | 31 | #define LCD_SELECT_DCDC 0x64 |
32 | #define LCD_SELECT_RES 0x20 | 32 | #define LCD_SELECT_RES 0x20 |
33 | #define LCD_SET_VOLUME 0x81 | 33 | #define LCD_SET_VOLUME 0x81 |
34 | #define LCD_SET_BIAS 0x50 | 34 | #define LCD_SET_BIAS 0x50 |
35 | #define LCD_CONTROL_POWER 0x28 | 35 | #define LCD_CONTROL_POWER 0x28 |
36 | #define LCD_DISPLAY_ON 0xae | 36 | #define LCD_DISPLAY_ON 0xae |
37 | #define LCD_SET_INITLINE 0x40 | 37 | #define LCD_SET_INITLINE 0x40 |
38 | #define LCD_SET_COLUMN 0x10 | 38 | #define LCD_SET_COLUMN 0x10 |
39 | #define LCD_SET_PAGE 0xb0 | 39 | #define LCD_SET_PAGE 0xb0 |
40 | #define LCD_SET_GRAY 0x88 | 40 | #define LCD_SET_GRAY 0x88 |
41 | #define LCD_SET_PWM_FRC 0x90 | 41 | #define LCD_SET_PWM_FRC 0x90 |
42 | #define LCD_SET_POWER_SAVE 0xa8 | 42 | #define LCD_SET_POWER_SAVE 0xa8 |
43 | #define LCD_REVERSE 0xa6 | 43 | #define LCD_REVERSE 0xa6 |
44 | 44 | ||
45 | #define CS_LO and_l(~0x00000020, &GPIO1_OUT) | 45 | #define CS_LO and_l(~0x00000020, &GPIO1_OUT) |
@@ -328,7 +328,7 @@ void lcd_remote_init_device(void) | |||
328 | or_l(0x00000020, &GPIO1_OUT); | 328 | or_l(0x00000020, &GPIO1_OUT); |
329 | or_l(0x00000020, &GPIO1_ENABLE); | 329 | or_l(0x00000020, &GPIO1_ENABLE); |
330 | or_l(0x00000020, &GPIO1_FUNCTION); | 330 | or_l(0x00000020, &GPIO1_FUNCTION); |
331 | 331 | ||
332 | and_l(~0x01000000, &GPIO_OUT); | 332 | and_l(~0x01000000, &GPIO_OUT); |
333 | and_l(~0x01000000, &GPIO_ENABLE); | 333 | and_l(~0x01000000, &GPIO_ENABLE); |
334 | or_l(0x01000000, &GPIO_FUNCTION); | 334 | or_l(0x01000000, &GPIO_FUNCTION); |
@@ -339,7 +339,7 @@ void lcd_remote_on(void) | |||
339 | CS_HI; | 339 | CS_HI; |
340 | CLK_HI; | 340 | CLK_HI; |
341 | sleep(10); | 341 | sleep(10); |
342 | 342 | ||
343 | lcd_remote_write_command(LCD_SET_DUTY_RATIO); | 343 | lcd_remote_write_command(LCD_SET_DUTY_RATIO); |
344 | lcd_remote_write_command(0x70); /* 1/128 */ | 344 | lcd_remote_write_command(0x70); /* 1/128 */ |
345 | 345 | ||
@@ -382,6 +382,13 @@ void lcd_remote_off(void) | |||
382 | RS_HI; | 382 | RS_HI; |
383 | } | 383 | } |
384 | 384 | ||
385 | void lcd_remote_poweroff(void) | ||
386 | { | ||
387 | /* Set power save -> Power OFF (VDD - VSS) .. that's it */ | ||
388 | if (remote_initialized && remote_detect()) | ||
389 | lcd_remote_write_command(LCD_SET_POWER_SAVE | 1); | ||
390 | } | ||
391 | |||
385 | /* Update the display. | 392 | /* Update the display. |
386 | This must be called after all other LCD functions that change the display. */ | 393 | This must be called after all other LCD functions that change the display. */ |
387 | void lcd_remote_update(void) ICODE_ATTR; | 394 | void lcd_remote_update(void) ICODE_ATTR; |