summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-11-27 21:07:54 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-11-27 21:07:54 +0000
commit81fe625a6205e9a0a103e76bed13e4701205cf97 (patch)
tree7d037083ea2361cad51fa7a79a8bdfed779993bb /firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
parent6d34e33b94d6074b96917d792dc688c5fbd9356b (diff)
downloadrockbox-81fe625a6205e9a0a103e76bed13e4701205cf97.tar.gz
rockbox-81fe625a6205e9a0a103e76bed13e4701205cf97.zip
Sansa Clip: grey lib support (not calibrated yet)
Declare HAVE_LCD_INVERT Put the framebuffer into IRAM git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19249 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c')
-rw-r--r--firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
index f1e1c24b85..703b7e1307 100644
--- a/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/sansa-clip/lcd-ssd1303.c
@@ -88,6 +88,7 @@ void lcd_write_command(int byte)
88 GPIOA_PIN(5) = 0; 88 GPIOA_PIN(5) = 0;
89 89
90 /* Write command */ 90 /* Write command */
91 /* Only bits 15:12 and 3:0 of DBOP_DOUT are meaningful */
91 DBOP_DOUT = (byte << 8) | byte; 92 DBOP_DOUT = (byte << 8) | byte;
92 93
93 /* While push fifo is not empty */ 94 /* While push fifo is not empty */
@@ -103,6 +104,7 @@ void lcd_write_data(const fb_data* p_bytes, int count)
103 while (count--) 104 while (count--)
104 { 105 {
105 /* Write pixels */ 106 /* Write pixels */
107 /* Only bits 15:12 and 3:0 of DBOP_DOUT are meaningful */
106 DBOP_DOUT = (*p_bytes << 8) | *p_bytes; 108 DBOP_DOUT = (*p_bytes << 8) | *p_bytes;
107 109
108 p_bytes++; /* next packed pixels */ 110 p_bytes++; /* next packed pixels */
@@ -266,26 +268,30 @@ void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
266 } 268 }
267} 269}
268 270
271/* Helper function for lcd_grey_phase_blit(). */
272void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
269 273
270/* Performance function that works with an external buffer 274/* Performance function that works with an external buffer
271 note that by and bheight are in 8-pixel units! */ 275 note that by and bheight are in 8-pixel units! */
272void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, 276void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
273 int x, int by, int width, int bheight, int stride) 277 int x, int by, int width, int bheight, int stride)
274{ 278{
275 /* TODO */
276
277#if 0
278 if(!display_on) 279 if(!display_on)
279 return; 280 return;
280#endif 281
281 282 stride <<= 3; /* 8 pixels per block */
282 (void)values; 283 /* Copy display bitmap to hardware */
283 (void)phases; 284 while (bheight--)
284 (void)x; 285 {
285 (void)by; 286 lcd_write_command (LCD_CNTL_PAGE | (by++ & 0xf));
286 (void)width; 287 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+2+xoffset)>>4) & 0xf));
287 (void)bheight; 288 lcd_write_command (LCD_CNTL_LOWCOL | ((x+2+xoffset) & 0xf));
288 (void)stride; 289
290 lcd_grey_data(values, phases, width);
291
292 values += stride;
293 phases += stride;
294 }
289} 295}
290 296
291/* Update the display. 297/* Update the display.