Loading...
Searching...
No Matches
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
32
33#include <stdint.h>
34
35#include "periph_cpu.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
57#ifndef ADC_GPIOS
58#if MODULE_OLIMEX_ESP32_GATEWAY
59#define ADC_GPIOS { GPIO32, GPIO35, GPIO36, GPIO39 }
60#else /* MODULE_OLIMEX_ESP32_GATEWAY */
61#define ADC_GPIOS { }
62#endif /* MODULE_OLIMEX_ESP32_GATEWAY */
63#endif /* ADC_GPIOS */
64
66#ifndef DAC_GPIOS
67#define DAC_GPIOS { }
68#endif
70
76#ifndef MODULE_OLIMEX_ESP32_GATEWAY
77#define CAN_TX GPIO5
78#define CAN_RX GPIO35
79#endif
80
94#ifndef I2C0_SPEED
95#define I2C0_SPEED I2C_SPEED_FAST
96#endif
97
98#ifdef MODULE_OLIMEX_ESP32_GATEWAY
99#ifndef I2C0_SCL
100#define I2C0_SCL GPIO16
101#endif
102#ifndef I2C0_SDA
103#define I2C0_SDA GPIO17
104#endif
105#else /* MODULE_OLIMEX_ESP32_GATEWAY */
106#ifndef I2C0_SCL
107#define I2C0_SCL GPIO16
108#endif
109#ifndef I2C0_SDA
110#define I2C0_SDA GPIO13
111#endif
112#endif /* MODULE_OLIMEX_ESP32_GATEWAY */
113
115
129#ifndef PWM0_GPIOS
130#if CONFIG_FLASHMODE_DOUT || CONFIG_FLASHMODE_DIO || DOXYGEN
131#define PWM0_GPIOS { GPIO9, GPIO10 }
132#else
133#error Configuration problem: Flash mode qio or qout is used, \
134 GPIO9 and GPIO10 cannot be used as PWM channels as configured
135#endif
136#endif
137
139
144
146static const sdmmc_conf_t sdmmc_config[] = {
147 {
148 .slot = SDMMC_SLOT_1,
149 .cd = GPIO_UNDEF,
150 .wp = GPIO_UNDEF,
151#if MODULE_OLIMEX_ESP32_GATEWAY
152 .bus_width = 4,
153#else
154 .bus_width = 1,
155#endif
156 },
157};
158
160#define SDMMC_CONFIG_NUMOF 1
162
179#if !MODULE_PERIPH_SDMMC && !MODULE_OLIMEX_ESP32_GATEWAY
180
181#ifndef SPI0_CTRL
182#define SPI0_CTRL HSPI
183#endif
184
185#ifndef SPI0_SCK
186#define SPI0_SCK GPIO14
187#endif
188#ifndef SPI0_MISO
189#define SPI0_MISO GPIO2
190#endif
191#ifndef SPI0_MOSI
192#define SPI0_MOSI GPIO15
193#endif
194#ifndef SPI0_CS0
195#define SPI0_CS0 GPIO17
196#endif
197
198#endif /* !MODULE_PERIPH_SDMMC && !MODULE_OLIMEX_ESP32_GATEWAY */
199
201
216#define UART0_TXD GPIO1
217#define UART0_RXD GPIO3
218
219#if !MODULE_OLIMEX_ESP32_GATEWAY
220
221#ifndef UART1_TXD
222#define UART1_TXD GPIO4
223#endif
224#ifndef UART1_RXD
225#define UART1_RXD GPIO36
226#endif
227
228#endif /* !MODULE_OLIMEX_ESP32_GATEWAY */
230
231#ifdef __cplusplus
232} /* end extern "C" */
233#endif
234
235/* include common peripheral definitions as last step */
236#include "periph_conf_common.h"
237
#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:687
SDMMC slot configuration.
Definition periph_cpu.h:701