summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-clipplus
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-04-02 08:24:14 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-04-02 08:24:14 +0000
commitf608229f32711970513b9cc6f3573b8ab6e7ea4b (patch)
treedb3a735b464e305118b3b17061bf927c8a011359 /firmware/target/arm/as3525/sansa-clipplus
parenteab630a1e1463be244118613537f6a04d290f5e0 (diff)
Sansa clip+: do not set GPIO B7 in the display driver, it's already used for FM radio I2C
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29668 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipplus')
-rw-r--r--firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c b/firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c
index ac7b77d772..3ee3578171 100644
--- a/firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c
+++ b/firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c
@@ -35,12 +35,17 @@ int lcd_hw_init(void)
SSP_CR1 = (1<<3) | (1<<1); /* SSP Operation enabled */
SSP_IMSC = 0; /* No interrupts */
- GPIOA_DIR |= (1<<5);
- GPIOB_DIR |= (1<<2) | (1<<7);
+ /* configure GPIO B2 (display D/C#) as output */
+ GPIOB_DIR |= (1<<2);
+
+ /* configure GPIO B3 (display type detect) as input */
GPIOB_DIR &= ~(1<<3);
- GPIOB_PIN(7) = 0;
+
+ /* set GPIO A5 (display RESET# ?) */
+ GPIOA_DIR |= (1<<5);
GPIOA_PIN(5) = (1<<5);
+ /* detect display type on GPIO B3 */
return GPIOB_PIN(3) ? 1 : 0;
}
@@ -49,15 +54,17 @@ void lcd_write_command(int byte)
while(SSP_SR & (1<<4)) /* BSY flag */
;
+ /* LCD command mode */
GPIOB_PIN(2) = 0;
+
SSP_DATA = byte;
-
while(SSP_SR & (1<<4)) /* BSY flag */
;
}
void lcd_write_data(const fb_data* p_bytes, int count)
{
+ /* LCD data mode */
GPIOB_PIN(2) = (1<<2);
while (count--)