summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c')
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c b/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
index d7266f72a0..0b3317255a 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
+++ b/firmware/target/arm/as3525/sansa-clipv2/lcd-clipv2.c
@@ -63,6 +63,35 @@ void lcd_write_command(int byte)
63 DBOP_TIMPOL_23 = 0xE037E037; 63 DBOP_TIMPOL_23 = 0xE037E037;
64} 64}
65 65
66void lcd_write_cmd_triplet(int cmd1, int cmd2, int cmd3)
67{
68#ifndef LCD_USE_FIFO_FOR_COMMANDS
69 lcd_write_command(cmd1);
70 lcd_write_command(cmd2);
71 lcd_write_command(cmd3);
72#else
73 /* combine writes to data register */
74
75 while ((DBOP_STAT & (1<<10)) == 0) /* While push fifo is not empty */
76 ;
77 /* FIFO is empty at this point */
78 /* unset D/C# (data or command) */
79 GPIOB_PIN(2) = 0;
80 DBOP_TIMPOL_23 = 0xE0370036;
81
82 /* Write command */
83 /* !!makes assumption FIFO is at least (3) levels deep! */
84 DBOP_DOUT8 = cmd1;
85 DBOP_DOUT8 = cmd2;
86 DBOP_DOUT8 = cmd3;
87 /* While push fifo is not empty */
88 while ((DBOP_STAT & (1<<10)) == 0)
89 ;
90
91 DBOP_TIMPOL_23 = 0xE037E037;
92#endif
93}
94
66void lcd_write_data(const fb_data* p_bytes, int count) 95void lcd_write_data(const fb_data* p_bytes, int count)
67{ 96{
68 volatile int i = 0; 97 volatile int i = 0;