diff options
| author | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-09-29 23:20:16 +0100 |
|---|---|---|
| committer | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-09-29 23:20:16 +0100 |
| commit | dd05550cc5467f864f6ec23fe899bc8a69632052 (patch) | |
| tree | 0e432b695784ec85f7f5dfcd78125f3549d49c95 | |
| parent | 981d067063e1b42faefd876e72a5febc6cfe39d4 (diff) | |
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.
| -rw-r--r-- | ESP32-HUB75-MatrixPanel-I2S-DMA.h | 6 | ||||
| -rw-r--r-- | esp32_i2s_parallel_dma.c | 35 | ||||
| -rw-r--r-- | esp32_i2s_parallel_dma.h | 6 | ||||
| -rw-r--r-- | esp32_i2s_parallel_dma_cxxx.txt (renamed from esp32_i2s_parallel_dma_cxxx.c) | 2 | ||||
| -rw-r--r-- | esp32_i2s_parallel_mcu_def.h | 18 |
5 files changed, 25 insertions, 42 deletions
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 <vector> #include <memory> + +#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 <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> - -#include <esp_err.h> - - // Turn on and off a periphal -#include <driver/periph_ctrl.h> - -// GPIO -#include <soc/gpio_periph.h> -#include <hal/gpio_types.h> #include <driver/gpio.h> #include <driver/periph_ctrl.h> - #include <rom/gpio.h> #include <soc/gpio_sig_map.h> -// DMA Linked List Struct -#include <soc/lldesc.h> -#include <soc/io_mux_reg.h> - -// I2S -#include <soc/i2s_struct.h> -#include <soc/i2s_reg.h> - - -#ifdef ESP32_CXXX - // GDMA - #include <soc/gdma_channel.h> - #include <soc/gdma_periph.h> - #include <soc/gdma_reg.h> - #include <soc/gdma_struct.h> -#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 <esp_err.h> +#include <stdbool.h> +#include <sys/types.h> + +#include <freertos/FreeRTOS.h> #include <driver/i2s.h> +#include <esp_err.h> #include <rom/lldesc.h> // 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 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 |
