diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2011-02-06 20:44:57 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2011-02-06 20:44:57 +0000 |
commit | 916a9f096942a5d1454635637e47a02455d2fe97 (patch) | |
tree | 43644eba97f9a2cd90c8da76920a3a9b9b18a05e | |
parent | f65365fc75889bb7e3640f5a9131c83a5ba10ad6 (diff) | |
download | rockbox-916a9f096942a5d1454635637e47a02455d2fe97.tar.gz rockbox-916a9f096942a5d1454635637e47a02455d2fe97.zip |
M:Robe 500 Backlight: Add setup based on OF - purpose of operations are a mystery, but needed when loading from flash.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29231 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c index 04778c8e50..fe94cf4be4 100644 --- a/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c +++ b/firmware/target/arm/tms320dm320/mrobe-500/backlight-mr500.c | |||
@@ -31,13 +31,26 @@ | |||
31 | 31 | ||
32 | short read_brightness = 0x0; | 32 | short read_brightness = 0x0; |
33 | 33 | ||
34 | static const char commands [][2] = | ||
35 | { {0xA0, 0x00}, | ||
36 | {0xA1, 0x00}, | ||
37 | {0xA2, 0x00}, | ||
38 | {0xA3, 0x00}, | ||
39 | {0xA4, 0x00}, | ||
40 | {0xA5, 0x00}, | ||
41 | {0xA6, 0x00}, | ||
42 | {0xA7, 0x00}, | ||
43 | {0xA8, 0x00}, | ||
44 | {0xB9, 0x40}, | ||
45 | }; | ||
46 | |||
34 | static void _backlight_write_brightness(int brightness) | 47 | static void _backlight_write_brightness(int brightness) |
35 | { | 48 | { |
36 | uint8_t bl_command[] = {0xA4, 0x00, brightness, 0xA4}; | 49 | uint8_t bl_command[] = {0xA4, 0x00, brightness, 0xA4}; |
37 | 50 | ||
38 | uint8_t bl_read[] = {0xA8, 0x00}; | 51 | spi_block_transfer(SPI_target_BACKLIGHT, commands[8], 2, (char *)&read_brightness, 2); |
39 | 52 | ||
40 | spi_block_transfer(SPI_target_BACKLIGHT, bl_read, 2, (char*)&read_brightness, 2); | 53 | // bl_command[3] = (char) read_brightness; |
41 | 54 | ||
42 | spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0); | 55 | spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0); |
43 | } | 56 | } |
@@ -71,6 +84,25 @@ void __backlight_dim(bool dim_now) | |||
71 | 84 | ||
72 | bool _backlight_init(void) | 85 | bool _backlight_init(void) |
73 | { | 86 | { |
87 | short read_value; | ||
88 | |||
89 | IO_GIO_BITCLR2 = (1 << 5); /* output low (backlight/lcd on) */ | ||
90 | |||
91 | spi_block_transfer(SPI_target_BACKLIGHT, commands[6], 2, 0, 0); | ||
92 | |||
93 | spi_block_transfer(SPI_target_BACKLIGHT, commands[8], 2, (char*)&read_value, 2); | ||
94 | |||
95 | if( (read_value & 0xFF) < 0xD0 ) | ||
96 | { | ||
97 | spi_block_transfer(SPI_target_BACKLIGHT, commands[3], 2, 0, 0); | ||
98 | spi_block_transfer(SPI_target_BACKLIGHT, commands[4], 2, 0, 0); | ||
99 | spi_block_transfer(SPI_target_BACKLIGHT, commands[9], 2, 0, 0); | ||
100 | spi_block_transfer(SPI_target_BACKLIGHT, commands[0], 2, 0, 0); | ||
101 | } | ||
102 | |||
103 | spi_block_transfer(SPI_target_BACKLIGHT, commands[2], 2, 0, 0); | ||
104 | |||
74 | _backlight_set_brightness(backlight_brightness); | 105 | _backlight_set_brightness(backlight_brightness); |
75 | return true; | 106 | return true; |
76 | } | 107 | } |
108 | |||