From dd05550cc5467f864f6ec23fe899bc8a69632052 Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Wed, 29 Sep 2021 23:20:16 +0100 Subject: [PATCH] Remove ESP32C3 experimental stuff. ESP32-C3 doesn't actually support 'lcd mode' aka. parallel DMA, so it'll never be of use with this library and a HUB75 panel. --- ESP32-HUB75-MatrixPanel-I2S-DMA.h | 6 ++++ esp32_i2s_parallel_dma.c | 35 +++---------------- esp32_i2s_parallel_dma.h | 6 +++- ..._cxxx.c => esp32_i2s_parallel_dma_cxxx.txt | 2 ++ esp32_i2s_parallel_mcu_def.h | 18 +++++----- 5 files changed, 25 insertions(+), 42 deletions(-) rename esp32_i2s_parallel_dma_cxxx.c => esp32_i2s_parallel_dma_cxxx.txt (99%) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 8d1c0a9..c68a634 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -4,6 +4,12 @@ /* Core ESP32 hardware / idf includes! */ #include #include + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/semphr.h" +#include "freertos/queue.h" + #include "esp_heap_caps.h" #include "esp32_i2s_parallel_dma.h" diff --git a/esp32_i2s_parallel_dma.c b/esp32_i2s_parallel_dma.c index 6797733..ea560b1 100644 --- a/esp32_i2s_parallel_dma.c +++ b/esp32_i2s_parallel_dma.c @@ -14,40 +14,16 @@ // Header #include "esp32_i2s_parallel_dma.h" -#if defined(ESP32_ORIG) || defined (ESP32_SXXX) +#include +#include +#include +#include - -#include - - // Turn on and off a periphal -#include - -// GPIO -#include -#include #include #include - #include #include -// DMA Linked List Struct -#include -#include - -// I2S -#include -#include - - -#ifdef ESP32_CXXX - // GDMA - #include - #include - #include - #include -#endif - // For I2S state management. static i2s_parallel_state_t *i2s_state = NULL; @@ -448,6 +424,3 @@ void i2s_parallel_flip_to_buffer(i2s_port_t port, int buffer_id) { bool i2s_parallel_is_previous_buffer_free() { return previousBufferFree; } - -// End ESP32 original / S2, S3 check -#endif \ No newline at end of file diff --git a/esp32_i2s_parallel_dma.h b/esp32_i2s_parallel_dma.h index 00e6097..2b16e24 100644 --- a/esp32_i2s_parallel_dma.h +++ b/esp32_i2s_parallel_dma.h @@ -13,8 +13,12 @@ extern "C" { #endif -#include +#include +#include + +#include #include +#include #include // Get MCU Type and Max CLK Hz for MCU diff --git a/esp32_i2s_parallel_dma_cxxx.c b/esp32_i2s_parallel_dma_cxxx.txt similarity index 99% rename from esp32_i2s_parallel_dma_cxxx.c rename to esp32_i2s_parallel_dma_cxxx.txt index f8d8702..8e39820 100644 --- a/esp32_i2s_parallel_dma_cxxx.c +++ b/esp32_i2s_parallel_dma_cxxx.txt @@ -4,6 +4,8 @@ * Author: Mrfaptastic @ https://github.com/mrfaptastic/ * * Description: Multi-ESP32 product DMA setup functions for ESP32 C3/H2 RISC-V chips + * + * ESP32C series doesn't support LCD mode / parallel DMA! * */ diff --git a/esp32_i2s_parallel_mcu_def.h b/esp32_i2s_parallel_mcu_def.h index 199d8fa..4ab524e 100644 --- a/esp32_i2s_parallel_mcu_def.h +++ b/esp32_i2s_parallel_mcu_def.h @@ -10,17 +10,10 @@ #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 #define ESP32_SXXX 1 - + #define I2S_PARALLEL_CLOCK_HZ 160000000L #define DMA_MAX (4096-4) - -#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32H2 - #define ESP32_CXXX 1 - - #define I2S_PARALLEL_CLOCK_HZ 160000000L - #define DMA_MAX (4096-4) - #elif CONFIG_IDF_TARGET_ESP32 || defined(ESP32) // 2016 model that started it all, and this library. The best. @@ -29,7 +22,12 @@ #define I2S_PARALLEL_CLOCK_HZ 80000000L #define DMA_MAX (4096-4) +#elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32H2 + + #error "ESPC-series RISC-V MCU's do not support parallel DMA and not supported by this library!" + #define ESP32_CXXX 1 + #else - #error "No ESP32 or ESP32 Espressif IDF compile-time defines detected. WTH!?" - + #error "ERROR: No ESP32 or ESP32 Espressif IDF detected at compile time." + #endif \ No newline at end of file