Own fork of MbedSmartRestMain
Dependencies: C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed
Fork of MbedSmartRestMain by
Diff: io/LCDDisplay.h
- Revision:
- 92:0acd11870c6a
- Child:
- 93:61d44636f020
diff -r 48069375dffa -r 0acd11870c6a io/LCDDisplay.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/io/LCDDisplay.h Mon Apr 13 14:24:58 2015 +0000 @@ -0,0 +1,35 @@ +#ifndef LCDDISPLAY_H +#define LCDDISPLAY_H +#include <string.h> +#include "C12832.h" +#include "rtos.h" +#define DISPLAY_LEN 28 + +class LCDDisplay +{ +public: + LCDDisplay(): firstLine(""), secondLine(""), thirdLine(""), + _lcd(D11, D13, D12, D7, D10) {} + void setFirstLine(const char* p); + const char *getFirstLine() const { return firstLine; } + void setSecondLine(const char* p); + const char *getSecondLine() const { return secondLine; } + void setThirdLine(const char* p); + const char *getThirdLine() const { return thirdLine; } + void setLines(const char *p1, const char *p2=NULL, const char *p3=NULL); + void clear(); + virtual ~LCDDisplay() {} + +protected: + void lcdPrint(const char*, const char* = NULL, const char* = NULL); + void _setLine(char *dest, const char* src, size_t n); + +private: + char firstLine[DISPLAY_LEN]; + char secondLine[DISPLAY_LEN]; + char thirdLine[DISPLAY_LEN]; + C12832 _lcd; + Mutex lcdLock; +}; + +#endif /* LCDDISPLAY_H */