Working on adding a display.
This commit is contained in:
34
include/Display.h
Normal file
34
include/Display.h
Normal 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
|
||||
26
include/internal/DisplayAdafruitOLED.h
Normal file
26
include/internal/DisplayAdafruitOLED.h
Normal 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
|
||||
20
include/internal/DisplayNone.h
Normal file
20
include/internal/DisplayNone.h
Normal 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
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user