From 35ff74c9be46e16030d1184a506451e1d3805c25 Mon Sep 17 00:00:00 2001 From: gamerdonkey Date: Sat, 14 Sep 2024 14:48:59 -0500 Subject: First attempt at integrating Adafruit_GFX and converting to C++ --- main/InovaLedDisplay.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 main/InovaLedDisplay.h (limited to 'main/InovaLedDisplay.h') 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 -- cgit v1.2.3