23#if defined(CPU_FAM_ESP32) 
   25#elif defined(CPU_FAM_ESP32C3) 
   27#elif defined(CPU_FAM_ESP32C6) 
   29#elif defined(CPU_FAM_ESP32H2) 
   31#elif defined(CPU_FAM_ESP32S2) 
   33#elif defined(CPU_FAM_ESP32S3) 
   36#  error "ESP32x SoC family not supported" 
   40#include "periph_cpu.h" 
   76#define ADC_NUMOF   ARRAY_SIZE(adc_channels) 
  108#define DAC_NUMOF   ARRAY_SIZE(dac_channels) 
  116#if defined(I2C0_SCL) && !defined(I2C0_SCL_PULLUP) 
  118#define I2C0_SCL_PULLUP true 
  121#if defined(I2C0_SDA) && !defined(I2C0_SDA_PULLUP) 
  123#define I2C0_SDA_PULLUP true 
  126#if (SOC_I2C_NUM > 1) && defined(I2C1_SCL) && !defined(I2C1_SCL_PULLUP) 
  128#define I2C1_SCL_PULLUP true 
  131#if (SOC_I2C_NUM > 1) && defined(I2C1_SDA) && !defined(I2C1_SDA_PULLUP) 
  133#define I2C1_SDA_PULLUP true 
  140#if defined(I2C0_SCL) && defined(I2C0_SDA) && defined(I2C0_SPEED) 
  142        .module = PERIPH_I2C0_MODULE,
 
  146        .scl_pullup = I2C0_SCL_PULLUP,
 
  147        .sda_pullup = I2C0_SCL_PULLUP,
 
  150#if (SOC_I2C_NUM > 1) && defined(I2C1_SCL) && defined(I2C1_SDA) && defined(I2C1_SPEED) 
  152        .module = PERIPH_I2C1_MODULE,
 
  156        .scl_pullup = I2C1_SCL_PULLUP,
 
  157        .sda_pullup = I2C1_SCL_PULLUP,
 
 
  170#define I2C_NUMOF   ARRAY_SIZE(i2c_config) 
  197static const gpio_t pwm2_gpios[] = PWM2_GPIOS;
 
  204static const gpio_t pwm3_gpios[] = PWM3_GPIOS;
 
  214        .module = PERIPH_LEDC_MODULE,
 
  215        .group = LEDC_LOW_SPEED_MODE,
 
  216        .timer = LEDC_TIMER_0,
 
  223        .module = PERIPH_LEDC_MODULE,
 
  224#ifdef SOC_LEDC_SUPPORT_HS_MODE 
  225        .group = LEDC_HIGH_SPEED_MODE,
 
  227        .group = LEDC_LOW_SPEED_MODE,
 
  229        .timer = LEDC_TIMER_1,
 
  236        .module = PERIPH_LEDC_MODULE,
 
  237        .group = LEDC_LOW_SPEED_MODE,
 
  238        .timer = LEDC_TIMER_2,
 
  245        .module = PERIPH_LEDC_MODULE,
 
  246#ifdef SOC_LEDC_SUPPORT_HS_MODE 
  247        .group = LEDC_HIGH_SPEED_MODE,
 
  249        .group = LEDC_LOW_SPEED_MODE,
 
  251        .timer = LEDC_TIMER_3,
 
 
  265#define PWM_NUMOF   ARRAY_SIZE(pwm_config) 
  285#ifndef HAVE_RMT_CHANNEL_CONFIG 
  287#ifdef WS281X_PARAM_PIN 
 
  299#define RMT_CH_NUMOF    ARRAY_SIZE(rmt_channel_config) 
  312#if defined(SPI0_CTRL) 
  321#if defined(SPI1_CTRL) && (SOC_SPI_PERIPH_NUM > 2) 
 
  340#define SPI_NUMOF   ARRAY_SIZE(spi_config) 
  342#if IS_USED(MODULE_PERIPH_SPI) 
  343static_assert(
SPI_NUMOF != 0, 
"No SPI devices defined");
 
  360#if (SOC_UART_NUM > 1) && defined(UART1_TXD) && defined(UART1_RXD) 
  366#if (SOC_UART_NUM > 2) && defined(UART2_TXD) && defined(UART2_RXD) 
 
  382#define UART_NUMOF  ARRAY_SIZE(uart_config) 
  385#ifdef SOC_USB_OTG_SUPPORTED 
  391#include "usbdev_esp32.h" 
  398        .periph = USB_OTG_FS_PERIPH_BASE,
 
  407#define USBDEV_NUMOF    ARRAY_SIZE(dwc2_usb_otg_fshs_config) 
#define WS281X_PARAM_PIN
GPIO pin connected to the data pin of the first LED.
 
#define I2C0_SPEED
I2C bus speed of I2C_DEV(0)
 
#define SPI0_MOSI
Routed vio the GPIO matrix to FSPI MOSI signal.
 
#define UART0_RXD
direct I/O pin for UART_DEV(0) RxD, can't be changed
 
#define SPI0_CTRL
FSPI is used as SPI_DEV(0)
 
#define SPI0_CS0
Routed vio the GPIO matrix to FSPI CS0 signal.
 
#define I2C0_SCL
SCL signal of I2C_DEV(0)
 
#define PWM0_GPIOS
Declaration of the channels for device PWM_DEV(0), at maximum eight channels (PWM_CH_NUMOF_MAX).
 
#define SPI0_SCK
Routed vio the GPIO matrix to FSPI CLK signal.
 
#define SPI0_MISO
Routed vio the GPIO matrix to FSPI MISO signal.
 
#define ADC_GPIOS
Declaration of GPIOs that can be used as ADC channels.
 
#define PWM1_GPIOS
Declaration of the channels for device PWM_DEV(1), at maximum eight channels (PWM_CH_NUMOF_MAX).
 
#define UART0_TXD
direct I/O pin for UART_DEV(0) TxD, can't be changed
 
#define I2C0_SDA
SDA signal of I2C_DEV(0)
 
#define SPI1_MOSI
HSPI MOSI.
 
#define SPI1_SCK
HSPI SCK.
 
#define SPI1_MISO
HSPI MISO.
 
#define SPI1_CS0
HSPI CS0.
 
#define SPI1_CTRL
HSPI is used as SPI_DEV(1)
 
#define ARRAY_SIZE(a)
Calculate the number of elements in a static array.
 
#define DAC_GPIOS
Declaration of GPIOs that can be used as DAC channels.
 
static const gpio_t dac_channels[]
Static array with declared DAC channels.
 
static const rmt_channel_config_t rmt_channel_config[]
RMT channel configuration.
 
#define UART1_TXD
TxD pin of UART_DEV(1)
 
#define UART1_RXD
RxD pin of UART_DEV(1)
 
static const dwc2_usb_otg_fshs_config_t dwc2_usb_otg_fshs_config[]
Common USB OTG FS configuration.
 
#define SPI_NUMOF
Amount of SPI devices.
 
Common macros and compiler attributes/pragmas configuration.
 
Common declarations of ESP32 periphery for all ESP32 boards.
 
Common peripheral configurations for ESP32-C3 boards.
 
Common peripheral configurations for ESP32-C6 boards.
 
Common peripheral configurations for ESP32-H2 boards.
 
Common peripheral configurations for ESP32-S2 boards.
 
Common peripheral configurations for ESP32-S3 boards.
 
I2C configuration structure.
 
PWM configuration structure type.
 
RMT channel configuration.
 
SPI device configuration.
 
UART device configuration.
 
@ DWC2_USB_OTG_PHY_BUILTIN
on-chip FS PHY
 
@ DWC2_USB_OTG_FS
Full speed peripheral.