diff options
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 |
