intiail
This commit is contained in:
57
hmi.h
Normal file
57
hmi.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* hmi.h
|
||||
*
|
||||
* Created on: 02.03.2016
|
||||
* Author: dehottgw
|
||||
*/
|
||||
|
||||
#ifndef HMI_H_
|
||||
#define HMI_H_
|
||||
|
||||
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_TFTLCD.h>
|
||||
|
||||
|
||||
namespace HmiNS {
|
||||
const static uint8_t LCD_CS = A3;
|
||||
const static uint8_t LCD_CD = A2;
|
||||
const static uint8_t LCD_WR = A1;
|
||||
const static uint8_t LCD_RD = A0;
|
||||
const static uint8_t LCD_RESET = A4;
|
||||
|
||||
const static uint16_t BLACK = 0x0000;
|
||||
const static uint16_t BLUE = 0x001F;
|
||||
const static uint16_t RED = 0xF800;
|
||||
const static uint16_t GREEN = 0x07E0;
|
||||
const static uint16_t CYAN = 0x07FF;
|
||||
const static uint16_t MAGENTA = 0xF81F;
|
||||
const static uint16_t YELLOW = 0xFFE0;
|
||||
const static uint16_t WHITE = 0xFFFF;
|
||||
|
||||
const static uint8_t BUFFERLEN_MESSAGESLOT = 10;
|
||||
const static uint8_t NUM_OF_MESSAGESLOTS = 10;
|
||||
}
|
||||
|
||||
|
||||
struct MessageSlot {
|
||||
char header[HmiNS::BUFFERLEN_MESSAGESLOT];
|
||||
char body[HmiNS::BUFFERLEN_MESSAGESLOT];
|
||||
uint32_t timestamp;
|
||||
};
|
||||
|
||||
class Hmi {
|
||||
public:
|
||||
Hmi();
|
||||
void begin();
|
||||
void exec();
|
||||
void updateMessage()
|
||||
private:
|
||||
uint16_t m_displayIdentifier;
|
||||
Adafruit_TFTLCD m_tft;
|
||||
MessageSlot m_messageSlots[HmiNS::NUM_OF_MESSAGESLOTS];
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* HMI_H_ */
|
Reference in New Issue
Block a user