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 
9 #pragma once
10 
47 #include <stdint.h>
48 #include "periph_cpu.h"
49 
50 #ifdef __cplusplus
51  extern "C" {
52 #endif
53 
69 #ifndef ADC_GPIOS
70 #ifndef MODULE_ESP32_WROVER_KIT_CAMERA
71 #define ADC_GPIOS { GPIO34, GPIO35, GPIO36, GPIO39 }
72 #else
73 #define ADC_GPIOS { }
74 #endif
75 #endif
76 
82 #ifndef DAC_GPIOS
83 #define DAC_GPIOS { }
84 #endif
96 #ifndef I2C0_SPEED
97 #define I2C0_SPEED I2C_SPEED_FAST
98 #endif
99 #ifndef I2C0_SCL
100 #define I2C0_SCL GPIO27
101 #endif
102 #ifndef I2C0_SDA
103 #define I2C0_SDA GPIO26
104 #endif
118 #ifndef PWM0_GPIOS
119 #if (!MODULE_ESP32_WROVER_KIT_CAMERA && !MODULE_PERIPH_SDMMC) || DOXYGEN
120 #define PWM0_GPIOS { GPIO0, GPIO4 }
121 #elif !MODULE_ESP32_WROVER_KIT_CAMERA
122 #define PWM0_GPIOS { GPIO0 }
123 #else
124 #define PWM0_GPIOS { }
125 #endif
126 #endif
127 
139 static const sdmmc_conf_t sdmmc_config[] = {
140  {
141  .slot = SDMMC_SLOT_1,
142  .cd = GPIO21,
143  .wp = GPIO_UNDEF,
144 #if MODULE_ESP32_WROVER_KIT_CAMERA
145  /* if camera used, only DAT0 is available */
146  .bus_width = 1,
147 #else
148  .bus_width = 4,
149 #endif
150  },
151 };
152 
154 #define SDMMC_CONFIG_NUMOF 1
174 #ifndef SPI0_CTRL
175 #define SPI0_CTRL HSPI
176 #endif
177 
178 #ifndef SPI0_SCK
179 #define SPI0_SCK GPIO14
180 #endif
181 #ifndef SPI0_MOSI
182 #define SPI0_MOSI GPIO15
183 #endif
184 #ifndef SPI0_MISO
185 #define SPI0_MISO GPIO2
186 #endif
187 #ifndef SPI0_CS0
188 #define SPI0_CS0 GPIO13
189 #endif
190 
191 #if !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN
202 #ifndef SPI1_CTRL
203 #define SPI1_CTRL VSPI
204 #endif
205 
206 #ifndef SPI1_SCK
207 #define SPI1_SCK GPIO19
208 #endif
209 #ifndef SPI1_MOSI
210 #define SPI1_MOSI GPIO23
211 #endif
212 #ifndef SPI1_MISO
213 #define SPI1_MISO GPIO25
214 #endif
215 #ifndef SPI1_CS0
216 #define SPI1_CS0 GPIO22
217 #endif
218 #endif /* !MODULE_ESP32_WROVER_KIT_CAMERA || DOXYGEN */
231 #define UART0_TXD GPIO1
232 #define UART0_RXD GPIO3
235 #ifdef __cplusplus
236 } /* end extern "C" */
237 #endif
238 
239 /* include common board definitions as last step */
240 #include "periph_conf_common.h"
241 
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const sdmmc_conf_t sdmmc_config[]
SDMMC devices.
Definition: periph_conf.h:139
@ SDMMC_SLOT_1
SD/MMC host controller slot 1.
Definition: periph_cpu.h:686
SDMMC slot configuration.
Definition: periph_cpu.h:700
sdmmc_slot_t slot
SDMMC slot used [ SDMMC_SLOT_0 | SDMMC_SLOT_1].
Definition: periph_cpu.h:701