diff options
Diffstat (limited to 'glcddrivers/hd61830.c')
-rw-r--r-- | glcddrivers/hd61830.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/glcddrivers/hd61830.c b/glcddrivers/hd61830.c index 7f0bd53..25f39ff 100644 --- a/glcddrivers/hd61830.c +++ b/glcddrivers/hd61830.c @@ -7,6 +7,8 @@ * to the COPYING file distributed with this package. * * (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online.de> + * (c) 2005-2010 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2011 Wolfgang Astleitner <mrwastl AT users.sourceforge.net> */ #include <syslog.h> @@ -55,10 +57,8 @@ namespace GLCD cDriverHD61830::cDriverHD61830(cDriverConfig * config) -: config(config) +: cDriver(config) { - oldConfig = new cDriverConfig(*config); - port = new cParallelPort(); useSleepInit = false; @@ -70,7 +70,6 @@ cDriverHD61830::cDriverHD61830(cDriverConfig * config) cDriverHD61830::~cDriverHD61830() { delete port; - delete oldConfig; } int cDriverHD61830::Init() @@ -301,6 +300,29 @@ void cDriverHD61830::Clear() memset(newLCD[x], 0, height); } + +void cDriverHD61830::SetPixel(int x, int y, uint32_t data) +{ + if (x >= width || y >= height) + return; + + int pos = x % 8; + if (config->upsideDown) + { + x = width - 1 - x; + y = height - 1 - y; + //} else { + pos = 7 - pos; // reverse bit position + } + + if (data == GRAPHLCD_White) + newLCD[x / 8][y] |= ( 1 << pos ); + else + newLCD[x / 8][y] &= ( 0xFF ^ ( 1 << pos ) ); +} + + +#if 0 void cDriverHD61830::Set8Pixels(int x, int y, unsigned char data) { if (x >= width || y >= height) @@ -319,6 +341,7 @@ void cDriverHD61830::Set8Pixels(int x, int y, unsigned char data) newLCD[x / 8][y] = newLCD[x / 8][y] | data; } } +#endif void cDriverHD61830::Refresh(bool refreshAll) { |