mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 07:21:18 +01:00
boards/esp32c3-devkit: solve conflicts in PWM configuration
The channel of PWM_DEV(0) that conflicts with the I2C SCA signal is replaced by another channel. PWM_DEV(1) is defined in addition if `periph_spi` is not used.
This commit is contained in:
parent
e0a66280b4
commit
e5f3fd22ce
@ -70,7 +70,8 @@ configuration is the most flexible one which provides:
|
||||
- 6 x ADC channels at maximum
|
||||
- 1 x SPI
|
||||
- 1 x I2C
|
||||
- 2 x UART
|
||||
- 1 x UART
|
||||
- 2 x PWM with 2 channels each
|
||||
- 1 RGB-LED
|
||||
|
||||
Since all GPIOs have broken out, GPIOs can be used for different purposes
|
||||
@ -102,22 +103,25 @@ overridden by \ref esp32_application_specific_configurations
|
||||
<center>
|
||||
Function | GPIOs | Remarks |Configuration
|
||||
:---------------|:-------|:--------|:----------------------------------
|
||||
BUTTON0 | GPIO9 | | |
|
||||
ADC | GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 | | see \ref esp32_adc_channels "ADC Channels"
|
||||
PWM_DEV(0) | GPIO3, GPIO4 | - | \ref esp32_pwm_channels "PWM Channels"
|
||||
I2C_DEV(0):SCL | GPIO4 | | \ref esp32_i2c_interfaces "I2C Interfaces"
|
||||
I2C_DEV(0):SDA | GPIO5 | | \ref esp32_i2c_interfaces "I2C Interfaces"
|
||||
RGB-LED | GPIO8 | supported by driver module `ws281x` | |
|
||||
SPI_DEV(0):CLK | GPIO6 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):MISO | GPIO2 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):MOSI | GPIO7 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):CS0 | GPIO10 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
UART_DEV(0):TxD | GPIO21 | Console (configuration is fixed) | \ref esp32_uart_interfaces "UART interfaces"
|
||||
BUTTON0 | GPIO9 | | |
|
||||
ADC | GPIO0, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 | | \ref esp32_adc_channels "ADC Channels"
|
||||
PWM_DEV(0) | GPIO3, GPIO4 | | \ref esp32_pwm_channels "PWM Channels"
|
||||
PWM_DEV(1) | GPIO10, GPIO7 | conflicts with SPI_DEV(0) | \ref esp32_pwm_channels "PWM Channels"
|
||||
I2C_DEV(0):SCL | GPIO4 | | \ref esp32_i2c_interfaces "I2C Interfaces"
|
||||
I2C_DEV(0):SDA | GPIO5 | | \ref esp32_i2c_interfaces "I2C Interfaces"
|
||||
RGB-LED | GPIO8 | supported by driver module `ws281x` | |
|
||||
SPI_DEV(0):CLK | GPIO6 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):MISO | GPIO2 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):MOSI | GPIO7 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
SPI_DEV(0):CS0 | GPIO10 | SPI2_HOST (FSPI) is used | \ref esp32_spi_interfaces "SPI Interfaces"
|
||||
UART_DEV(0):TxD | GPIO21 | Console (configuration is fixed) | \ref esp32_uart_interfaces "UART interfaces"
|
||||
UART_DEV(0):RxD | GPIO20 | Console (configuration is fixed) | \ref esp32_uart_interfaces "UART interfaces"
|
||||
</center>
|
||||
\n
|
||||
@note The configuration of ADC channels contains all ESP32-C3 GPIOs that could
|
||||
be used as ADC channels.
|
||||
@note
|
||||
- The configuration of ADC channels contains all ESP32-C3 GPIOs that could
|
||||
be used as ADC channels.
|
||||
- PWM_DEV(1) is only available if SPI_DEV(0) is not used.
|
||||
|
||||
For detailed information about the peripheral configurations of ESP32-C3
|
||||
boards, see section \ref esp32_peripherals "Common Peripherals".
|
||||
@ -129,8 +133,8 @@ boards, see section \ref esp32_peripherals "Common Peripherals".
|
||||
The following figures show the pinouts as configured by default board
|
||||
definition.
|
||||
|
||||
@image html https://gitlab.com/gschorcht/RIOT.wiki-Images/-/raw/master/esp32/ESP32-C3-DevKitM-1_pinout.png "EPS32-C3-DevKitM-1x Pinout"
|
||||
@image html https://gitlab.com/gschorcht/RIOT.wiki-Images/-/raw/master/esp32/ESP32-C3-DevKitC-02_pinout.png "EPS32-C3-DevKitC-02x Pinout"
|
||||
@image html https://gitlab.com/gschorcht/RIOT.wiki-Images/-/raw/master/esp32/ESP32-C3-DevKitM-1_pinout_v2.png "EPS32-C3-DevKitM-1x Pinout"
|
||||
@image html https://gitlab.com/gschorcht/RIOT.wiki-Images/-/raw/master/esp32/ESP32-C3-DevKitC-02_pinout_v2.png "EPS32-C3-DevKitC-02x Pinout"
|
||||
|
||||
The corresponding board schematics can be found:
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ extern "C" {
|
||||
* @name PWM channel configuration
|
||||
*
|
||||
* For generic boards, two PWM devices are configured. These devices
|
||||
* contain all GPIOs that are not defined as I2C, SPI or UART for this board.
|
||||
* contain all GPIOs that are not defined as I2C or UART for this board.
|
||||
* Generally, all outputs pins could be used as PWM channels.
|
||||
*
|
||||
* @note As long as the according PWM device is not initialized with
|
||||
@ -103,7 +103,17 @@ extern "C" {
|
||||
* at maximum PWM_CHANNEL_NUM_DEV_MAX.
|
||||
*/
|
||||
#ifndef PWM0_GPIOS
|
||||
#define PWM0_GPIOS { GPIO3, GPIO4 }
|
||||
# define PWM0_GPIOS { GPIO3, GPIO1 }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Declaration of the channels for device PWM_DEV(1),
|
||||
* at maximum PWM_CHANNEL_NUM_DEV_MAX.
|
||||
*
|
||||
* PWM_DEV(1) is only used if SPI peripheral is not enabled.
|
||||
*/
|
||||
#if !defined(PWM1_GPIOS) && !defined(MODULE_PERIPH_SPI)
|
||||
# define PWM1_GPIOS { GPIO10, GPIO7 }
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user