diff options
| author | gamerdonkey | 2024-09-14 14:48:59 -0500 |
|---|---|---|
| committer | gamerdonkey | 2024-09-14 14:48:59 -0500 |
| commit | 35ff74c9be46e16030d1184a506451e1d3805c25 (patch) | |
| tree | 0ee143a6a3ddf74ee985165cb10a1c44d9b8377f /main/InovaLedDisplay.h | |
| parent | 5d3f7c6d67dd70b644c5527b07b72f03459413dd (diff) | |
| download | esp32-inova-led-controller-35ff74c9be46e16030d1184a506451e1d3805c25.tar.gz esp32-inova-led-controller-35ff74c9be46e16030d1184a506451e1d3805c25.tar.bz2 esp32-inova-led-controller-35ff74c9be46e16030d1184a506451e1d3805c25.zip | |
First attempt at integrating Adafruit_GFX and converting to C++
Diffstat (limited to 'main/InovaLedDisplay.h')
| -rw-r--r-- | main/InovaLedDisplay.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main/InovaLedDisplay.h b/main/InovaLedDisplay.h new file mode 100644 index 0000000..8897578 --- /dev/null +++ b/main/InovaLedDisplay.h @@ -0,0 +1,32 @@ +#ifndef INOVALEDDISPLAY_H +#define INOVALEDDISPLAY_H + +#include "Adafruit_GFX.h" +#include "driver/gpio.h" +#include "driver/spi_master.h" + + +#define NUM_COL 160 +#define NUM_ROW 8 + + +class InovaLedDisplay : public Adafruit_GFX { + public: + InovaLedDisplay(uint8_t r0, uint8_t g0, uint8_t clk, uint8_t cs, uint8_t latchParam, uint8_t oeParam, uint8_t addr0Param, uint8_t addr1Param, uint8_t addr2Param); + + void drawPixel(int16_t x, int16_t y, uint16_t c); + + void updateDisplay(void); + + void runDisplay(void); + + void stopDisplay(void); + + private: + uint16_t displayBuffer[NUM_ROW][NUM_COL / 8]; // each column is two bits, so 8 can fit in 16-bit integer + spi_device_handle_t spi; + bool run = true; + gpio_num_t latch, oe, addr0, addr1, addr2; +}; + +#endif |
