Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
arduino_board.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2019 Kees Bakker
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
19
#ifndef ARDUINO_BOARD_H
20
#define ARDUINO_BOARD_H
21
22
#include "
periph/gpio.h
"
23
#include "
periph/adc.h
"
24
25
#ifdef __cplusplus
26
extern
"C"
{
27
#endif
28
32
#define ARDUINO_LED (15)
33
37
#define ARDUINO_UART_DEV UART_DEV(0)
38
42
static
const
gpio_t
arduino_pinmap
[] = {
43
/* 0..3 Main IO Pins (D0-D3) Digital Properties */
44
GPIO_PIN
(
PA
, 2),
45
GPIO_PIN
(
PA
, 3),
46
GPIO_PIN
(
PB
, 8),
47
GPIO_PIN
(
PB
, 9),
48
49
/* 4..5 Other Digital Pins */
50
GPIO_PIN
(
PA
, 21),
51
GPIO_PIN
(
PA
, 20),
52
53
/* 6..13 Main IO Pins (D6-D13) Digital Properties */
54
GPIO_PIN
(
PA
, 6),
55
GPIO_PIN
(
PA
, 7),
56
GPIO_PIN
(
PA
, 8),
57
GPIO_PIN
(
PA
, 9),
58
GPIO_PIN
(
PA
, 10),
59
GPIO_PIN
(
PA
, 11),
60
GPIO_PIN
(
PB
, 2),
61
GPIO_PIN
(
PB
, 3),
62
63
/* 14..21 Other Digital Pins */
64
GPIO_PIN
(
PA
, 15),
65
GPIO_PIN
(
PB
, 10),
66
GPIO_PIN
(
PB
, 11),
67
GPIO_PIN
(
PA
, 14),
68
GPIO_PIN
(
PA
, 18),
69
GPIO_PIN
(
PA
, 16),
70
GPIO_PIN
(
PB
, 22),
71
GPIO_PIN
(
PA
, 17),
72
73
/* 22..33 Main IO Pins Analog Properties */
74
GPIO_PIN
(
PA
, 2),
75
GPIO_PIN
(
PA
, 3),
76
GPIO_PIN
(
PB
, 8),
77
GPIO_PIN
(
PB
, 9),
78
GPIO_PIN
(
PA
, 6),
79
GPIO_PIN
(
PA
, 7),
80
GPIO_PIN
(
PA
, 8),
81
GPIO_PIN
(
PA
, 9),
82
GPIO_PIN
(
PA
, 10),
83
GPIO_PIN
(
PA
, 11),
84
GPIO_PIN
(
PB
, 2),
85
GPIO_PIN
(
PB
, 3),
86
87
/* 34..36 Other Analog Pins */
88
GPIO_PIN
(
PA
, 2),
89
GPIO_PIN
(
PA
, 3),
90
GPIO_PIN
(
PA
, 5),
91
92
/* 37..38 USB Pins */
93
GPIO_PIN
(
PA
, 24),
94
GPIO_PIN
(
PA
, 25),
95
96
/* 39..40 Serial */
97
GPIO_PIN
(
PB
, 3),
98
GPIO_PIN
(
PB
, 2),
99
100
/* 41..42 Serial1 */
101
GPIO_PIN
(
PA
, 13),
102
GPIO_PIN
(
PA
, 12),
103
104
/* 43..46 SPI */
105
GPIO_PIN
(
PA
, 8),
106
GPIO_PIN
(
PA
, 9),
107
GPIO_PIN
(
PA
, 10),
108
GPIO_PIN
(
PA
, 11),
109
110
/* 47..48 I2C */
111
GPIO_PIN
(
PA
, 22),
112
GPIO_PIN
(
PA
, 23),
113
114
/* 49 LoRa RESET */
115
GPIO_PIN
(
PA
, 4),
116
117
/* 50 MAG_INT */
118
GPIO_PIN
(
PA
, 19),
119
};
120
124
static
const
adc_t
arduino_analog_map
[] = {
125
ADC_LINE
(0),
126
ADC_LINE
(1),
127
ADC_LINE
(2),
128
ADC_LINE
(3),
129
ADC_LINE
(4),
130
ADC_LINE
(5),
131
ADC_LINE
(6),
132
ADC_LINE
(7),
133
ADC_LINE
(8),
134
ADC_LINE
(9),
135
ADC_LINE
(10),
136
};
137
138
#ifdef __cplusplus
139
}
140
#endif
141
142
#endif
/* ARDUINO_BOARD_H */
143
adc_t
unsigned int adc_t
Define default ADC type identifier.
Definition:
adc.h:72
adc.h
Low-level ADC peripheral driver interface definitions.
arduino_analog_map
static const adc_t arduino_analog_map[]
Look-up table for the Arduino's analog pins.
Definition:
arduino_board.h:124
PB
@ PB
port B
Definition:
periph_cpu_common.h:89
ADC_LINE
#define ADC_LINE(x)
Default ADC line access macro.
Definition:
adc.h:86
gpio.h
Low-level GPIO peripheral driver interface definitions.
GPIO_PIN
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition:
periph_cpu.h:35
arduino_pinmap
static const gpio_t arduino_pinmap[]
Look-up table for the Arduino's digital pins.
Definition:
arduino_board.h:42
PA
@ PA
port A
Definition:
periph_cpu_common.h:88
Generated on Tue Nov 24 2020 19:46:49 by
1.8.17