Working on adding a display.

This commit is contained in:
2023-10-07 02:29:08 -07:00
parent 802a6f6f52
commit 63faf519c1
10 changed files with 244 additions and 11 deletions

34
include/Display.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef KIMODEM_DISPLAY_H
#define KIMODEM_DISPLAY_H
#include <Arduino.h>
#define ANSI_CLEAR_SCREEN "\33[2J"
/*
class Display {
public:
Display();
void Clear();
void Draw();
bool HasDisplay();
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
};
*/
#if defined(ADAFRUIT_OLED)
#include "internal/DisplayAdafruitOLED.h"
#else
#include "internal/DisplayNone.h"
#endif
static Display display;
#endif

View File

@@ -0,0 +1,26 @@
#ifndef KIMODEM_ADAFRUIT_OLED_H
#define KIMODEM_ADAFRUIT_OLED_H
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
class Display {
public:
Display();
void Clear();
void Draw();
bool HasDisplay();
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
private:
Adafruit_SSD1306 oled;
};
#endif

View File

@@ -0,0 +1,20 @@
#ifndef KIMODEM_DISPLAY_SERIAL
#define KIMODEM_DISPLAY_SERIAL
#include <Arduino.h>
class Display {
public:
Display() {};
void Clear();
void Draw();
bool HasDisplay();
void Print(const char *);
void Println(const char *);
void SetCursor(int16_t x, int16_t y);
};
#endif

View File

@@ -6,8 +6,8 @@ namespace config {
// Networking
size_t LastSSID(char *ssid);
void SetLastSSID(const char *ssid, size_t ssidlen);
size_t LastSSID(char *ssid, size_t ssidlen);
void SetLastSSID(const char *ssid);
bool StartTryConnecting();
void SetStartTryConnecting(bool opt);