diff options
| author | gamerdonkey | 2024-10-06 22:27:36 -0500 |
|---|---|---|
| committer | gamerdonkey | 2024-10-06 22:27:36 -0500 |
| commit | c259e7b872f51e33149ca0bad17054ff64984c9e (patch) | |
| tree | 9db3baf1f72e7ea11cb05f291dd63e274d41f9c8 /main | |
| parent | 88f84211a549325a7733b46a232de65050df8082 (diff) | |
| download | esp32-inova-led-controller-c259e7b872f51e33149ca0bad17054ff64984c9e.tar.gz esp32-inova-led-controller-c259e7b872f51e33149ca0bad17054ff64984c9e.tar.bz2 esp32-inova-led-controller-c259e7b872f51e33149ca0bad17054ff64984c9e.zip | |
Updating for ESP32s3 suppert so I can get octal SPI maybe.
Diffstat (limited to 'main')
| -rw-r--r-- | main/InovaLedDisplay.cpp | 8 | ||||
| -rw-r--r-- | main/main.cpp | 29 |
2 files changed, 24 insertions, 13 deletions
diff --git a/main/InovaLedDisplay.cpp b/main/InovaLedDisplay.cpp index 3da8f22..cc62708 100644 --- a/main/InovaLedDisplay.cpp +++ b/main/InovaLedDisplay.cpp @@ -23,8 +23,8 @@ InovaLedDisplay::InovaLedDisplay(uint8_t r0, uint8_t g0, uint8_t r1, uint8_t g1, buscfg.quadhd_io_num=g1; buscfg.data4_io_num=r2; buscfg.data5_io_num=g2; - buscfg.data6_io_num=-1; - buscfg.data7_io_num=-1; + buscfg.data6_io_num=37; + buscfg.data7_io_num=38; buscfg.sclk_io_num=clk; buscfg.max_transfer_sz=3*600*2*8; buscfg.flags=SPICOMMON_BUSFLAG_OCTAL; @@ -38,9 +38,9 @@ InovaLedDisplay::InovaLedDisplay(uint8_t r0, uint8_t g0, uint8_t r1, uint8_t g1, devcfg.flags=SPI_DEVICE_HALFDUPLEX; //Needed to use both data lines for output //Initialize the SPI bus and attach our device handle - ret=spi_bus_initialize(HSPI_HOST, &buscfg, SPI_DMA_CH_AUTO); + ret=spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO); ESP_ERROR_CHECK(ret); - ret=spi_bus_add_device(HSPI_HOST, &devcfg, &spi); + ret=spi_bus_add_device(SPI2_HOST, &devcfg, &spi); ESP_ERROR_CHECK(ret); gpio_set_direction(latch, GPIO_MODE_OUTPUT); diff --git a/main/main.cpp b/main/main.cpp index 22982fd..6c98871 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -14,13 +14,15 @@ #define ORANGE 0xFFE0 -#define PIN_NUM_R0 12 // MISO -#define PIN_NUM_G0 13 // MOSI -#define PIN_NUM_R1 2 // QUADWP -#define PIN_NUM_G1 4 // QUADHD -#define PIN_NUM_R2 22 // data4 -#define PIN_NUM_G2 21 // data5 -#define PIN_NUM_CLK 14 +#define PIN_NUM_R0 13 // MISO +#define PIN_NUM_G0 11 // MOSI +#define PIN_NUM_R1 14 // QUADWP +#define PIN_NUM_G1 9 // QUADHD +#define PIN_NUM_R2 33 // data4 +#define PIN_NUM_G2 35 // data5 +#define PIN_NUM_RD 37 // data6 +#define PIN_NUM_GD 38 // data7 +#define PIN_NUM_CLK 12 #define PIN_NUM_R_LATCH 16 #define PIN_NUM_R_CLK 17 #define PIN_NUM_R_ADDR_0 5 @@ -42,14 +44,19 @@ extern "C" void app_main(void) { display.fillScreen(0); - display.setCursor(0, 0); display.setTextColor(RED); display.setTextWrap(false); - display.print("Adafruit GFX 0123456789"); + display.setCursor(0, 0); + display.print("Line 0 0123456789"); + display.setCursor(0, 8); + display.print("Line 1 0123456789"); + display.setCursor(0, 16); + display.print("Line 2 0123456789"); TaskHandle_t taskHandle; xTaskCreate(runDisplayTask, "updateDisplay", STACK_SIZE, &display, tskIDLE_PRIORITY + 1, &taskHandle); + /* int j = display.width(); int color = 1; String hello = "Hello World!! 0123456789"; @@ -69,4 +76,8 @@ extern "C" void app_main(void) { } vTaskDelay(50 / portTICK_PERIOD_MS); } + */ + while(true) { + vTaskDelay(50 / portTICK_PERIOD_MS); + } } |
