Initial commit.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* LCD.h
|
||||
*
|
||||
* Created on: 15.06.2014
|
||||
* Author: matzman
|
||||
*/
|
||||
|
||||
#ifndef LCD_H_
|
||||
#define LCD_H_
|
||||
|
||||
#include "TfCPPsimple.h"
|
||||
#include "lcdpages/MainPage.h"
|
||||
#include <mutex>
|
||||
|
||||
|
||||
using namespace tfcppsimple;
|
||||
|
||||
namespace growcontrol {
|
||||
|
||||
struct GCSensorsInfo;
|
||||
|
||||
class LCD : public TfLCD20x4Listener, public TfDeviceStateListener {
|
||||
private:
|
||||
static log4cpp::Category& logger;
|
||||
|
||||
TfLCD20x4Bricklet* lcdBricklet = nullptr;
|
||||
|
||||
std::mutex lcdMutex;
|
||||
char lcdBuffer[4][21];
|
||||
bool lineFlags[4] = {false, false, false, false};
|
||||
int lcdLightCountdown = 0;
|
||||
int lcdLightMaxCountdown = 10;
|
||||
bool lcdLightCountdownFlag = false;
|
||||
LCDPage* activePage = nullptr;
|
||||
|
||||
MainPage pageRoot;
|
||||
|
||||
public:
|
||||
LCD();
|
||||
virtual ~LCD();
|
||||
|
||||
void setTfObject(TfLCD20x4Bricklet& lcd);
|
||||
|
||||
void buttonStateCallback(TfLCD20x4Bricklet& lcd, uint8_t button, bool state);
|
||||
void stateChangeCallback(TfDevice& device, TfDeviceState oldstate, TfDeviceState newstate);
|
||||
|
||||
void writeLine(int line, std::string txt);
|
||||
int writeLCDBuffer();
|
||||
void clearDisplay();
|
||||
|
||||
void setActivePage(LCDPage& page, bool reset = false);
|
||||
void startLightCountdown();
|
||||
void stopLightCountdown();
|
||||
void resetLightCountdown();
|
||||
void setLight(bool light);
|
||||
|
||||
void controlMainLoopCallback(GCSensorsInfo& sensors);
|
||||
|
||||
bool isLCDConnected();
|
||||
|
||||
};
|
||||
|
||||
} /* namespace growcontrol */
|
||||
|
||||
#endif /* LCD_H_ */
|
||||
Reference in New Issue
Block a user