rename folders
This commit is contained in:
parent
1ec8effe90
commit
1815597374
63 changed files with 1 additions and 0 deletions
47
ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaDisplay.hpp
Normal file
47
ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaDisplay.hpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
#pragma once
|
||||
#include <Arduino.h>
|
||||
|
||||
#define DISPLAY_FETCH_TIMEOUT 100 // ms
|
||||
|
||||
class ESPMegaDisplay
|
||||
{
|
||||
public:
|
||||
ESPMegaDisplay(HardwareSerial *displayAdapter);
|
||||
void begin();
|
||||
void loop();
|
||||
void reset();
|
||||
void setBrightness(int value);
|
||||
void setVolume(int value);
|
||||
void jumpToPage(int page);
|
||||
void setString(const char* component, const char* value);
|
||||
void setNumber(const char* component, int value);
|
||||
const char* getString(const char* component);
|
||||
bool getStringToBuffer(const char* component, char* buffer, uint8_t buffer_size);
|
||||
uint32_t getNumber(const char* component);
|
||||
void handlePwmStateChange(uint8_t pin, uint16_t value);
|
||||
void handleInputStateChange(uint8_t pin, bool state);
|
||||
void registerPushCallback(std::function<void(uint8_t, uint8_t)> callback);
|
||||
void registerPopCallback(std::function<void(uint8_t, uint8_t)> callback);
|
||||
void registerPageChangeCallback(std::function<void(uint8_t)> callback);
|
||||
void unregisterPushCallback();
|
||||
void unregisterPopCallback();
|
||||
void unregisterPageChangeCallback();
|
||||
protected:
|
||||
uint8_t currentPage;
|
||||
uint8_t rx_buffer_index;
|
||||
char rx_buffer[256];
|
||||
char tx_buffer[256];
|
||||
bool recieveSerialCommand();
|
||||
bool recieveSerialCommand(bool process);
|
||||
void processSerialCommand();
|
||||
void processTouchPayload();
|
||||
void processPageReportPayload();
|
||||
void sendStopBytes();
|
||||
void sendCommand(char* command);
|
||||
bool payloadIsValid();
|
||||
bool waitForValidPayload(uint32_t timeout);
|
||||
HardwareSerial *displayAdapter;
|
||||
std::function<void(uint8_t, uint8_t)> pushCallback;
|
||||
std::function<void(uint8_t, uint8_t)> popCallback;
|
||||
std::function<void(uint8_t)> pageChangeCallback;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue