2021-08-23 15:48:40 +02:00
|
|
|
#ifndef GUI_h
|
|
|
|
#define GUI_h
|
|
|
|
|
2021-09-15 18:11:32 +02:00
|
|
|
#include "BleFingerprint.h"
|
2021-08-23 15:48:40 +02:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
#ifdef M5STICK
|
|
|
|
#ifdef PLUS
|
|
|
|
#include <M5StickCPlus.h>
|
|
|
|
#else
|
|
|
|
#include <M5StickC.h>
|
|
|
|
#endif
|
2021-09-17 00:18:15 +02:00
|
|
|
#elif defined M5ATOM
|
|
|
|
#include <M5Atom.h>
|
2021-08-23 15:48:40 +02:00
|
|
|
#endif
|
|
|
|
|
2021-09-16 02:02:45 +02:00
|
|
|
#if defined M5STICK
|
2021-09-14 03:22:00 +02:00
|
|
|
|
|
|
|
#define LED_BUILTIN 10
|
|
|
|
#define LED_BUILTIN_ON 0
|
|
|
|
|
|
|
|
#define BUTTON 39
|
|
|
|
#define BUTTON_PRESSED 0
|
|
|
|
|
2021-09-16 02:02:45 +02:00
|
|
|
#elif defined M5ATOM
|
2021-09-14 03:22:00 +02:00
|
|
|
|
|
|
|
#define BUTTON 39
|
|
|
|
#define BUTTON_PRESSED 0
|
|
|
|
|
2021-09-16 02:02:45 +02:00
|
|
|
#elif defined HUZZAH32
|
2021-09-14 03:22:00 +02:00
|
|
|
|
|
|
|
#define LED_BUILTIN 13
|
|
|
|
#define LED_BUILTIN_ON 1
|
|
|
|
|
2021-09-16 02:02:45 +02:00
|
|
|
#else //DevKit / generic
|
2021-09-14 03:22:00 +02:00
|
|
|
|
2021-09-16 02:02:45 +02:00
|
|
|
#define LED_BUILTIN 2
|
|
|
|
#define LED_BUILTIN_ON 1
|
2021-09-14 03:22:00 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2021-08-23 15:48:40 +02:00
|
|
|
class GUI
|
|
|
|
{
|
|
|
|
public:
|
2021-09-15 18:11:32 +02:00
|
|
|
void added(BleFingerprint *f);
|
|
|
|
void removed(BleFingerprint *f);
|
|
|
|
void close(BleFingerprint *f);
|
|
|
|
void left(BleFingerprint *f);
|
|
|
|
|
2021-09-17 00:18:15 +02:00
|
|
|
void erasing();
|
|
|
|
void erased();
|
|
|
|
|
2021-09-14 03:22:00 +02:00
|
|
|
void seenStart();
|
|
|
|
void seenEnd();
|
2021-09-15 18:11:32 +02:00
|
|
|
|
2021-09-17 00:18:15 +02:00
|
|
|
void updateProgress(unsigned int percent);
|
|
|
|
void updateEnd();
|
|
|
|
|
|
|
|
void connecting();
|
2021-08-23 15:48:40 +02:00
|
|
|
void connected(bool wifi, bool mqtt);
|
2021-09-17 00:18:15 +02:00
|
|
|
|
|
|
|
void status(const char *message, ...);
|
2021-08-23 15:48:40 +02:00
|
|
|
void update();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool init;
|
|
|
|
#ifdef M5STICK
|
2021-09-17 00:18:15 +02:00
|
|
|
bool dirty;
|
2021-08-23 15:48:40 +02:00
|
|
|
TFT_eSprite sprite = TFT_eSprite(&M5.Lcd);
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
extern GUI Display;
|
2021-09-14 03:22:00 +02:00
|
|
|
|
|
|
|
#endif
|