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 /firmware | |
parent | f65365fc75889bb7e3640f5a9131c83a5ba10ad6 (diff) |
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
Diffstat (limited to 'firmware')
-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 @@ short read_brightness = 0x0; +static const char commands [][2] = +{ {0xA0, 0x00}, + {0xA1, 0x00}, + {0xA2, 0x00}, + {0xA3, 0x00}, + {0xA4, 0x00}, + {0xA5, 0x00}, + {0xA6, 0x00}, + {0xA7, 0x00}, + {0xA8, 0x00}, + {0xB9, 0x40}, +}; + static void _backlight_write_brightness(int brightness) { uint8_t bl_command[] = {0xA4, 0x00, brightness, 0xA4}; - uint8_t bl_read[] = {0xA8, 0x00}; - - spi_block_transfer(SPI_target_BACKLIGHT, bl_read, 2, (char*)&read_brightness, 2); + spi_block_transfer(SPI_target_BACKLIGHT, commands[8], 2, (char *)&read_brightness, 2); + +// bl_command[3] = (char) read_brightness; spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0); } @@ -71,6 +84,25 @@ void __backlight_dim(bool dim_now) bool _backlight_init(void) { + short read_value; + + IO_GIO_BITCLR2 = (1 << 5); /* output low (backlight/lcd on) */ + + spi_block_transfer(SPI_target_BACKLIGHT, commands[6], 2, 0, 0); + + spi_block_transfer(SPI_target_BACKLIGHT, commands[8], 2, (char*)&read_value, 2); + + if( (read_value & 0xFF) < 0xD0 ) + { + spi_block_transfer(SPI_target_BACKLIGHT, commands[3], 2, 0, 0); + spi_block_transfer(SPI_target_BACKLIGHT, commands[4], 2, 0, 0); + spi_block_transfer(SPI_target_BACKLIGHT, commands[9], 2, 0, 0); + spi_block_transfer(SPI_target_BACKLIGHT, commands[0], 2, 0, 0); + } + + spi_block_transfer(SPI_target_BACKLIGHT, commands[2], 2, 0, 0); + _backlight_set_brightness(backlight_brightness); return true; } + |