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 (13)
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
, 3),
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..19 Other Digital */
64
GPIO_PIN
(
PA
, 12),
65
GPIO_PIN
(
PB
, 15),
66
GPIO_PIN
(
PA
, 13),
67
GPIO_PIN
(
PA
, 15),
68
69
/* 20..28 A0..A8 */
70
GPIO_PIN
(
PB
, 0),
71
GPIO_PIN
(
PB
, 1),
72
GPIO_PIN
(
PB
, 2),
73
GPIO_PIN
(
PB
, 3),
74
GPIO_PIN
(
PA
, 8),
75
GPIO_PIN
(
PA
, 9),
76
GPIO_PIN
(
PA
, 4),
77
GPIO_PIN
(
PA
, 10),
78
GPIO_PIN
(
PA
, 11),
79
80
/* 29..30 - SERCOM/UART (Serial1) */
81
GPIO_PIN
(
PB
, 14),
82
GPIO_PIN
(
PB
, 13),
83
84
/* 31..32 - SERCOM/UART (Serial2) */
85
GPIO_PIN
(
PA
, 6),
86
GPIO_PIN
(
PA
, 5),
87
88
/* 33..34 - I2C pins (SDA/SCL) */
89
GPIO_PIN
(
PA
, 16),
90
GPIO_PIN
(
PA
, 17),
91
92
/* 35..36 - I2C1 pins (SDA/SCL) */
93
GPIO_PIN
(
PA
, 8),
94
GPIO_PIN
(
PA
, 9),
95
96
/* 37..40 - SPI pins (ICSP: MISO, SS, MOSI, SCK) */
97
/* Notice that SCK is sharing the same PA21 with LED_BUILTIN */
98
GPIO_PIN
(
PA
, 22),
99
GPIO_PIN
(
PA
, 23),
100
GPIO_PIN
(
PA
, 20),
101
GPIO_PIN
(
PA
, 21),
102
103
/* 41..42 - USB */
104
GPIO_PIN
(
PA
, 24),
105
GPIO_PIN
(
PA
, 25),
106
107
/* 43 DAC */
108
GPIO_PIN
(
PA
, 2),
109
110
/* 44 Flash CS */
111
GPIO_PIN
(
PB
, 16),
112
113
/* 45..46 LoRa, BT Reset */
114
GPIO_PIN
(
PA
, 7),
115
GPIO_PIN
(
PB
, 17),
116
117
/* 47 Button */
118
GPIO_PIN
(
PA
, 14),
119
120
/* 48 BAT_VOLT */
121
GPIO_PIN
(
PB
, 5),
122
};
123
127
static
const
adc_t
arduino_analog_map
[] = {
128
ADC_LINE
(0),
129
ADC_LINE
(1),
130
ADC_LINE
(2),
131
ADC_LINE
(3),
132
ADC_LINE
(4),
133
ADC_LINE
(5),
134
ADC_LINE
(6),
135
ADC_LINE
(7),
136
ADC_LINE
(8),
137
ADC_LINE
(9),
138
};
139
140
#ifdef __cplusplus
141
}
142
#endif
143
144
#endif
/* ARDUINO_BOARD_H */
145
arduino_analog_map
static const adc_t arduino_analog_map[]
Look-up table for the Arduino's analog pins.
Definition:
arduino_board.h:127
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
arduino_pinmap
static const gpio_t arduino_pinmap[]
Look-up table for the Arduino's digital pins.
Definition:
arduino_board.h:42
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
Generated on Tue Nov 24 2020 19:46:49 by
1.8.17