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 
36 #include <stdint.h>
37 
38 #include "periph_cpu.h"
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
60 #ifndef ADC_GPIOS
61 #if MODULE_OLIMEX_ESP32_GATEWAY
62 #define ADC_GPIOS { GPIO32, GPIO35, GPIO36, GPIO39 }
63 #else /* MODULE_OLIMEX_ESP32_GATEWAY */
64 #define ADC_GPIOS { }
65 #endif /* MODULE_OLIMEX_ESP32_GATEWAY */
66 #endif /* ADC_GPIOS */
67 
69 #ifndef DAC_GPIOS
70 #define DAC_GPIOS { }
71 #endif
79 #ifndef MODULE_OLIMEX_ESP32_GATEWAY
80 #define CAN_TX GPIO5
81 #define CAN_RX GPIO35
82 #endif
83 
97 #ifndef I2C0_SPEED
98 #define I2C0_SPEED I2C_SPEED_FAST
99 #endif
100 
101 #ifdef MODULE_OLIMEX_ESP32_GATEWAY
102 #ifndef I2C0_SCL
103 #define I2C0_SCL GPIO16
104 #endif
105 #ifndef I2C0_SDA
106 #define I2C0_SDA GPIO17
107 #endif
108 #else /* MODULE_OLIMEX_ESP32_GATEWAY */
109 #ifndef I2C0_SCL
110 #define I2C0_SCL GPIO16
111 #endif
112 #ifndef I2C0_SDA
113 #define I2C0_SDA GPIO13
114 #endif
115 #endif /* MODULE_OLIMEX_ESP32_GATEWAY */
116 
132 #ifndef PWM0_GPIOS
133 #if CONFIG_FLASHMODE_DOUT || CONFIG_FLASHMODE_DIO || DOXYGEN
134 #define PWM0_GPIOS { GPIO9, GPIO10 }
135 #else
136 #error Configuration problem: Flash mode qio or qout is used, \
137  GPIO9 and GPIO10 cannot be used as PWM channels as configured
138 #endif
139 #endif
140 
149 static const sdmmc_conf_t sdmmc_config[] = {
150  {
151  .slot = SDMMC_SLOT_1,
152  .cd = GPIO_UNDEF,
153  .wp = GPIO_UNDEF,
154 #if MODULE_OLIMEX_ESP32_GATEWAY
155  .bus_width = 4,
156 #else
157  .bus_width = 1,
158 #endif
159  },
160 };
161 
163 #define SDMMC_CONFIG_NUMOF 1
182 #if !MODULE_PERIPH_SDMMC && !MODULE_OLIMEX_ESP32_GATEWAY
183 
184 #ifndef SPI0_CTRL
185 #define SPI0_CTRL HSPI
186 #endif
187 
188 #ifndef SPI0_SCK
189 #define SPI0_SCK GPIO14
190 #endif
191 #ifndef SPI0_MISO
192 #define SPI0_MISO GPIO2
193 #endif
194 #ifndef SPI0_MOSI
195 #define SPI0_MOSI GPIO15
196 #endif
197 #ifndef SPI0_CS0
198 #define SPI0_CS0 GPIO17
199 #endif
200 
201 #endif /* !MODULE_PERIPH_SDMMC && !MODULE_OLIMEX_ESP32_GATEWAY */
202 
219 #define UART0_TXD GPIO1
220 #define UART0_RXD GPIO3
222 #if !MODULE_OLIMEX_ESP32_GATEWAY
223 
224 #ifndef UART1_TXD
225 #define UART1_TXD GPIO4
226 #endif
227 #ifndef UART1_RXD
228 #define UART1_RXD GPIO36
229 #endif
230 
231 #endif /* !MODULE_OLIMEX_ESP32_GATEWAY */
234 #ifdef __cplusplus
235 } /* end extern "C" */
236 #endif
237 
238 /* include common peripheral definitions as last step */
239 #include "periph_conf_common.h"
240 
#define GPIO_UNDEF
Definition of a fitting UNDEF value.
static const sdmmc_conf_t sdmmc_config[]
SDMMC devices.
Definition: periph_conf.h:149
@ 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