diff options
| author | kkard2 <[email protected]> | 2026-06-10 14:06:55 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2026-06-10 14:06:55 +0200 |
| commit | f961306d40654ac6a1ab7c262af7af74401dc693 (patch) | |
| tree | 6e2b0366f0ec077eadb815b35718312d1c79ea33 /src/driver.h | |
init
Diffstat (limited to 'src/driver.h')
| -rw-r--r-- | src/driver.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/driver.h b/src/driver.h new file mode 100644 index 0000000..f2e9f05 --- /dev/null +++ b/src/driver.h @@ -0,0 +1,35 @@ +#include <cstdint> + +#define DISPLAY_WIDTH 320 +#define DISPLAY_HEIGHT 240 + +void display_setup(void); +void display_on(void); +void display_off(void); +void display_begin(void); // call before drawing +void display_end(void); // flushes to screen +void display_clear(uint16_t color); +void display_set_pixel(int32_t x, int32_t y, uint16_t color); + +void button_setup(void); +bool button_get(void); // true if currently pressed + + +typedef struct { + const char *uri; + const char *method; + const char *body; // nullable +} WifiRequest; + +typedef struct { + int status; + const char *content_type; + const char *body; +} WifiResponse; + +typedef WifiResponse (*WifiHandler)(const WifiRequest *req); + +void wifi_setup(void); +void wifi_hotspot_start(const char *ssid, const char *password, WifiHandler handler); +void wifi_hotspot_stop(void); +void wifi_tick(void); // call in loop() while hotspot is active |
