64x128 Graphic LCD Library
Fork of C12832_lcd by
Diff: gLCD.h
- Revision:
- 10:269eddb2b7c5
- Parent:
- 9:4b0d5aee5371
- Child:
- 11:cbee83ead206
--- a/gLCD.h Sat Oct 26 17:38:46 2013 +0000 +++ b/gLCD.h Fri Nov 01 10:19:59 2013 +0000 @@ -12,11 +12,15 @@ * THE SOFTWARE. */ +/** 64x128pixel graphic LCD display class adapted from the C12832 library */ #ifndef GLCD_H #define GLCD_H #include "mbed.h" #include "GraphicsDisplay.h" +#include "Small_7.h" +#include "Arial12x12.h" +#include "Arial24x23.h" /** optional Defines : @@ -44,11 +48,16 @@ class gLCD : public GraphicsDisplay { public: - /** Create a gLCD object connected to SPI1 + /** Create a gLCD object connected to SPI bus * */ - gLCD(const char* name = "LCD"); + gLCD(PinName cs, //chip select + PinName res, //reset + PinName rs, //register select + PinName sdo, PinName sdi, PinName scl, //spi bus pins + PinName bcl, //backlight + const char* name = "LCD"); /** Get the width of the screen in pixel * @@ -71,6 +80,8 @@ * @param y vertical position * @param colour ,1 set pixel ,0 erase pixel */ + + void set_orientation(unsigned int o); virtual void pixel(int x, int y,int colour); /** draw a circle @@ -80,6 +91,8 @@ * @param colour ,1 set pixel ,0 erase pixel * */ + void bclIncrease(); + void bclDecrease(); void circle(int x, int y, int r, int colour); /** draw a filled circle @@ -217,6 +230,7 @@ DigitalOut _reset; DigitalOut _A0; DigitalOut _CS; + PwmOut backLight; unsigned char* font; unsigned int draw_mode; @@ -281,8 +295,9 @@ unsigned int orientation; unsigned int char_x; + unsigned int oldchar_x; unsigned int char_y; - unsigned char buffer[512]; + unsigned char buffer[1024]; unsigned int contrast; unsigned int auto_up;