Library to drive DogM16x text displays
DogM16x.h
- Committer:
- FrankWeissenborn
- Date:
- 2011-01-28
- Revision:
- 3:fb071acba88f
- Parent:
- 1:7557380ce11e
- Child:
- 4:a6c719e188f1
File content as of revision 3:fb071acba88f:
#ifndef __DOGM16X_H #define __DOGM16X_H #include "defines.h" #include "mbed.h" typedef enum DogM16x_LINE { DogM16x_LINE_ONE = 0, /*!< Line 1 */ DogM16x_LINE_TWO = 1, /*!< Line 2 */ DogM16x_LINE_THREE = 2, /*!< Line 3; if exist */ } DogM16x_LINE; typedef enum DogM16x_TYPE { DogM16x_DogM161 = 0, /*!< DogM161 Display */ DogM16x_DogM162 = 1, /*!< DogM162 Display */ DogM16x_DogM163 = 2, /*!< DogM163 Display */ } DogM16x_TYPE; class DogM16x { public: DogM16x(PinName db0, PinName db1, PinName db2, PinName db3, PinName rw, PinName rs, PinName enable, PinName reset, DogM16x_TYPE); void Clear(); void SetPosition(unsigned char x, DogM16x_LINE line); void WriteCharacter(char character); void WriteCharacter(char character, unsigned char x, DogM16x_LINE line); void WriteString(const char* string); void WriteString(const char* string, unsigned char x, DogM16x_LINE line); void WriteStringCompleteLine(const char* string, DogM16x_LINE line); void WriteStringCompleteLine(const char* string, unsigned char x, DogM16x_LINE line); private: BusOut _d; DigitalOut _rw; DigitalOut _rs; DigitalOut _enable; DigitalOut _reset; DogM16x_TYPE _type; unsigned char _xpos; unsigned char _ypos; void Init(); void WriteCommandByte(int cmd); void WriteDataByte(int cmd); void SetData(int data); }; #endif