A lib for accessing ST7626 based lcds. It provides a set_pixel function. It is only tested with one display.
Diff: lcd.c
- Revision:
- 5:70dcbb284628
- Parent:
- 3:5b7d04c36d1a
diff -r a4925df73101 -r 70dcbb284628 lcd.c --- a/lcd.c Sat Jan 08 23:13:52 2011 +0000 +++ b/lcd.c Sun Jan 09 22:04:01 2011 +0000 @@ -161,7 +161,7 @@ } -void lcd_putpixel( int x, int y, int16_t color){ +void lcd_putpixel( int x, int y, int16_t color) { Write(COMMAND, 0x30); // Ext = 0 Write(COMMAND, 0x15); // Column address set Write(DATA, x); // From column address 0 to 97 @@ -171,15 +171,15 @@ Write(DATA, y+1); Write(COMMAND, 0x5c); // Entry Memory Write Mode - Write(DATA, (int8_t)(color&0xFF)); - Write(DATA, (int8_t)((color>>8)&0xFF)); + Write(DATA, (int8_t) (color>>8)); + Write(DATA, (int8_t) (color)); + } -void LCD_clear(int16_t GroundColor) { - //Display schwarz malen f�r Schrift Vorbereitung +void lcd_clear(int16_t GroundColor) { unsigned char i, j; Write(COMMAND, 0x30); // Ext = 0 Write(COMMAND, 0x15); // Column address set @@ -193,8 +193,9 @@ for (j = 0; j < 68 ; j++) { for (i = 0 ; i < 98 ; i++) { - Write(DATA, GroundColor); - Write(DATA, GroundColor>>8); + Write(DATA, (int8_t) (GroundColor>>8)); + Write(DATA, (int8_t) (GroundColor)); + } } }