periph_conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
45 #ifndef PERIPH_CONF_H
46 #define PERIPH_CONF_H
47 
48 #include <stdint.h>
49 #include "periph_cpu.h"
50 
51 #ifdef __cplusplus
52  extern "C" {
53 #endif
54 
70 #ifndef ADC_GPIOS
71 #ifndef MODULE_ESP32_WROVER_KIT_CAMERA
72 #define ADC_GPIOS { GPIO34, GPIO35, GPIO36, GPIO39 }
73 #else
74 #define ADC_GPIOS { }
75 #endif
76 #endif
77 
83 #ifndef DAC_GPIOS
84 #define DAC_GPIOS { }
85 #endif
97 #ifndef I2C0_SPEED
98 #define I2C0_SPEED I2C_SPEED_FAST
99 #endif
100 #ifndef I2C0_SCL
101 #define I2C0_SCL GPIO27
102 #endif
103 #ifndef I2C0_SDA
104 #define I2C0_SDA GPIO26
105 #endif
119 #ifndef PWM0_GPIOS
120 #if (!MODULE_ESP32_WROVER_KIT_CAMERA && !MODULE_PERIPH_SDMMC) || DOXYGEN
121 #define PWM0_GPIOS { GPIO0, GPIO4 }
122 #elif !MODULE_ESP32_WROVER_KIT_CAMERA
123 #define PWM0_GPIOS { GPIO0 }
124 #else
125 #define PWM0_GPIOS { }
126 #endif
127 #endif
128 
140 static const sdmmc_conf_t sdmmc_config[] = {
141  {
142  .slot = SDMMC_SLOT_1,
143  .cd = GPIO21,
144  .wp = GPIO_UNDEF,
145 #if MODULE_ESP32_WROVER_KIT_CAMERA
146  /* if camera used, only DAT0 is available */
147  .bus_width = 1,
148 #else
149  .bus_width = 4,
150 #endif
151  },
152 };
153 
155 #define SDMMC_CONFIG_NUMOF 1
175 #ifndef SPI0_CTRL
176 #define SPI0_CTRL HSPI
177 #endif
178 
179 #ifndef SPI0_SCK
180 #define SPI0_SCK GPIO14
181 #endif
182 #ifndef SPI0_MOSI
183 #define SPI0_MOSI GPIO15
184 #endif
185 #ifndef SPI0_MISO
186 #define SPI0_MISO GPIO2
187 #endif
188 #ifndef SPI0_CS0
189 #define SPI0_CS0 GPIO13
190 #endif
191 
192 #if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
203 #ifndef SPI1_CTRL
204 #define SPI1_CTRL VSPI
205 #endif
206 
207 #ifndef SPI1_SCK
208 #define SPI1_SCK GPIO19
209 #endif
210 #ifndef SPI1_MOSI
211 #define SPI1_MOSI GPIO23
212 #endif
213 #ifndef SPI1_MISO
214 #define SPI1_MISO GPIO25
215 #endif
216 #ifndef SPI1_CS0
217 #define SPI1_CS0 GPIO22
218 #endif
219 #endif /* !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN */
232 #define UART0_TXD GPIO1
233 #define UART0_RXD GPIO3
236 #ifdef __cplusplus
237 } /* end extern "C" */
238 #endif
239 
240 /* include common board definitions as last step */
241 #include "periph_conf_common.h"
242 
243 #endif /* PERIPH_CONF_H */
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const sdmmc_conf_t sdmmc_config[]
SDMMC devices.
Definition: periph_conf.h:140
@ 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