From f608229f32711970513b9cc6f3573b8ab6e7ea4b Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 2 Apr 2011 08:24:14 +0000 Subject: 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 --- firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'firmware/target/arm/as3525/sansa-clipplus/lcd-clip-plus.c') 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--) -- cgit v1.2.3