summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-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)
35 SSP_CR1 = (1<<3) | (1<<1); /* SSP Operation enabled */ 35 SSP_CR1 = (1<<3) | (1<<1); /* SSP Operation enabled */
36 SSP_IMSC = 0; /* No interrupts */ 36 SSP_IMSC = 0; /* No interrupts */
37 37
38 GPIOA_DIR |= (1<<5); 38 /* configure GPIO B2 (display D/C#) as output */
39 GPIOB_DIR |= (1<<2) | (1<<7); 39 GPIOB_DIR |= (1<<2);
40
41 /* configure GPIO B3 (display type detect) as input */
40 GPIOB_DIR &= ~(1<<3); 42 GPIOB_DIR &= ~(1<<3);
41 GPIOB_PIN(7) = 0; 43
44 /* set GPIO A5 (display RESET# ?) */
45 GPIOA_DIR |= (1<<5);
42 GPIOA_PIN(5) = (1<<5); 46 GPIOA_PIN(5) = (1<<5);
43 47
48 /* detect display type on GPIO B3 */
44 return GPIOB_PIN(3) ? 1 : 0; 49 return GPIOB_PIN(3) ? 1 : 0;
45} 50}
46 51
@@ -49,15 +54,17 @@ void lcd_write_command(int byte)
49 while(SSP_SR & (1<<4)) /* BSY flag */ 54 while(SSP_SR & (1<<4)) /* BSY flag */
50 ; 55 ;
51 56
57 /* LCD command mode */
52 GPIOB_PIN(2) = 0; 58 GPIOB_PIN(2) = 0;
59
53 SSP_DATA = byte; 60 SSP_DATA = byte;
54
55 while(SSP_SR & (1<<4)) /* BSY flag */ 61 while(SSP_SR & (1<<4)) /* BSY flag */
56 ; 62 ;
57} 63}
58 64
59void lcd_write_data(const fb_data* p_bytes, int count) 65void lcd_write_data(const fb_data* p_bytes, int count)
60{ 66{
67 /* LCD data mode */
61 GPIOB_PIN(2) = (1<<2); 68 GPIOB_PIN(2) = (1<<2);
62 69
63 while (count--) 70 while (count--)