Fix spi c2 c6 bus numbers and SPI Reg Base defines (#19988)

* C2 and C6 have same SPI bus as C3
* Update esp32x_fixes.h
* Release Platforms
This commit is contained in:
Jason2866 2023-11-13 13:44:47 +01:00 committed by GitHub
parent 73f219e2bb
commit 0ee62e597b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 29 deletions

View File

@ -58,38 +58,15 @@
#define FSPI_HOST SPI2_HOST #define FSPI_HOST SPI2_HOST
#define HSPI_HOST SPI3_HOST #define HSPI_HOST SPI3_HOST
#define VSPI_HOST SPI3_HOST #define VSPI_HOST SPI3_HOST
#ifndef REG_SPI_BASE // SPI_MOSI_DLEN_REG is not defined anymore in esp32s3
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
// SPI_MOSI_DLEN_REG is not defined anymore in esp32s3, instead use SPI_MS_DLEN_REG
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x) #define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
#endif // REG_SPI_BASE
#elif CONFIG_IDF_TARGET_ESP32C3 #elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#define SPI_HOST SPI1_HOST #define SPI_HOST SPI1_HOST
#define HSPI_HOST SPI2_HOST #define HSPI_HOST SPI2_HOST
#define VSPI_HOST SPI2_HOST /* No SPI3_host on C3 */ #define VSPI_HOST SPI2_HOST /* No SPI3_host on C2/C6 */
#if ESP_IDF_VERSION_MAJOR < 5
// fix a bug in esp-idf 4.4 for esp32c3
#ifndef REG_SPI_BASE
#define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
// SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
#endif // REG_SPI_BASE
#endif //ESP_IDF_VERSION_MAJOR < 5
#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6
#define SPI_HOST SPI1_HOST
#define HSPI_HOST SPI1_HOST /* No SPI2_host on C2/C6 */
#define VSPI_HOST SPI1_HOST /* No SPI3_host on C2/C6 */
#define VSPI SPI #define VSPI SPI
// #if ESP_IDF_VERSION_MAJOR < 5 // SPI_MOSI_DLEN_REG is not defined anymore
// // fix a bug in esp-idf 4.4 for esp32c3
// #ifndef REG_SPI_BASE
// #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 )))
// // SPI_MOSI_DLEN_REG is not defined anymore in esp32c3, instead use SPI_MS_DLEN_REG
#define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x) #define SPI_MOSI_DLEN_REG(x) SPI_MS_DLEN_REG(x)
// #endif // REG_SPI_BASE
// #endif //ESP_IDF_VERSION_MAJOR < 5
#endif // TARGET #endif // TARGET

View File

@ -94,13 +94,13 @@ lib_ignore =
[core32] [core32]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.06/platform-espressif32.zip platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.00/platform-espressif32.zip
platform_packages = platform_packages =
build_unflags = ${esp32_defaults.build_unflags} build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags} build_flags = ${esp32_defaults.build_flags}
[core32_30] [core32_30]
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.12/platform-espressif32.zip platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.10/platform-espressif32.zip
platform_packages = platform_packages =
build_unflags = ${core32.build_unflags} build_unflags = ${core32.build_unflags}
build_flags = ${core32.build_flags} build_flags = ${core32.build_flags}