From 88f84211a549325a7733b46a232de65050df8082 Mon Sep 17 00:00:00 2001 From: gamerdonkey Date: Fri, 20 Sep 2024 22:41:23 -0500 Subject: Changing to use octal SPI transmit so that we can display all the segments. Also refactored to clean up some code. --- main/InovaLedDisplay.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main/InovaLedDisplay.h') diff --git a/main/InovaLedDisplay.h b/main/InovaLedDisplay.h index a1d9ad9..8b522ab 100644 --- a/main/InovaLedDisplay.h +++ b/main/InovaLedDisplay.h @@ -7,12 +7,14 @@ #define NUM_COL 160 -#define NUM_ROW 8 +#define NUM_ROW 24 +#define NUM_SEGMENTS 3 +#define ROWS_PER_SEGMENT NUM_ROW / NUM_SEGMENTS class InovaLedDisplay : public virtual 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); + InovaLedDisplay(uint8_t r0, uint8_t g0, uint8_t r1, uint8_t g1, uint8_t r2, uint8_t g2, uint8_t clk, 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); @@ -23,7 +25,7 @@ class InovaLedDisplay : public virtual Adafruit_GFX { void stopDisplay(void); private: - uint16_t displayBuffer[2][NUM_ROW][NUM_COL / 8]; // each column is two bits, so 8 can fit in 16-bit integer + uint8_t displayBuffer[2][ROWS_PER_SEGMENT][NUM_COL]; // 3 segments of the matrix packed into bytes spi_device_handle_t spi; bool run = true; bool shouldSwapBuffer = false; -- cgit v1.2.3