arduino_iomap.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2020 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include "periph/gpio.h"
22 #include "periph/adc.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define ARDUINO_PIN_0 GPIO_PIN(1, 1)
33 #define ARDUINO_PIN_1 GPIO_PIN(1, 2)
34 #define ARDUINO_PIN_2 GPIO_PIN(1, 3)
35 #define ARDUINO_PIN_3 GPIO_PIN(1, 4)
36 #define ARDUINO_PIN_4 GPIO_PIN(1, 5)
37 #define ARDUINO_PIN_5 GPIO_PIN(1, 6)
38 #define ARDUINO_PIN_6 GPIO_PIN(1, 7)
39 #define ARDUINO_PIN_7 GPIO_PIN(1, 8)
40 #define ARDUINO_PIN_8 GPIO_PIN(1, 10)
41 #define ARDUINO_PIN_9 GPIO_PIN(1, 11)
42 #define ARDUINO_PIN_10 GPIO_PIN(1, 12)
43 #define ARDUINO_PIN_11 GPIO_PIN(1, 13)
44 #define ARDUINO_PIN_12 GPIO_PIN(1, 14)
45 #define ARDUINO_PIN_13 GPIO_PIN(1, 15)
46 #define ARDUINO_PIN_14 GPIO_PIN(0, 3)
47 #define ARDUINO_PIN_15 GPIO_PIN(0, 4)
48 #define ARDUINO_PIN_16 GPIO_PIN(0, 28)
49 #define ARDUINO_PIN_17 GPIO_PIN(0, 29)
50 #define ARDUINO_PIN_18 GPIO_PIN(0, 30)
51 #define ARDUINO_PIN_19 GPIO_PIN(0, 31)
52 #define ARDUINO_PIN_20 GPIO_PIN(0, 13)
53 #define ARDUINO_PIN_21 GPIO_PIN(0, 14)
54 #define ARDUINO_PIN_22 GPIO_PIN(1, 9)
55 #define ARDUINO_PIN_23 GPIO_PIN(0, 16)
56 
57 #define ARDUINO_PIN_LAST 23
64 #define ARDUINO_PIN_A0 ARDUINO_PIN_14
65 #define ARDUINO_PIN_A1 ARDUINO_PIN_15
66 #define ARDUINO_PIN_A2 ARDUINO_PIN_16
67 #define ARDUINO_PIN_A3 ARDUINO_PIN_17
68 #define ARDUINO_PIN_A4 ARDUINO_PIN_18
69 #define ARDUINO_PIN_A5 ARDUINO_PIN_19
76 #define ARDUINO_A0 ADC_LINE(1)
77 #define ARDUINO_A1 ADC_LINE(2)
78 #define ARDUINO_A2 ADC_LINE(4)
79 #define ARDUINO_A3 ADC_LINE(5)
80 #define ARDUINO_A4 ADC_LINE(6)
81 #define ARDUINO_A5 ADC_LINE(7)
82 
83 #define ARDUINO_ANALOG_PIN_LAST 5
93 #define ARDUINO_PWM_FREQU (15625U)
94 
95 #define ARDUINO_PIN_3_PWM_DEV PWM_DEV(0)
96 #define ARDUINO_PIN_3_PWM_CHAN 0
97 
98 #define ARDUINO_PIN_5_PWM_DEV PWM_DEV(0)
99 #define ARDUINO_PIN_5_PWM_CHAN 1
100 
101 #define ARDUINO_PIN_6_PWM_DEV PWM_DEV(0)
102 #define ARDUINO_PIN_6_PWM_CHAN 2
103 
104 #define ARDUINO_PIN_9_PWM_DEV PWM_DEV(0)
105 #define ARDUINO_PIN_9_PWM_CHAN 3
106 
107 #define ARDUINO_PIN_20_PWM_DEV PWM_DEV(1)
108 #define ARDUINO_PIN_20_PWM_CHAN 0
109 
110 #define ARDUINO_PIN_21_PWM_DEV PWM_DEV(1)
111 #define ARDUINO_PIN_21_PWM_CHAN 1
112 
113 #define ARDUINO_PIN_22_PWM_DEV PWM_DEV(1)
114 #define ARDUINO_PIN_22_PWM_CHAN 2
115 
116 #define ARDUINO_PIN_23_PWM_DEV PWM_DEV(1)
117 #define ARDUINO_PIN_23_PWM_CHAN 3
120 #ifdef __cplusplus
121 }
122 #endif
123 
Low-level ADC peripheral driver interface definitions.
Low-level GPIO peripheral driver interface definitions.