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 (17)
33
37
#define ARDUINO_UART_DEV UART_DEV(0)
38
42
static
const
gpio_t
arduino_pinmap
[] = {
43
/* 0..1 - SERCOM/UART (Serial) */
44
GPIO_PIN
(
PB
, 31),
45
GPIO_PIN
(
PB
, 30),
46
47
/* 2..15 Digital */
48
GPIO_PIN
(
PA
, 2),
49
GPIO_PIN
(
PA
, 19),
50
GPIO_PIN
(
PB
, 4),
51
GPIO_PIN
(
PB
, 6),
52
GPIO_PIN
(
PB
, 7),
53
GPIO_PIN
(
PB
, 8),
54
GPIO_PIN
(
PB
, 10),
55
GPIO_PIN
(
PB
, 11),
56
GPIO_PIN
(
PA
, 23),
57
GPIO_PIN
(
PA
, 20),
58
GPIO_PIN
(
PA
, 22),
59
GPIO_PIN
(
PA
, 21),
60
GPIO_PIN
(
PA
, 10),
61
GPIO_PIN
(
PA
, 11),
62
63
/* 16..18 RGB LED */
64
GPIO_PIN
(
PA
, 12),
65
GPIO_PIN
(
PB
, 15),
66
GPIO_PIN
(
PA
, 13),
67
68
/* 19..25 On-board Peripheral Inputs */
69
GPIO_PIN
(
PA
, 14),
70
GPIO_PIN
(
PA
, 15),
71
GPIO_PIN
(
PA
, 18),
72
GPIO_PIN
(
PB
, 16),
73
GPIO_PIN
(
PB
, 22),
74
GPIO_PIN
(
PA
, 4),
75
GPIO_PIN
(
PA
, 7),
76
77
/* 26..30 On-board Peripheral Outputs */
78
GPIO_PIN
(
PA
, 28),
79
GPIO_PIN
(
PA
, 27),
80
GPIO_PIN
(
PB
, 14),
81
GPIO_PIN
(
PB
, 13),
82
GPIO_PIN
(
PB
, 12),
83
84
/* 31..36 A0..A5 */
85
GPIO_PIN
(
PB
, 0),
86
GPIO_PIN
(
PB
, 1),
87
GPIO_PIN
(
PB
, 2),
88
GPIO_PIN
(
PB
, 3),
89
GPIO_PIN
(
PA
, 8),
90
GPIO_PIN
(
PA
, 9),
91
92
/* 37..40 Other Analog Inputs */
93
GPIO_PIN
(
PA
, 10),
94
GPIO_PIN
(
PA
, 11),
95
GPIO_PIN
(
PB
, 5),
96
GPIO_PIN
(
PB
, 9),
97
98
/* 41..42 - SERCOM/UART (Serial1) */
99
GPIO_PIN
(
PA
, 6),
100
GPIO_PIN
(
PA
, 5),
101
102
/* 43..44 - I2C pins (SDA/SCL) */
103
GPIO_PIN
(
PA
, 16),
104
GPIO_PIN
(
PA
, 17),
105
106
/* 45..48 - SPI pins (ICSP: MISO, SS, MOSI, SCK)
107
* Notice that SCK is sharing the same PA21 with LED_BUILTIN
108
*/
109
GPIO_PIN
(
PA
, 22),
110
GPIO_PIN
(
PA
, 23),
111
GPIO_PIN
(
PA
, 20),
112
GPIO_PIN
(
PA
, 21),
113
114
/* 49..50 - USB */
115
GPIO_PIN
(
PA
, 24),
116
GPIO_PIN
(
PA
, 25),
117
118
/* 51..52 - DAC, SARA_R4XX_TOGGLE */
119
GPIO_PIN
(
PA
, 2),
120
GPIO_PIN
(
PB
, 17),
121
122
/* 53..54 - I2C1 pins (SDA/SCL) */
123
GPIO_PIN
(
PA
, 8),
124
GPIO_PIN
(
PA
, 9),
125
};
126
130
static
const
adc_t
arduino_analog_map
[] = {
131
ADC_LINE
(0),
132
ADC_LINE
(1),
133
ADC_LINE
(2),
134
ADC_LINE
(3),
135
ADC_LINE
(4),
136
ADC_LINE
(5),
137
ADC_LINE
(6),
138
ADC_LINE
(7),
139
ADC_LINE
(8),
140
};
141
142
#ifdef __cplusplus
143
}
144
#endif
145
146
#endif
/* ARDUINO_BOARD_H */
147
adc_t
unsigned int adc_t
Define default ADC type identifier.
Definition:
adc.h:72
adc.h
Low-level ADC peripheral driver interface definitions.
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
PA
@ PA
port A
Definition:
periph_cpu_common.h:88
arduino_pinmap
static const gpio_t arduino_pinmap[]
Look-up table for the Arduino's digital pins.
Definition:
arduino_board.h:42
arduino_analog_map
static const adc_t arduino_analog_map[]
Look-up table for the Arduino's analog pins.
Definition:
arduino_board.h:130
Generated on Tue Nov 24 2020 19:46:49 by
1.8.17