/
periph_conf.h
195 lines (181 loc) · 5.23 KB
/
periph_conf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*
* Copyright (C) 2014 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup board_arduino-due
* @{
*
* @file periph_conf.h
* @brief Peripheral MCU configuration for the Arduino Due board
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef __PERIPH_CONF_H
#define __PERIPH_CONF_H
/**
* @name Timer peripheral configuration
* @{
*/
#define TIMER_NUMOF (3U)
#define TIMER_0_EN 1
#define TIMER_1_EN 1
#define TIMER_2_EN 1
/* Timer 0 configuration */
#define TIMER_0_DEV TC0
#define TIMER_0_CHANNELS 6
#define TIMER_0_MAX_VALUE (0xffffffff)
#define TIMER_0_ISR1 isr_tc0
#define TIMER_0_ISR2 isr_tc1
/* Timer 1 configuration */
#define TIMER_1_DEV TC1
#define TIMER_1_CHANNELS 6
#define TIMER_1_MAX_VALUE (0xffffffff)
#define TIMER_1_ISR1 isr_tc3
#define TIMER_1_ISR2 isr_tc4
/* Timer 2 configuration */
#define TIMER_2_DEV TC2
#define TIMER_2_CHANNELS 6
#define TIMER_2_MAX_VALUE (0xffffffff)
#define TIMER_2_ISR1 isr_tc6
#define TIMER_2_ISR2 isr_tc7
/** @} */
/**
* @name UART configuration
* @{
*/
#define UART_NUMOF (1U)
#define UART_0_EN 1
#define UART_1_EN 0
#define UART_2_EN 0
#define UART_3_EN 0
#define UART_IRQ_PRIO 1
/* UART 0 device configuration */
#define UART_0_DEV UART
#define UART_0_IRQ UART_IRQn
#define UART_0_ISR isr_uart
/* UART 0 pin configuration */
#define UART_0_PORT PIOA
#define UART_0_PINS (PIO_PA8 | PIO_PA9)
/* UART 1 device configuration */
#define UART_1_DEV
#define UART_1_IRQ
#define UART_1_ISR
/* UART 1 pin configuration */
#define UART_1_PORT
#define UART_1_PINS
/** @} */
/**
* @name Random Number Generator configuration
* @{
*/
#define RANDOM_NUMOF (1U)
/** @} */
/**
* @name GPIO configuration
* @{
*/
#define GPIO_NUMOF (16U)
#define GPIO_0_EN 1
#define GPIO_1_EN 1
#define GPIO_2_EN 1
#define GPIO_3_EN 1
#define GPIO_4_EN 1
#define GPIO_5_EN 1
#define GPIO_6_EN 1
#define GPIO_7_EN 1
#define GPIO_8_EN 1
#define GPIO_9_EN 1
#define GPIO_10_EN 1
#define GPIO_11_EN 1
#define GPIO_12_EN 1
#define GPIO_13_EN 1
#define GPIO_14_EN 1
#define GPIO_15_EN 1
#define GPIO_IRQ_PRIO 1
/* GPIO channel 0 config */
#define GPIO_0_DEV PIOA
#define GPIO_0_PIN PIO_PA14
#define GPIO_0_IRQ PIOA_IRQn
#define GPIO_A14_MAP 0
/* GPIO channel 1 config */
#define GPIO_1_DEV PIOD
#define GPIO_1_PIN PIO_PD0
#define GPIO_1_IRQ PIOD_IRQn
#define GPIO_D0_MAP 1
/* GPIO channel 2 config */
#define GPIO_2_DEV PIOD
#define GPIO_2_PIN PIO_PD2
#define GPIO_2_IRQ PIOD_IRQn
#define GPIO_D2_MAP 2
/* GPIO channel 3 config */
#define GPIO_3_DEV PIOD
#define GPIO_3_PIN PIO_PD6
#define GPIO_3_IRQ PIOD_IRQn
#define GPIO_D6_MAP 3
/* GPIO channel 4 config */
#define GPIO_4_DEV PIOA
#define GPIO_4_PIN PIO_PA7
#define GPIO_4_IRQ PIOA_IRQn
#define GPIO_A7_MAP 4
/* GPIO channel 5 config */
#define GPIO_5_DEV PIOC
#define GPIO_5_PIN PIO_PC1
#define GPIO_5_IRQ PIOC_IRQn
#define GPIO_C1_MAP 5
/* GPIO channel 6 config */
#define GPIO_6_DEV PIOC
#define GPIO_6_PIN PIO_PC3
#define GPIO_6_IRQ PIOC_IRQn
#define GPIO_C3_MAP 6
/* GPIO channel 7 config */
#define GPIO_7_DEV PIOC
#define GPIO_7_PIN PIO_PC5
#define GPIO_7_IRQ PIOC_IRQn
#define GPIO_C5_MAP 7
/* GPIO channel 8 config */
#define GPIO_8_DEV PIOC
#define GPIO_8_PIN PIO_PC7
#define GPIO_8_IRQ PIOC_IRQn
#define GPIO_C7_MAP 8
/* GPIO channel 9 config */
#define GPIO_9_DEV PIOC
#define GPIO_9_PIN PIO_PC9
#define GPIO_9_IRQ PIOC_IRQn
#define GPIO_C9_MAP 9
/* GPIO channel 10 config */
#define GPIO_10_DEV PIOA
#define GPIO_10_PIN PIO_PA20
#define GPIO_10_IRQ PIOA_IRQn
#define GPIO_A20_MAP 10
/* GPIO channel 11 config */
#define GPIO_11_DEV PIOC
#define GPIO_11_PIN PIO_PC18
#define GPIO_11_IRQ PIOC_IRQn
#define GPIO_C18_MAP 11
/* GPIO channel 12 config */
#define GPIO_12_DEV PIOC
#define GPIO_12_PIN PIO_PC16
#define GPIO_12_IRQ PIOC_IRQn
#define GPIO_C16_MAP 12
/* GPIO channel 13 config */
#define GPIO_13_DEV PIOC
#define GPIO_13_PIN PIO_PC14
#define GPIO_13_IRQ PIOC_IRQn
#define GPIO_C14_MAP 13
/* GPIO channel 14 config */
#define GPIO_14_DEV PIOC
#define GPIO_14_PIN PIO_PC12
#define GPIO_14_IRQ PIOC_IRQn
#define GPIO_C12_MAP 14
/* GPIO channel 15 config */
#define GPIO_15_DEV PIOB
#define GPIO_15_PIN PIO_PB14
#define GPIO_15_IRQ PIOB_IRQn
#define GPIO_B14_MAP 15
/** @} */
#endif /* __PERIPH_CONF_H */
/** @} */