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