summaryrefslogtreecommitdiff
path: root/glcddrivers/futabaMDM166A.h
diff options
context:
space:
mode:
authorandreas 'randy' weinberger <vdr@smue.org>2010-09-25 10:16:54 +0200
committerandreas 'randy' weinberger <vdr@smue.org>2010-09-25 10:16:54 +0200
commitc3aacc4722ff5c441b5c36b8443d96f90dbf0ae6 (patch)
treed48b1bd49e7d2c8adaec57208281ad60b33983b8 /glcddrivers/futabaMDM166A.h
parent5c6cbd1eb40cf4508a42a6948b4a3166f65f7664 (diff)
downloadgraphlcd-base-c3aacc4722ff5c441b5c36b8443d96f90dbf0ae6.tar.gz
graphlcd-base-c3aacc4722ff5c441b5c36b8443d96f90dbf0ae6.tar.bz2
added futuba MDM166A driver from andreas brachold
http://projects.vdr-developer.org/issues/351
Diffstat (limited to 'glcddrivers/futabaMDM166A.h')
-rw-r--r--glcddrivers/futabaMDM166A.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/glcddrivers/futabaMDM166A.h b/glcddrivers/futabaMDM166A.h
new file mode 100644
index 0000000..ca1783d
--- /dev/null
+++ b/glcddrivers/futabaMDM166A.h
@@ -0,0 +1,75 @@
+/*
+ * GraphLCD driver library
+ *
+ * (C) 2010 Andreas Brachold <vdr07 AT deltab de>
+ *
+ * This file is released under the GNU General Public License.
+ *
+ * See the files README and COPYING for details.
+ *
+ */
+
+#ifndef _GLCDDRIVERS_FutabaMDM166A_H_
+#define _GLCDDRIVERS_FutabaMDM166A_H_
+
+#include "driver.h"
+
+#define HAVE_STDBOOL_H
+#include <hid.h>
+#include <queue>
+
+namespace GLCD
+{
+ class cDriverConfig;
+
+ class cHIDQueue : public std::queue<byte> {
+ HIDInterface* hid;
+ bool bInit;
+ public:
+ cHIDQueue();
+ virtual ~cHIDQueue();
+ virtual bool open();
+ virtual void close();
+ virtual bool isopen() const { return hid != 0; }
+ void Cmd(const byte & cmd);
+ void Data(const byte & data);
+ bool Flush();
+ private:
+ const char *hiderror(hid_return ret) const;
+ };
+
+ class cDriverFutabaMDM166A : public cDriver, cHIDQueue
+ {
+ cDriverConfig * config;
+ cDriverConfig * oldConfig;
+ unsigned char *m_pDrawMem; // the draw "memory"
+ unsigned char *m_pVFDMem; // the double buffed display "memory"
+ unsigned int m_iSizeYb;
+ unsigned int m_nRefreshCounter;
+ unsigned int lastIconState;
+ int CheckSetup();
+ protected:
+ void ClearVFDMem();
+ void SetPixel(int x, int y);
+ void icons(unsigned int state);
+ bool SendCmdClock();
+ bool SendCmdShutdown();
+
+ public:
+ cDriverFutabaMDM166A(cDriverConfig * config);
+ virtual ~cDriverFutabaMDM166A();
+
+ virtual int Init();
+ virtual int DeInit();
+
+ virtual void Clear();
+ virtual void Set8Pixels(int x, int y, byte data);
+ virtual void Refresh(bool refreshAll = false);
+
+ virtual void SetBrightness(unsigned int percent);
+ };
+};
+#endif
+
+
+