Loading...
Searching...
No Matches
periph_conf.h File Reference

Peripheral configurations for the Adafruit Metro ESP32-S3 board. More...

Detailed Description

Peripheral configurations for the Adafruit Metro ESP32-S3 board.

The peripheral configuration follows the Arduino UNO R3 compatible pinout of the board.

Any modifications required for specific applications can be overridden by application-specific board configuration.

For detailed information about the peripheral configuration for ESP32-S3 boards, see section Common Peripherals.

Author
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

Definition in file periph_conf.h.

#include <stdint.h>
#include "periph_conf_common.h"
+ Include dependency graph for periph_conf.h:

Go to the source code of this file.

ADC and DAC channel configuration

#define ADC_GPIOS
 Declaration of GPIOs that can be used as ADC channels.
 

I2C configuration

I2C_DEV(0) is connected to the SDA/SCL pins of the Arduino header and to the STEMMA QT connector.

The on-board MAX17048 battery monitor is connected to this bus with address 0x36.

Note
The GPIOs listed in the configuration are only initialized as I2C signals when module periph_i2c is used. Otherwise they are not allocated and can be used for other purposes.
#define I2C0_SPEED   I2C_SPEED_FAST
 I2C bus speed of I2C_DEV(0)
 
#define I2C0_SCL   GPIO48
 SCL signal of I2C_DEV(0)
 
#define I2C0_SDA   GPIO47
 SDA signal of I2C_DEV(0)
 

PWM channel configuration

Two PWM devices are configured which use the PWM capable pins of an Arduino UNO R3, i.e., D3, D5, D6, D9, D10 and D11.

Note
As long as the according PWM device is not initialized with the pwm_init, the GPIOs declared for this device can be used for other purposes.
#define PWM0_GPIOS   { GPIO3, GPIO5, GPIO6, GPIO9 }
 Declaration of the channels for device PWM_DEV(0), at maximum PWM_CHANNEL_NUM_DEV_MAX.
 
#define PWM1_GPIOS   { GPIO10, GPIO11 }
 Declaration of the channels for device PWM_DEV(1), at maximum PWM_CHANNEL_NUM_DEV_MAX.
 

SPI configuration

SPI_DEV(0) is connected to the ICSP header and the microSD card slot.

SPI_DEV(1) is connected to the Arduino pins D10 ... D13.

Note
The GPIOs listed in the configuration are first initialized as SPI signals when the corresponding SPI interface is used for the first time by either calling the spi_init_cs function or the spi_acquire function. That is, they are not allocated as SPI signals before and can be used for other purposes as long as the SPI interface is not used.
#define SPI0_CTRL   FSPI
 FSPI (SPI Controller 2) is used as SPI_DEV(0)
 
#define SPI0_SCK   GPIO39
 SCK (ICSP header, microSD card)
 
#define SPI0_MISO   GPIO21
 MISO (ICSP header, microSD card)
 
#define SPI0_MOSI   GPIO42
 MOSI (ICSP header, microSD card)
 
#define SPI0_CS0   GPIO45
 SD_CS of the microSD card.
 
#define SPI1_CTRL   SPI3_HOST
 SPI3 is used as SPI_DEV(1)
 
#define SPI1_SCK   GPIO13
 SCK (Arduino pin D13)
 
#define SPI1_MISO   GPIO12
 MISO (Arduino pin D12)
 
#define SPI1_MOSI   GPIO11
 MOSI (Arduino pin D11)
 
#define SPI1_CS0   GPIO10
 CS0 (Arduino pin D10)
 

UART configuration

ESP32-S3 provides 3 UART interfaces at maximum, two are defined by RIOT:

UART_DEV(0) uses fixed standard configuration (Debug header).
UART_DEV(1) is connected to the Arduino pins D0 (RX) and D1 (TX).

#define UART0_TXD   GPIO43
 direct I/O pin for UART_DEV(0) TxD, can't be changed
 
#define UART0_RXD   GPIO44
 direct I/O pin for UART_DEV(0) RxD, can't be changed
 
#define UART1_TXD   GPIO40
 UART_DEV(1) TxD (Arduino pin D1)
 
#define UART1_RXD   GPIO41
 UART_DEV(1) RxD (Arduino pin D0)
 

Macro Definition Documentation

◆ ADC_GPIOS

#define ADC_GPIOS
Value:
{ GPIO14, GPIO15, GPIO16, GPIO17, GPIO18, GPIO1, \
GPIO2, GPIO3, GPIO4, GPIO5, GPIO6, GPIO7, \
GPIO8, GPIO9, GPIO10, GPIO11, GPIO12, GPIO13 }

Declaration of GPIOs that can be used as ADC channels.

ADC_LINE(0) ... ADC_LINE(5) correspond to the Arduino analog pins A0 ... A5. ADC_LINE(6) ... ADC_LINE(17) correspond to the digital pins D2 ... D13.

Note
A0 ... A4 (GPIO14 ... GPIO18) and D11 ... D13 (GPIO11 ... GPIO13) are ADC2 channels. ADC2 is also used by the WiFi module, so these channels cannot be used while WiFi is active.
As long as the GPIOs listed in ADC_GPIOS are not initialized as ADC channels with the adc_init function, they can be used for other purposes.

Definition at line 53 of file periph_conf.h.

◆ I2C0_SCL

#define I2C0_SCL   GPIO48

SCL signal of I2C_DEV(0)

Definition at line 76 of file periph_conf.h.

◆ I2C0_SDA

#define I2C0_SDA   GPIO47

SDA signal of I2C_DEV(0)

Definition at line 79 of file periph_conf.h.

◆ I2C0_SPEED

#define I2C0_SPEED   I2C_SPEED_FAST

I2C bus speed of I2C_DEV(0)

Definition at line 73 of file periph_conf.h.

◆ PWM0_GPIOS

#define PWM0_GPIOS   { GPIO3, GPIO5, GPIO6, GPIO9 }

Declaration of the channels for device PWM_DEV(0), at maximum PWM_CHANNEL_NUM_DEV_MAX.

Definition at line 101 of file periph_conf.h.

◆ PWM1_GPIOS

#define PWM1_GPIOS   { GPIO10, GPIO11 }

Declaration of the channels for device PWM_DEV(1), at maximum PWM_CHANNEL_NUM_DEV_MAX.

Definition at line 109 of file periph_conf.h.

◆ SPI0_CS0

#define SPI0_CS0   GPIO45

SD_CS of the microSD card.

Definition at line 140 of file periph_conf.h.

◆ SPI0_CTRL

#define SPI0_CTRL   FSPI

FSPI (SPI Controller 2) is used as SPI_DEV(0)

Definition at line 128 of file periph_conf.h.

◆ SPI0_MISO

#define SPI0_MISO   GPIO21

MISO (ICSP header, microSD card)

Definition at line 134 of file periph_conf.h.

◆ SPI0_MOSI

#define SPI0_MOSI   GPIO42

MOSI (ICSP header, microSD card)

Definition at line 137 of file periph_conf.h.

◆ SPI0_SCK

#define SPI0_SCK   GPIO39

SCK (ICSP header, microSD card)

Definition at line 131 of file periph_conf.h.

◆ SPI1_CS0

#define SPI1_CS0   GPIO10

CS0 (Arduino pin D10)

Definition at line 156 of file periph_conf.h.

◆ SPI1_CTRL

#define SPI1_CTRL   SPI3_HOST

SPI3 is used as SPI_DEV(1)

Definition at line 144 of file periph_conf.h.

◆ SPI1_MISO

#define SPI1_MISO   GPIO12

MISO (Arduino pin D12)

Definition at line 150 of file periph_conf.h.

◆ SPI1_MOSI

#define SPI1_MOSI   GPIO11

MOSI (Arduino pin D11)

Definition at line 153 of file periph_conf.h.

◆ SPI1_SCK

#define SPI1_SCK   GPIO13

SCK (Arduino pin D13)

Definition at line 147 of file periph_conf.h.

◆ UART0_RXD

#define UART0_RXD   GPIO44

direct I/O pin for UART_DEV(0) RxD, can't be changed

Definition at line 171 of file periph_conf.h.

◆ UART0_TXD

#define UART0_TXD   GPIO43

direct I/O pin for UART_DEV(0) TxD, can't be changed

Definition at line 170 of file periph_conf.h.

◆ UART1_RXD

#define UART1_RXD   GPIO41

UART_DEV(1) RxD (Arduino pin D0)

Definition at line 177 of file periph_conf.h.

◆ UART1_TXD

#define UART1_TXD   GPIO40

UART_DEV(1) TxD (Arduino pin D1)

Definition at line 174 of file periph_conf.h.