UniGraphic-Fork for ST7920-LCD-controller and SH1106. Tested with 128x64 LCD with SPI and 128x64-OLED with IIC
Dependents: UniGraphic-St7920-Test AfficheurUTILECO
Fork of UniGraphic by
Fork of the UniGraphic-Library for monochrome LCDs with ST7920 controller and 128x64-IIC-OLED-Display with SH1106-Controller
Had to adapt LCD for following reasons:
- Give access to screenbuffer buffer[] to parent class
- pixel() and pixel_read() as they are hardware-dependent
- added reset-pin to IIC-Interface
GraphicDisplay:: sends buffer to LCD when auto_update is set to true.
Testprogram for ST7920 can be found here:
https://developer.mbed.org/users/charly/code/UniGraphic-St7920-Test/
Diff: Display/LCD.h
- Revision:
- 2:713844a55c4e
- Parent:
- 1:ff019d22b275
- Child:
- 4:12ba0ecc2c1f
--- a/Display/LCD.h Fri Feb 13 15:25:10 2015 +0000 +++ b/Display/LCD.h Fri Feb 13 23:17:55 2015 +0000 @@ -8,10 +8,6 @@ #include "SPI16.h" #include "Protocols.h" -#define Black 1 -#define White 0 - - /** Draw mode * NORMAl @@ -76,6 +72,19 @@ * @param color is the pixel color. */ virtual void window_pushpixel(unsigned short color); + + /** Push some pixels of the same color into the window and increment position. + * You must first call window() then push pixels. + * @param color is the pixel color. + * @param count: how many + */ + virtual void window_pushpixel(unsigned short color, unsigned int count); + + /** Push array of pixel colors into the window and increment position. + * You must first call window() then push pixels. + * @param color is the pixel color. + */ + virtual void window_pushpixelbuf(unsigned short* color, unsigned int lenght); /** Framebuffer is used, it needs to be sent to LCD from time to time */ @@ -105,19 +114,7 @@ */ virtual void cls(); - /** setup auto update of screen - * - * @param up 1 = on , 0 = off - * if switched off the program has to call copy_to_lcd() - * to update screen from framebuffer - */ - void set_auto_up(bool up); - - /** get status of the auto update function - * - * @returns if auto update is on - */ - bool get_auto_up(void); + @@ -219,7 +216,7 @@ private: - + Protocols* proto; unsigned char *buffer; unsigned short *buffer16; const int LCDSIZE_X;