arduino_iomap.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2022 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 #ifdef MODULE_ESP32C3_WEMOS_MINI_V1_0_0
29 # define ARDUINO_LED (5)
30 #endif
31 
36 #define ARDUINO_PIN_0 GPIO20
37 #define ARDUINO_PIN_1 GPIO21
38 #define ARDUINO_PIN_2 GPIO9
39 #define ARDUINO_PIN_3 GPIO6
41 #ifdef MODULE_ESP32C3_WEMOS_MINI_V1_0_0
42 
43 # define ARDUINO_PIN_4 GPIO0
44 # define ARDUINO_PIN_5 GPIO1
45 # define ARDUINO_PIN_6 GPIO7
47 # define ARDUINO_PIN_10 GPIO5
48 # define ARDUINO_PIN_11 GPIO4
49 # define ARDUINO_PIN_12 GPIO3
50 # define ARDUINO_PIN_13 GPIO2
52 #else /* MODULE_ESP32C3_WEMOS_MINI_V2_1_0 */
53 
54 # define ARDUINO_PIN_4 GPIO7
55 # define ARDUINO_PIN_6 GPIO2
56 # define ARDUINO_PIN_7 GPIO3
58 # define ARDUINO_PIN_10 GPIO5
59 # define ARDUINO_PIN_11 GPIO4
60 # define ARDUINO_PIN_12 GPIO0
61 # define ARDUINO_PIN_13 GPIO1
63 #endif
64 
65 /* Arduino pins 7 ... 9 are not available */
66 
67 /* analog pins as digital pin: */
68 #define ARDUINO_PIN_14 GPIO0
69 #define ARDUINO_PIN_15 GPIO1
70 #define ARDUINO_PIN_16 GPIO2
71 #define ARDUINO_PIN_17 GPIO3
72 #define ARDUINO_PIN_18 GPIO4
73 #define ARDUINO_PIN_19 GPIO5
75 #define ARDUINO_PIN_LAST 19
82 #define ARDUINO_PIN_A0 ARDUINO_PIN_14
83 #define ARDUINO_PIN_A1 ARDUINO_PIN_15
84 #define ARDUINO_PIN_A2 ARDUINO_PIN_16
85 #define ARDUINO_PIN_A3 ARDUINO_PIN_17
86 #define ARDUINO_PIN_A4 ARDUINO_PIN_18
87 #define ARDUINO_PIN_A5 ARDUINO_PIN_19
94 #define ARDUINO_A0 ADC_LINE(0)
95 #define ARDUINO_A1 ADC_LINE(1)
96 #define ARDUINO_A2 ADC_LINE(2)
97 #define ARDUINO_A3 ADC_LINE(3)
98 #define ARDUINO_A4 ADC_LINE(4)
99 #define ARDUINO_A5 ADC_LINE(5)
101 #define ARDUINO_ANALOG_PIN_LAST 5
108 #define ARDUINO_PIN_3_PWM_DEV PWM_DEV(0)
109 #define ARDUINO_PIN_3_PWM_CHAN 1
111 #define ARDUINO_PIN_5_PWM_DEV PWM_DEV(0)
112 #define ARDUINO_PIN_5_PWM_CHAN 0
114 #define ARDUINO_PIN_6_PWM_DEV PWM_DEV(0)
115 #define ARDUINO_PIN_6_PWM_CHAN 2
118 #ifdef __cplusplus
119 }
120 #endif
121 
Low-level ADC peripheral driver interface definitions.
Low-level GPIO peripheral driver interface definitions.