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

ESP32-S2 specific peripheral configuration. More...

Detailed Description

ESP32-S2 specific peripheral configuration.

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

Definition in file periph_cpu_esp32s2.h.

#include "sdkconfig.h"
+ Include dependency graph for periph_cpu_esp32s2.h:

Go to the source code of this file.

#define CLOCK_CORECLOCK   (1000000UL * CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ)
 Mapping configured ESP32-S2 default clock to CLOCK_CORECLOCK define.
 
#define CPU_CYCLES_PER_LOOP   (6)
 CPU cycles per busy wait loop.
 

Predefined GPIO names

#define GPIO0   (GPIO_PIN(PORT_GPIO, 0))
 
#define GPIO1   (GPIO_PIN(PORT_GPIO, 1))
 
#define GPIO2   (GPIO_PIN(PORT_GPIO, 2))
 
#define GPIO3   (GPIO_PIN(PORT_GPIO, 3))
 
#define GPIO4   (GPIO_PIN(PORT_GPIO, 4))
 
#define GPIO5   (GPIO_PIN(PORT_GPIO, 5))
 
#define GPIO6   (GPIO_PIN(PORT_GPIO, 6))
 
#define GPIO7   (GPIO_PIN(PORT_GPIO, 7))
 
#define GPIO8   (GPIO_PIN(PORT_GPIO, 8))
 
#define GPIO9   (GPIO_PIN(PORT_GPIO, 9))
 
#define GPIO10   (GPIO_PIN(PORT_GPIO, 10))
 
#define GPIO11   (GPIO_PIN(PORT_GPIO, 11))
 
#define GPIO12   (GPIO_PIN(PORT_GPIO, 12))
 
#define GPIO13   (GPIO_PIN(PORT_GPIO, 13))
 
#define GPIO14   (GPIO_PIN(PORT_GPIO, 14))
 
#define GPIO15   (GPIO_PIN(PORT_GPIO, 15))
 
#define GPIO16   (GPIO_PIN(PORT_GPIO, 16))
 
#define GPIO17   (GPIO_PIN(PORT_GPIO, 17))
 
#define GPIO18   (GPIO_PIN(PORT_GPIO, 18))
 
#define GPIO19   (GPIO_PIN(PORT_GPIO, 19))
 
#define GPIO20   (GPIO_PIN(PORT_GPIO, 20))
 
#define GPIO21   (GPIO_PIN(PORT_GPIO, 21))
 
#define GPIO26   (GPIO_PIN(PORT_GPIO, 26))
 
#define GPIO27   (GPIO_PIN(PORT_GPIO, 27))
 
#define GPIO28   (GPIO_PIN(PORT_GPIO, 28))
 
#define GPIO29   (GPIO_PIN(PORT_GPIO, 29))
 
#define GPIO30   (GPIO_PIN(PORT_GPIO, 30))
 
#define GPIO31   (GPIO_PIN(PORT_GPIO, 31))
 
#define GPIO32   (GPIO_PIN(PORT_GPIO, 32))
 
#define GPIO33   (GPIO_PIN(PORT_GPIO, 33))
 
#define GPIO34   (GPIO_PIN(PORT_GPIO, 34))
 
#define GPIO35   (GPIO_PIN(PORT_GPIO, 35))
 
#define GPIO36   (GPIO_PIN(PORT_GPIO, 36))
 
#define GPIO37   (GPIO_PIN(PORT_GPIO, 37))
 
#define GPIO38   (GPIO_PIN(PORT_GPIO, 38))
 
#define GPIO39   (GPIO_PIN(PORT_GPIO, 39))
 
#define GPIO40   (GPIO_PIN(PORT_GPIO, 40))
 
#define GPIO41   (GPIO_PIN(PORT_GPIO, 41))
 
#define GPIO42   (GPIO_PIN(PORT_GPIO, 42))
 
#define GPIO43   (GPIO_PIN(PORT_GPIO, 43))
 
#define GPIO44   (GPIO_PIN(PORT_GPIO, 44))
 
#define GPIO45   (GPIO_PIN(PORT_GPIO, 45))
 
#define GPIO46   (GPIO_PIN(PORT_GPIO, 46))
 

USB device configuration

ESP32x SoCs have:

  • a bidirectional control endpoint EP0 IN and EP0 OUT
  • six additional endpoints EP1 .. EP6 that can be configured as IN our OUT
  • a maximum of five IN endpoints concurrently active at any time (including EP0 IN)
  • all OUT endpoints share a single RX FIFO
  • each IN endpoint has a dedicated TX FIFO

To avoid a lot of special case handling, the maximum number of IN an OUT endpoints including the control endpoint EP0 is 5.

#define DWC2_USB_OTG_FS_ENABLED   1
 Enable the USB OTG FS peripheral.
 
#define DWC2_USB_OTG_FS_NUM_EP   (5)
 Number of USB OTG FS IN endpoints including the control endpoint.
 
#define DWC2_USB_OTG_FS_RX_FIFO_SIZE   (128U)
 Size of the FIFO shared by all USB OTG FS OUT endpoints in 32-bit words.
 
#define DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE   (1024U)
 Total size of the FIFO in bytes.
 
#define USBDEV_CPU_DMA_ALIGNMENT   (4)
 Buffers have to be word aligned for DMA.
 
#define USBDEV_NUM_ENDPOINTS   DWC2_USB_OTG_FS_NUM_EP
 Number of USB IN and OUT endpoints available.
 

Macro Definition Documentation

◆ CLOCK_CORECLOCK

#define CLOCK_CORECLOCK   (1000000UL * CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ)

Mapping configured ESP32-S2 default clock to CLOCK_CORECLOCK define.

Definition at line 29 of file periph_cpu_esp32s2.h.

◆ CPU_CYCLES_PER_LOOP

#define CPU_CYCLES_PER_LOOP   (6)

CPU cycles per busy wait loop.

Definition at line 34 of file periph_cpu_esp32s2.h.

◆ DWC2_USB_OTG_FS_ENABLED

#define DWC2_USB_OTG_FS_ENABLED   1

Enable the USB OTG FS peripheral.

At the moment, only FS is supported on ESP32x SoCs.

Definition at line 243 of file periph_cpu_esp32s2.h.

◆ DWC2_USB_OTG_FS_NUM_EP

#define DWC2_USB_OTG_FS_NUM_EP   (5)

Number of USB OTG FS IN endpoints including the control endpoint.

Definition at line 248 of file periph_cpu_esp32s2.h.

◆ DWC2_USB_OTG_FS_RX_FIFO_SIZE

#define DWC2_USB_OTG_FS_RX_FIFO_SIZE   (128U)

Size of the FIFO shared by all USB OTG FS OUT endpoints in 32-bit words.

Definition at line 254 of file periph_cpu_esp32s2.h.

◆ DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE

#define DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE   (1024U)

Total size of the FIFO in bytes.

Definition at line 260 of file periph_cpu_esp32s2.h.

◆ GPIO0

#define GPIO0   (GPIO_PIN(PORT_GPIO, 0))

Definition at line 40 of file periph_cpu_esp32s2.h.

◆ GPIO1

#define GPIO1   (GPIO_PIN(PORT_GPIO, 1))

Definition at line 41 of file periph_cpu_esp32s2.h.

◆ GPIO10

#define GPIO10   (GPIO_PIN(PORT_GPIO, 10))

Definition at line 50 of file periph_cpu_esp32s2.h.

◆ GPIO11

#define GPIO11   (GPIO_PIN(PORT_GPIO, 11))

Definition at line 51 of file periph_cpu_esp32s2.h.

◆ GPIO12

#define GPIO12   (GPIO_PIN(PORT_GPIO, 12))

Definition at line 52 of file periph_cpu_esp32s2.h.

◆ GPIO13

#define GPIO13   (GPIO_PIN(PORT_GPIO, 13))

Definition at line 53 of file periph_cpu_esp32s2.h.

◆ GPIO14

#define GPIO14   (GPIO_PIN(PORT_GPIO, 14))

Definition at line 54 of file periph_cpu_esp32s2.h.

◆ GPIO15

#define GPIO15   (GPIO_PIN(PORT_GPIO, 15))

Definition at line 55 of file periph_cpu_esp32s2.h.

◆ GPIO16

#define GPIO16   (GPIO_PIN(PORT_GPIO, 16))

Definition at line 56 of file periph_cpu_esp32s2.h.

◆ GPIO17

#define GPIO17   (GPIO_PIN(PORT_GPIO, 17))

Definition at line 57 of file periph_cpu_esp32s2.h.

◆ GPIO18

#define GPIO18   (GPIO_PIN(PORT_GPIO, 18))

Definition at line 58 of file periph_cpu_esp32s2.h.

◆ GPIO19

#define GPIO19   (GPIO_PIN(PORT_GPIO, 19))

Definition at line 59 of file periph_cpu_esp32s2.h.

◆ GPIO2

#define GPIO2   (GPIO_PIN(PORT_GPIO, 2))

Definition at line 42 of file periph_cpu_esp32s2.h.

◆ GPIO20

#define GPIO20   (GPIO_PIN(PORT_GPIO, 20))

Definition at line 60 of file periph_cpu_esp32s2.h.

◆ GPIO21

#define GPIO21   (GPIO_PIN(PORT_GPIO, 21))

Definition at line 61 of file periph_cpu_esp32s2.h.

◆ GPIO26

#define GPIO26   (GPIO_PIN(PORT_GPIO, 26))

Definition at line 63 of file periph_cpu_esp32s2.h.

◆ GPIO27

#define GPIO27   (GPIO_PIN(PORT_GPIO, 27))

Definition at line 64 of file periph_cpu_esp32s2.h.

◆ GPIO28

#define GPIO28   (GPIO_PIN(PORT_GPIO, 28))

Definition at line 65 of file periph_cpu_esp32s2.h.

◆ GPIO29

#define GPIO29   (GPIO_PIN(PORT_GPIO, 29))

Definition at line 66 of file periph_cpu_esp32s2.h.

◆ GPIO3

#define GPIO3   (GPIO_PIN(PORT_GPIO, 3))

Definition at line 43 of file periph_cpu_esp32s2.h.

◆ GPIO30

#define GPIO30   (GPIO_PIN(PORT_GPIO, 30))

Definition at line 67 of file periph_cpu_esp32s2.h.

◆ GPIO31

#define GPIO31   (GPIO_PIN(PORT_GPIO, 31))

Definition at line 68 of file periph_cpu_esp32s2.h.

◆ GPIO32

#define GPIO32   (GPIO_PIN(PORT_GPIO, 32))

Definition at line 69 of file periph_cpu_esp32s2.h.

◆ GPIO33

#define GPIO33   (GPIO_PIN(PORT_GPIO, 33))

Definition at line 70 of file periph_cpu_esp32s2.h.

◆ GPIO34

#define GPIO34   (GPIO_PIN(PORT_GPIO, 34))

Definition at line 71 of file periph_cpu_esp32s2.h.

◆ GPIO35

#define GPIO35   (GPIO_PIN(PORT_GPIO, 35))

Definition at line 72 of file periph_cpu_esp32s2.h.

◆ GPIO36

#define GPIO36   (GPIO_PIN(PORT_GPIO, 36))

Definition at line 73 of file periph_cpu_esp32s2.h.

◆ GPIO37

#define GPIO37   (GPIO_PIN(PORT_GPIO, 37))

Definition at line 74 of file periph_cpu_esp32s2.h.

◆ GPIO38

#define GPIO38   (GPIO_PIN(PORT_GPIO, 38))

Definition at line 75 of file periph_cpu_esp32s2.h.

◆ GPIO39

#define GPIO39   (GPIO_PIN(PORT_GPIO, 39))

Definition at line 76 of file periph_cpu_esp32s2.h.

◆ GPIO4

#define GPIO4   (GPIO_PIN(PORT_GPIO, 4))

Definition at line 44 of file periph_cpu_esp32s2.h.

◆ GPIO40

#define GPIO40   (GPIO_PIN(PORT_GPIO, 40))

Definition at line 77 of file periph_cpu_esp32s2.h.

◆ GPIO41

#define GPIO41   (GPIO_PIN(PORT_GPIO, 41))

Definition at line 78 of file periph_cpu_esp32s2.h.

◆ GPIO42

#define GPIO42   (GPIO_PIN(PORT_GPIO, 42))

Definition at line 79 of file periph_cpu_esp32s2.h.

◆ GPIO43

#define GPIO43   (GPIO_PIN(PORT_GPIO, 43))

Definition at line 80 of file periph_cpu_esp32s2.h.

◆ GPIO44

#define GPIO44   (GPIO_PIN(PORT_GPIO, 44))

Definition at line 81 of file periph_cpu_esp32s2.h.

◆ GPIO45

#define GPIO45   (GPIO_PIN(PORT_GPIO, 45))

Definition at line 82 of file periph_cpu_esp32s2.h.

◆ GPIO46

#define GPIO46   (GPIO_PIN(PORT_GPIO, 46))

Definition at line 83 of file periph_cpu_esp32s2.h.

◆ GPIO5

#define GPIO5   (GPIO_PIN(PORT_GPIO, 5))

Definition at line 45 of file periph_cpu_esp32s2.h.

◆ GPIO6

#define GPIO6   (GPIO_PIN(PORT_GPIO, 6))

Definition at line 46 of file periph_cpu_esp32s2.h.

◆ GPIO7

#define GPIO7   (GPIO_PIN(PORT_GPIO, 7))

Definition at line 47 of file periph_cpu_esp32s2.h.

◆ GPIO8

#define GPIO8   (GPIO_PIN(PORT_GPIO, 8))

Definition at line 48 of file periph_cpu_esp32s2.h.

◆ GPIO9

#define GPIO9   (GPIO_PIN(PORT_GPIO, 9))

Definition at line 49 of file periph_cpu_esp32s2.h.

◆ USBDEV_CPU_DMA_ALIGNMENT

#define USBDEV_CPU_DMA_ALIGNMENT   (4)

Buffers have to be word aligned for DMA.

Definition at line 265 of file periph_cpu_esp32s2.h.

◆ USBDEV_NUM_ENDPOINTS

#define USBDEV_NUM_ENDPOINTS   DWC2_USB_OTG_FS_NUM_EP

Number of USB IN and OUT endpoints available.

Definition at line 270 of file periph_cpu_esp32s2.h.