From c3aacc4722ff5c441b5c36b8443d96f90dbf0ae6 Mon Sep 17 00:00:00 2001 From: andreas 'randy' weinberger Date: Sat, 25 Sep 2010 10:16:54 +0200 Subject: added futuba MDM166A driver from andreas brachold http://projects.vdr-developer.org/issues/351 --- glcddrivers/futabaMDM166A.h | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 glcddrivers/futabaMDM166A.h (limited to 'glcddrivers/futabaMDM166A.h') 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 + * + * 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 +#include + +namespace GLCD +{ + class cDriverConfig; + + class cHIDQueue : public std::queue { + 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 + + + -- cgit v1.2.3