summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-17 19:55:27 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-17 19:55:27 +0000
commit3520d8e90e7f6e3ffc88f8d1ff47fa3cc0efe960 (patch)
tree814a3bcd5d0fc6ee0c99d57d5f188e7f113ec29f /firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
parentbc1fd05dc1f025bdeb2e79fb552472775bedd156 (diff)
downloadrockbox-3520d8e90e7f6e3ffc88f8d1ff47fa3cc0efe960.tar.gz
rockbox-3520d8e90e7f6e3ffc88f8d1ff47fa3cc0efe960.zip
Sansa c200v2 : lcd & backlight support, using the c200v1 lcd driver
The LCD driver is unified and lcd_send_command now takes 2 arguments : the command and its argument. If there is no argument, it's set to 0 and a NOP command is issued If there is more than one argument (set X/Y address), the 2nd argument is sent as a 2nd command, and a NOP command is issued after it. Benefit : c200v2 transfers the command and the argument in one 16 bits transfer Performance should not be affected since commands without argument are only used in lcd_init() and lcd_enable() lcd_send_data() now transfers whole lines (or columns) instead of single pixels yuv is disabled for c200v2 for now Some buttons can be read, including left button (bit 6 of DBOP_DIN), but for some reason they have no effect in rockbox: to be investigated git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21321 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c')
-rw-r--r--firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c b/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
index f036792fc0..858e9aed49 100644
--- a/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
+++ b/firmware/target/arm/as3525/sansa-c200v2/backlight-c200v2.c
@@ -26,8 +26,12 @@
26#include "ascodec-target.h" 26#include "ascodec-target.h"
27#include "as3514.h" 27#include "as3514.h"
28 28
29/* TODO: This file is copy & pasted from backlight-e200v2-fuze.c, as I think 29bool _backlight_init(void)
30 * it'll be the same for c200v2; prove it */ 30{
31 GPIOA_DIR |= 1<<5;
32 return true;
33}
34
31void _backlight_set_brightness(int brightness) 35void _backlight_set_brightness(int brightness)
32{ 36{
33 if (brightness > 0) 37 if (brightness > 0)
@@ -41,12 +45,12 @@ void _backlight_on(void)
41#ifdef HAVE_LCD_ENABLE 45#ifdef HAVE_LCD_ENABLE
42 lcd_enable(true); /* power on lcd + visible display */ 46 lcd_enable(true); /* power on lcd + visible display */
43#endif 47#endif
44 ascodec_write(AS3514_DCDC15, backlight_brightness); 48 GPIOA_PIN(5) = 1<<5;
45} 49}
46 50
47void _backlight_off(void) 51void _backlight_off(void)
48{ 52{
49 ascodec_write(AS3514_DCDC15, 0x0); 53 GPIOA_PIN(5) = 0;
50#ifdef HAVE_LCD_ENABLE 54#ifdef HAVE_LCD_ENABLE
51 lcd_enable(false); /* power off visible display */ 55 lcd_enable(false); /* power off visible display */
52#endif 56#endif