mirror of
https://github.com/DashyFox/MusicRing.git
synced 2025-06-27 20:59:28 +00:00
abstract for external display lib
This commit is contained in:
35
modules/Display.h
Normal file
35
modules/Display.h
Normal 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
17
modules/LED_Ring.h
Normal 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) {};
|
||||
|
||||
|
||||
};
|
Reference in New Issue
Block a user