summaryrefslogtreecommitdiff
path: root/glcddrivers/ks0108.c
diff options
context:
space:
mode:
Diffstat (limited to 'glcddrivers/ks0108.c')
-rw-r--r--glcddrivers/ks0108.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/glcddrivers/ks0108.c b/glcddrivers/ks0108.c
index de9c505..042f286 100644
--- a/glcddrivers/ks0108.c
+++ b/glcddrivers/ks0108.c
@@ -6,7 +6,8 @@
* This file is released under the GNU General Public License. Refer
* to the COPYING file distributed with this package.
*
- * (c) 2003 Andreas 'randy' Weinberger <vdr AT smue.org>
+ * (c) 2003-2011 Andreas 'randy' Weinberger <vdr AT smue.org>
+ * (c) 2011 Wolfgang Astleitner <mrwastl AT users.sourceforge.net>
*/
#include <syslog.h>
@@ -41,10 +42,8 @@ const unsigned char kCS2LO = 0x04;
cDriverKS0108::cDriverKS0108(cDriverConfig * config)
-: config(config)
+: cDriver(config)
{
- oldConfig = new cDriverConfig(*config);
-
port = new cParallelPort();
refreshCounter = 0;
@@ -55,7 +54,6 @@ cDriverKS0108::cDriverKS0108(cDriverConfig * config)
cDriverKS0108::~cDriverKS0108()
{
delete port;
- delete oldConfig;
}
int cDriverKS0108::Init()
@@ -420,6 +418,29 @@ void cDriverKS0108::Clear()
memset(LCD[x], 0, height);
}
+
+void cDriverKS0108::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)
+ LCD[x / 8][y] |= (1 << pos);
+ else
+ LCD[x / 8][y] &= ( 0xFF ^ (1 << pos) );
+}
+
+
+#if 0
void cDriverKS0108::Set8Pixels(int x, int y, unsigned char data)
{
if (x >= width || y >= height)
@@ -438,6 +459,7 @@ void cDriverKS0108::Set8Pixels(int x, int y, unsigned char data)
LCD[x / 8][y] = LCD[x / 8][y] | ReverseBits(data);
}
}
+#endif
void cDriverKS0108::Refresh(bool refreshAll)
{