mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
espressif: Fix default pins for SPI bus 2 on ESP32-[C3|C6|H2]
Fix the correct pin number for the SPI 2 bus on ESP32-C3, ESP32-C6 and ESP32-H2.
This commit is contained in:
committed by
Xiang Xiao
parent
61dff51a33
commit
69a8e2697f
@@ -214,7 +214,7 @@ spi
|
||||
--------
|
||||
|
||||
This configuration enables the support for the SPI driver.
|
||||
You can test it by connecting MOSI and MISO pins which are GPIO7 and GPIO2
|
||||
You can test it by connecting MOSI and MISO pins which are GPIO5 and GPIO0
|
||||
by default to each other and running the ``spi`` example::
|
||||
|
||||
nsh> spi exch -b 2 "AB"
|
||||
|
||||
@@ -947,22 +947,27 @@ config ESPRESSIF_SPI2_SLAVE_BUFSIZE
|
||||
|
||||
config ESPRESSIF_SPI2_CSPIN
|
||||
int "SPI2 CS Pin"
|
||||
default 10
|
||||
default 10 if ARCH_CHIP_ESP32C3_GENERIC
|
||||
default 16 if ARCH_CHIP_ESP32C6
|
||||
default 1 if ARCH_CHIP_ESP32H2
|
||||
range 0 21
|
||||
|
||||
config ESPRESSIF_SPI2_CLKPIN
|
||||
int "SPI2 CLK Pin"
|
||||
default 6
|
||||
default 6 if !ARCH_CHIP_ESP32H2
|
||||
default 4 if ARCH_CHIP_ESP32H2
|
||||
range 0 21
|
||||
|
||||
config ESPRESSIF_SPI2_MOSIPIN
|
||||
int "SPI2 MOSI Pin"
|
||||
default 7
|
||||
default 7 if !ARCH_CHIP_ESP32H2
|
||||
default 5 if ARCH_CHIP_ESP32H2
|
||||
range 0 21
|
||||
|
||||
config ESPRESSIF_SPI2_MISOPIN
|
||||
int "SPI2 MISO Pin"
|
||||
default 2
|
||||
default 2 if !ARCH_CHIP_ESP32H2
|
||||
default 0 if ARCH_CHIP_ESP32H2
|
||||
range 0 21
|
||||
|
||||
endif # ESPRESSIF_SPI2
|
||||
|
||||
@@ -78,10 +78,22 @@
|
||||
# define ESP_IRQ_SPI2 ESP_IRQ_GSPI2
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_CHIP_ESP32C3_GENERIC)
|
||||
#define SPI2_IOMUX_MISOPIN 2
|
||||
#define SPI2_IOMUX_MOSIPIN 7
|
||||
#define SPI2_IOMUX_CLKPIN 6
|
||||
#define SPI2_IOMUX_CSPIN 10
|
||||
#elif defined(CONFIG_ARCH_CHIP_ESP32C6)
|
||||
#define SPI2_IOMUX_MISOPIN 2
|
||||
#define SPI2_IOMUX_MOSIPIN 7
|
||||
#define SPI2_IOMUX_CLKPIN 6
|
||||
#define SPI2_IOMUX_CSPIN 16
|
||||
#elif defined(CONFIG_ARCH_CHIP_ESP32H2)
|
||||
#define SPI2_IOMUX_MISOPIN 0
|
||||
#define SPI2_IOMUX_MOSIPIN 5
|
||||
#define SPI2_IOMUX_CLKPIN 4
|
||||
#define SPI2_IOMUX_CSPIN 1
|
||||
#endif
|
||||
|
||||
/* Check if Chip-Select pin will be controlled via software */
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ CONFIG_BUILTIN=y
|
||||
CONFIG_DEV_ZERO=y
|
||||
CONFIG_ESPRESSIF_ESP32C6=y
|
||||
CONFIG_ESPRESSIF_SPI2=y
|
||||
CONFIG_ESPRESSIF_SPI2_CSPIN=15
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=2048
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
|
||||
@@ -23,6 +23,7 @@ CONFIG_BUILTIN=y
|
||||
CONFIG_DEV_ZERO=y
|
||||
CONFIG_ESPRESSIF_ESP32C6=y
|
||||
CONFIG_ESPRESSIF_SPI2=y
|
||||
CONFIG_ESPRESSIF_SPI2_CSPIN=15
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=2048
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
|
||||
Reference in New Issue
Block a user