periph_conf.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2018 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
44 #include <stdint.h>
45 #include "periph_cpu.h"
46 
47 #ifdef __cplusplus
48  extern "C" {
49 #endif
50 
66 #ifndef ADC_GPIOS
67 #ifndef MODULE_ESP32_WROVER_KIT_CAMERA
68 #define ADC_GPIOS { GPIO34, GPIO35, GPIO36, GPIO39 }
69 #else
70 #define ADC_GPIOS { }
71 #endif
72 #endif
73 
79 #ifndef DAC_GPIOS
80 #define DAC_GPIOS { }
81 #endif
93 #ifndef I2C0_SPEED
94 #define I2C0_SPEED I2C_SPEED_FAST
95 #endif
96 #ifndef I2C0_SCL
97 #define I2C0_SCL GPIO27
98 #endif
99 #ifndef I2C0_SDA
100 #define I2C0_SDA GPIO26
101 #endif
115 #ifndef PWM0_GPIOS
116 #if (!MODULE_ESP32_WROVER_KIT_CAMERA && !MODULE_PERIPH_SDMMC) || DOXYGEN
117 #define PWM0_GPIOS { GPIO0, GPIO4 }
118 #elif !MODULE_ESP32_WROVER_KIT_CAMERA
119 #define PWM0_GPIOS { GPIO0 }
120 #else
121 #define PWM0_GPIOS { }
122 #endif
123 #endif
124 
136 static const sdmmc_conf_t sdmmc_config[] = {
137  {
138  .slot = SDMMC_SLOT_1,
139  .cd = GPIO21,
140  .wp = GPIO_UNDEF,
141 #if MODULE_ESP32_WROVER_KIT_CAMERA
142  /* if camera used, only DAT0 is available */
143  .bus_width = 1,
144 #else
145  .bus_width = 4,
146 #endif
147  },
148 };
149 
151 #define SDMMC_CONFIG_NUMOF 1
171 #ifndef SPI0_CTRL
172 #define SPI0_CTRL HSPI
173 #endif
174 
175 #ifndef SPI0_SCK
176 #define SPI0_SCK GPIO14
177 #endif
178 #ifndef SPI0_MOSI
179 #define SPI0_MOSI GPIO15
180 #endif
181 #ifndef SPI0_MISO
182 #define SPI0_MISO GPIO2
183 #endif
184 #ifndef SPI0_CS0
185 #define SPI0_CS0 GPIO13
186 #endif
187 
188 #if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
199 #ifndef SPI1_CTRL
200 #define SPI1_CTRL VSPI
201 #endif
202 
203 #ifndef SPI1_SCK
204 #define SPI1_SCK GPIO19
205 #endif
206 #ifndef SPI1_MOSI
207 #define SPI1_MOSI GPIO23
208 #endif
209 #ifndef SPI1_MISO
210 #define SPI1_MISO GPIO25
211 #endif
212 #ifndef SPI1_CS0
213 #define SPI1_CS0 GPIO22
214 #endif
215 #endif /* !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN */
228 #define UART0_TXD GPIO1
229 #define UART0_RXD GPIO3
232 #ifdef __cplusplus
233 } /* end extern "C" */
234 #endif
235 
236 /* include common board definitions as last step */
237 #include "periph_conf_common.h"
238 
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const sdmmc_conf_t sdmmc_config[]
SDMMC devices.
Definition: periph_conf.h:136
@ SDMMC_SLOT_1
SD/MMC host controller slot 1.
Definition: periph_cpu.h:690
SDMMC slot configuration.
Definition: periph_cpu.h:704
sdmmc_slot_t slot
SDMMC slot used [ SDMMC_SLOT_0 | SDMMC_SLOT_1].
Definition: periph_cpu.h:705