abstract for external display lib

This commit is contained in:
2023-09-24 22:26:05 +03:00
parent 9a3e34c78b
commit 34c6a104a2
4 changed files with 124 additions and 45 deletions

35
modules/Display.h Normal file
View File

@ -0,0 +1,35 @@
#pragma once
#include <Arduino.h>
class Display {
public:
enum ScreenOrientation {
Ori_0 = 0,
Ori_90 = 90,
Ori_180 = 180,
Ori_270 = 270,
Ori_HORIZONTAL = 0,
Ori_VERTICAL = 90,
Ori_HORIZONTAL_FLIP = 180,
Ori_VERTICAL_FLIP = 270,
};
protected:
struct ScreenParam {
uint16_t width, height, orientation;
} screen;
uint8_t* buffer;
public:
Display(uint16_t width, uint16_t height, uint16_t orientation) {
screen.width = width;
screen.height = height;
screen.orientation = orientation;
buffer = new uint8_t[((width * height) / 8)];
}
virtual void writePixel() {};
};

17
modules/LED_Ring.h Normal file
View File

@ -0,0 +1,17 @@
#pragma once
#include <Arduino.h>
struct LED_Ring_PINOUT {
uint8_t Data, CLK_inside, CLK_outside, RESET, OutputEnable;
};
class LED_Ring {
public:
LED_Ring_PINOUT pinOut;
uint16_t ledCount;
uint16_t updateFrec;
LED_Ring(uint16_t _ledCount, LED_Ring_PINOUT _pinOut) : ledCount(_ledCount), pinOut(_pinOut) {};
};