-
Notifications
You must be signed in to change notification settings - Fork 6
/
InnuNextion.h
49 lines (43 loc) · 1.06 KB
/
InnuNextion.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* This lib mod is based on Easy Enhanced Nextion lib https://www.seithan.com/
*/
#include "Arduino.h"
#include <SoftwareSerial.h>
#ifndef INNUNEX_H
#define INNUNEX_H
#ifdef ESP8266
extern const char *IRAM_ATTR pathToFileName(const char *path);
#endif
// in display.cpp
extern void readCustomCommand();
extern void readCustomCommand() __attribute__((weak));
class InnuNex
{
public:
InnuNex(SoftwareSerial &serial);
void begin(unsigned long baud = 9600);
void writeNum(const char*, uint32_t);
void writeStr(const char*, String txt = "cmd");
void checkNex(void);
uint32_t readNum(const char*);
String readStr(const char*);
int readByte();
void setDebug(bool val);
bool getDebug();
int currentPageId;
int lastCurrentPageId;
byte cmdGroup;
byte cmdLength;
private:
SoftwareSerial *_serial;
uint8_t _numericBuffer[4];
uint32_t _numberValue;
char _start_char;
unsigned long _tmr1;
bool _cmdFound;
uint8_t _cmd1;
uint8_t _len;
String _readString;
bool debug;
};
#endif