arduino_iomap.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 
18 #include "periph/gpio.h"
19 #include "periph/adc.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define ARDUINO_UART_D0D1 UART_DEV(0)
26 #define ARDUINO_SPI_D11D12D13 SPI_DEV(0)
28 #if MODULE_OLIMEX_ESP32_GATEWAY
29 # define ARDUINO_LED (3)
30 #endif
31 
36 #define ARDUINO_PIN_0 GPIO3
37 #define ARDUINO_PIN_1 GPIO1
39 #define ARDUINO_PIN_2 GPIO34
40 #define ARDUINO_PIN_3 GPIO33
41 #define ARDUINO_PIN_4 GPIO4
42 #define ARDUINO_PIN_5 GPIO9
43 #define ARDUINO_PIN_6 GPIO10
45 /* Arduino pins 7 ... 9 are not available */
46 
47 #define ARDUINO_PIN_10 GPIO17
48 #define ARDUINO_PIN_11 GPIO15
49 #define ARDUINO_PIN_12 GPIO2
50 #define ARDUINO_PIN_13 GPIO14
52 /* analog pins as digital pin */
53 #define ARDUINO_PIN_14 GPIO32
54 #define ARDUINO_PIN_15 GPIO35
55 #define ARDUINO_PIN_16 GPIO36
56 #define ARDUINO_PIN_17 GPIO39
58 /* Arduino I2C pins */
59 #if MODULE_OLIMEX_ESP32_GATEWAY
60 # define ARDUINO_PIN_18 GPIO17
61 # define ARDUINO_PIN_19 GPIO16
62 #else /* ESP32-EVB */
63 # define ARDUINO_PIN_18 GPIO13
64 # define ARDUINO_PIN_19 GPIO16
65 #endif
66 
67 #define ARDUINO_PIN_LAST 19
74 #if MODULE_OLIMEX_ESP32_GATEWAY
75 # define ARDUINO_PIN_A0 ARDUINO_PIN_14
76 # define ARDUINO_PIN_A1 ARDUINO_PIN_15
77 # define ARDUINO_PIN_A2 ARDUINO_PIN_16
78 # define ARDUINO_PIN_A3 ARDUINO_PIN_17
79 #endif
86 #if MODULE_OLIMEX_ESP32_GATEWAY
87 # define ARDUINO_A0 ADC_LINE(0)
88 # define ARDUINO_A1 ADC_LINE(1)
89 # define ARDUINO_A2 ADC_LINE(2)
90 # define ARDUINO_A3 ADC_LINE(3)
92 # define ARDUINO_ANALOG_PIN_LAST 3
93 #endif
96 #ifdef __cplusplus
97 }
98 #endif
99 
Low-level ADC peripheral driver interface definitions.
Low-level GPIO peripheral driver interface definitions.