Own fork of MbedSmartRestMain

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Cumulocity Official

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LCDDisplay.h Source File

LCDDisplay.h

00001 #ifndef LCDDISPLAY_H
00002 #define LCDDISPLAY_H
00003 #include <string.h>
00004 #include "C12832.h"
00005 #include "rtos.h"
00006 #define DISPLAY_LEN 27
00007 
00008 class LCDDisplay
00009 {
00010 private:
00011         LCDDisplay(): firstLine(""), secondLine(""), thirdLine(""),
00012                       _lcd(D11, D13, D12, D7, D10) {}
00013         LCDDisplay(LCDDisplay const&);
00014         void operator=(LCDDisplay const&);
00015 public:
00016         static LCDDisplay& inst() {
00017                 static LCDDisplay _ref;
00018                 return _ref;
00019         }
00020         void setFirstLine(const char* p);
00021         const char *getFirstLine() const { return firstLine; }
00022         void setSecondLine(const char* p);
00023         const char *getSecondLine() const { return secondLine; }
00024         void setThirdLine(const char* p);
00025         const char *getThirdLine() const { return thirdLine; }
00026         void setLines(const char *p1, const char *p2=NULL, const char *p3=NULL);
00027         void clear();
00028         virtual ~LCDDisplay() {}
00029 
00030 protected:
00031         void lcdPrint(const char*, const char* = NULL, const char* = NULL);
00032         void _setLine(char *dest, const char* src, size_t n);
00033 
00034 private:
00035         char firstLine[DISPLAY_LEN];
00036         char secondLine[DISPLAY_LEN];
00037         char thirdLine[DISPLAY_LEN];
00038         C12832 _lcd;
00039         Mutex lcdLock;
00040 };
00041 
00042 #endif /* LCDDISPLAY_H */