A lib for accessing ST7626 based lcds. It provides a set_pixel function. It is only tested with one display.
Diff: font.c
- Revision:
- 2:04fb8af3ecb0
- Parent:
- 1:ae0b4880e9db
- Child:
- 4:a4925df73101
diff -r ae0b4880e9db -r 04fb8af3ecb0 font.c --- a/font.c Sat Jan 08 19:17:57 2011 +0000 +++ b/font.c Sat Jan 08 22:28:13 2011 +0000 @@ -3,17 +3,6 @@ #define BACKROUND_COLOR 0xFF -void lcd_printf(char *s, int x, int y) { - while(*s){ - x += 5; - lcd_putc(*s++,x,y); - } -} - -void lcd_putc(char c, int x, int y) { - - Display5x7Font(c, x, y, 0x00); -} void Display5x7Font(char letter, char x, char y, int16_t color) { //Schrift erstellen auf schwarzem Hintergrund @@ -21,10 +10,10 @@ Write(COMMAND, 0x30); // Ext = 0 Write(COMMAND, 0x15); // Column address set Write(DATA, x); // From column address - Write(DATA, x+4 ); //nit 5 da erste x addresse schon zählt + Write(DATA, x+4 ); //nit 5 da erste x addresse schon z�hlt Write(COMMAND, 0x75); // Page address set Write(DATA, y); // From page address - Write(DATA, y+7); //nit 8 , da ja die y Addresse schon zählt + Write(DATA, y+7); //nit 8 , da ja die y Addresse schon z�hlt Write(COMMAND, 0x5c); // Entry Memory Write Mode int sign = (letter - 0x20) * 5; @@ -59,10 +48,10 @@ Write(COMMAND, 0x30); // Ext = 0 Write(COMMAND, 0x15); // Column address set Write(DATA, x); // From column address - Write(DATA, x+4 ); //nit 5 da erste x addresse schon zählt + Write(DATA, x+4 ); //nit 5 da erste x addresse schon z�hlt Write(COMMAND, 0x75); // Page address set Write(DATA, y); // From page address - Write(DATA, y+7); //nit 8 , da ja die y Addresse schon zählt + Write(DATA, y+7); //nit 8 , da ja die y Addresse schon z�hlt Write(COMMAND, 0x5c); // Entry Memory Write Mode int sign = (letter - 0x20) * 5; @@ -97,10 +86,10 @@ Write(COMMAND, 0x30); // Ext = 0 Write(COMMAND, 0x15); // Column address set Write(DATA, x); // From column address - Write(DATA, x+11 ); //nit 12 da erste x addresse schon zählt + Write(DATA, x+11 ); //nit 12 da erste x addresse schon z�hlt Write(COMMAND, 0x75); // Page address set Write(DATA, y); // From page address - Write(DATA, y+7); //nit 16 , da ja die y Addresse schon zählt + Write(DATA, y+7); //nit 16 , da ja die y Addresse schon z�hlt Write(COMMAND, 0x5c); // Entry Memory Write Mode int sign = (letter - 0x20) * 24; @@ -131,10 +120,10 @@ Write(COMMAND, 0x30); // Ext = 0 Write(COMMAND, 0x15); // Column address set Write(DATA, x); // From column address - Write(DATA, x+11 ); //nit 12 da erste x addresse schon zählt + Write(DATA, x+11 ); //nit 12 da erste x addresse schon z�hlt Write(COMMAND, 0x75); // Page address set Write(DATA, y+8); // From page address - Write(DATA, y+15); //nit 16 , da ja die y Addresse schon zählt + Write(DATA, y+15); //nit 16 , da ja die y Addresse schon z�hlt Write(COMMAND, 0x5c); // Entry Memory Write Mode sign = (letter - 0x20) * 24;