C12832 LCD library
Fork of C12832_lcd by
Diff: C12832_lcd.h
- Revision:
- 9:55d53324e7fa
- Parent:
- 3:468cdccff7af
--- a/C12832_lcd.h Thu Oct 25 17:34:34 2012 +0000 +++ b/C12832_lcd.h Thu Jun 05 04:54:25 2014 +0000 @@ -41,14 +41,24 @@ */ enum {NORMAL,XOR}; -class C12832_LCD : public GraphicsDisplay +/** Bitmap + */ +struct Bitmap{ + int xSize; + int ySize; + int Byte_in_Line; + char* data; + }; + +class C12832 : public GraphicsDisplay { public: - /** Create a C12832_LCD object connected to SPI1 + /** Create a C12832 object connected to SPI1 * */ - C12832_LCD(const char* name = "LCD"); + C12832(PinName mosi, PinName sck, PinName reset, PinName a0, PinName ncs, const char* name = "LCD"); + /** Get the width of the screen in pixel * @@ -130,12 +140,6 @@ * */ - //void set_orientation(unsigned int o); - - /** set the contrast of the screen - * - * @param o contrast 0-63 - */ void set_contrast(unsigned int o); @@ -145,7 +149,6 @@ unsigned int get_contrast(void); - /** invert the screen * * @param o = 0 normal, 1 invert @@ -164,7 +167,7 @@ void setmode(int mode); - int columns(void); + virtual int columns(void); /** calculate the max number of columns * @@ -172,7 +175,7 @@ * depends on actual font size * */ - int rows(void); + virtual int rows(void); /** put a char on the screen * @@ -180,7 +183,7 @@ * @returns printed char * */ - int _putc(int value); + virtual int _putc(int value); /** draw a character on given position out of the active font to the LCD * @@ -196,7 +199,7 @@ * @param x x-position (top left) * @param y y-position */ - void locate(int x, int y); + virtual void locate(int x, int y); /** setup auto update of screen * @@ -204,13 +207,13 @@ * if switched off the program has to call copy_to_lcd() * to update screen from framebuffer */ - void C12832_LCD::set_auto_up(unsigned int up); + void set_auto_up(unsigned int up); /** get status of the auto update function * * @returns if auto update is on */ - unsigned int C12832_LCD::get_auto_up(void); + unsigned int get_auto_up(void); /** Vars */ SPI _spi; @@ -235,7 +238,16 @@ * */ void set_font(unsigned char* f); + + /** print bitmap to buffer + * + * @param bm Bitmap in flash + * @param x x start + * @param y y start + * + */ + void print_bm(Bitmap bm, int x, int y); protected: