LS020.h is a MobileLCD library for the LS020 display (used in GSM Siemens S65 family). Resolution 176x132
Revision 2:d048f09dcfb0, committed 2010-12-08
- Comitter:
- Wimpie
- Date:
- Wed Dec 08 19:29:42 2010 +0000
- Parent:
- 1:2269e07af50b
- Commit message:
Changed in this revision
LS020LCD.cpp | Show annotated file Show diff for this revision Revisions of this file |
LS020LCD.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2269e07af50b -r d048f09dcfb0 LS020LCD.cpp --- a/LS020LCD.cpp Mon Dec 06 20:37:10 2010 +0000 +++ b/LS020LCD.cpp Wed Dec 08 19:29:42 2010 +0000 @@ -153,13 +153,12 @@ _rotate=rotate; _mirror=mirror; - if (rotate==0) { //default = 176 x 132 + if (_rotate==0) { //default = 176 x 132 _width=132; _height=176; } else { //132 x 176 _width=176; _height=132; - } } @@ -286,14 +285,15 @@ } void LS020LCD::set_window(char x0, char y0, char x1,char y1) { - // write_cmd16(0x0500);// Set Direction - // write_cmd16(0x0A00+x1); - // write_cmd16(0x0B00+x2); - // write_cmd16(0x0800+y1); - // write_cmd16(0x0900+y2); + write_cmd16(0x0500);// Set Direction + write_cmd16(0x0A00+x0); + write_cmd16(0x0B00+x1); + write_cmd16(0x0800+y0); + write_cmd16(0x0900+y1); - //set area - write_cmd16(0xEF90); + /* + write_cmd16(0xEF90); + if (_rotate) { if (_mirror) { write_cmdRG(0x08, (_width-1)-x0); //set x0 @@ -321,7 +321,7 @@ } //set cursor - set_cursor(x0, y0); + set_cursor(x0, y0);*/ } @@ -578,7 +578,7 @@ return; } -/*void LS020LCD::rectangle8(char x1, char y1, char x2, char y2, char color) { +void LS020LCD::rectangle8(char x1, char y1, char x2, char y2, char color) { set_window(x1,y1,x2,y2); for (char y=y1;y<=y2;y++) { for (char x=x1;x<=x2;x++) { @@ -612,7 +612,25 @@ } } } -}*/ +} + +void LS020LCD::put_string8(char x, char y, char* text, char color, char bkcolor) { + char i=0; + char x0=0; + while (text[i]!=0) { + put_char8(x+x0,y,text[i],color,bkcolor); + i++; + x0+=6; + } +} + +void LS020LCD::draw_table(void) { + for (char y=0; y<16; y++) { + for (char x=0; x<16; x++) { + rectangle8(x*10+9,y*7+5,x*10+8+9,y*7+5+5,y*16+x); + } + } +} void LS020LCD::drawtext(unsigned int x, unsigned int y, char* text, unsigned int size,unsigned int font, unsigned int color, unsigned int bgcolor) { char i=0;
diff -r 2269e07af50b -r d048f09dcfb0 LS020LCD.h --- a/LS020LCD.h Mon Dec 06 20:37:10 2010 +0000 +++ b/LS020LCD.h Wed Dec 08 19:29:42 2010 +0000 @@ -76,7 +76,12 @@ void drawtext(unsigned int x, unsigned int y, char* text, unsigned int size,unsigned int font, unsigned int color, unsigned int bgcolor); void scroll(char offset); void cls(); - + void rectangle8(char x1, char y1, char x2, char y2, char color); + void putpixel(unsigned char r,unsigned char g,unsigned char b, unsigned char x, unsigned char y); + void put_char8(char x, char y, char symbol, char color, char bkcolor); + void put_string8(char x, char y, char* text, char color, char bkcolor); + void draw_table(void); + private: SPI _spi; DigitalOut _rst;