fb11e647
vrobic
reseau statique a...
|
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
|
/*
* 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 boards_weio
* @{
*
* @file
* @brief Peripheral MCU configuration for the WeIO board
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
* @author Paul RATHGEB <paul.rathgeb@skynet.be>
*/
#ifndef PERIPH_CONF_H_
#define PERIPH_CONF_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Clock configuration
* @{
*/
#define CLOCK_CORECLOCK (48000000U)
/** @} */
/**
* @brief Timer configuration
* @{
*/
#define TIMER_NUMOF (1U)
#define TIMER_0_EN 1
#define TIMER_IRQ_PRIO 1
/* Timer 0 configuration */
#define TIMER_0_DEV LPC_CT32B1
#define TIMER_0_CHANNELS 4
#define TIMER_0_FREQ (48000000ul)
#define TIMER_0_MAX_VALUE (0xffffffff)
#define TIMER_0_CLKEN() (LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 10))
#define TIMER_0_CLKDIS() (LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 10))
#define TIMER_0_ISR isr_ct32b1
#define TIMER_0_IRQ TIMER_32_1_IRQn
/* @} */
/**
* @brief UART configuration
* @{
*/
#define UART_NUMOF (1U)
#define UART_0_EN 1
#define UART_IRQ_PRIO 2
/* UART 0 device configuration */
#define UART_0_DEV LPC_USART
#define UART_0_CLKSEL() (LPC_SYSCON->UARTCLKDIV = (1)) /* PCLK := CCLK / 1 */
#define UART_0_CLKEN() (LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 12))
#define UART_0_CLKDIS() (LPC_SYSCON->SYSAHBCLKCTRL &= ~(1 << 12))
#define UART_0_IRQ UART_IRQn
#define UART_0_ISR isr_usart0
/* UART 0 pin configuration */
#define UART_0_TX_PINSEL (LPC_IOCON->PIO0_19)
#define UART_0_RX_PINSEL (LPC_IOCON->PIO0_18)
#define UART_0_TX_PINMODE (LPC_IOCON->PIO0_19)
#define UART_0_RX_PINMODE (LPC_IOCON->PIO0_18)
#define UART_0_TX_PIN (1)
#define UART_0_RX_PIN (2)
#define UART_0_AF (1)
/* @} */
/**
* @brief SPI configuration
* @{
*/
#define SPI_NUMOF (2U)
#define SPI_0_EN 1
#define SPI_1_EN 1
/* @} */
/**
* * @name GPIO configuration
* * @{
*/
#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_16_EN 1
#define GPIO_17_EN 1
#define GPIO_18_EN 1
#define GPIO_19_EN 1
#define GPIO_20_EN 1
#define GPIO_21_EN 1
#define GPIO_22_EN 1
#define GPIO_23_EN 1
#define GPIO_24_EN 1
#define GPIO_25_EN 1
#define GPIO_26_EN 1
#define GPIO_27_EN 1
#define GPIO_28_EN 1
#define GPIO_29_EN 1
#define GPIO_30_EN 1
#define GPIO_31_EN 1
/* WeIO Pin 0 : LPC GPIO0_18 */
#define GPIO_0_PORT 0
#define GPIO_0_PIN 18
/* WeIO Pin 1 : LPC GPIO0_19 */
#define GPIO_1_PORT 0
#define GPIO_1_PIN 19
/* WeIO Pin 2 : LPC GPIO0_9 */
#define GPIO_2_PORT 0
#define GPIO_2_PIN 9
/* WeIO Pin 3 : LPC GPIO0_8 */
#define GPIO_3_PORT 0
#define GPIO_3_PIN 8
/* WeIO Pin 4 : LPC GPIO0_10 */
#define GPIO_4_PORT 0
#define GPIO_4_PIN 10
/* WeIO Pin 5 : LPC GPIO0_2 */
#define GPIO_5_PORT 0
#define GPIO_5_PIN 2
/* WeIO Pin 6 : LPC GPIO0_7 */
#define GPIO_6_PORT 0
#define GPIO_6_PIN 7
/* WeIO Pin 7 : LPC GPIO0_17 */
#define GPIO_7_PORT 0
#define GPIO_7_PIN 17
/* WeIO Pin 8 : LPC GPIO0_21 */
#define GPIO_8_PORT 0
#define GPIO_8_PIN 21
/* WeIO Pin 9 : LPC GPIO1_21 */
#define GPIO_9_PORT 1
#define GPIO_9_PIN 21
/* WeIO Pin 10 : LPC GPIO1_20 */
#define GPIO_10_PORT 1
#define GPIO_10_PIN 20
/* WeIO Pin 11 : LPC GPIO0_20 */
#define GPIO_11_PORT 0
#define GPIO_11_PIN 20
/* WeIO Pin 12 : LPC GPIO1_16 */
#define GPIO_12_PORT 1
#define GPIO_12_PIN 16
/* WeIO Pin 13 : LPC GPIO1_19 */
#define GPIO_13_PORT 1
#define GPIO_13_PIN 19
/* WeIO Pin 14 : LPC GPIO1_22 */
#define GPIO_14_PORT 1
#define GPIO_14_PIN 22
/* WeIO Pin 15 : LPC GPIO1_23 */
#define GPIO_15_PORT 1
#define GPIO_15_PIN 23
/* WeIO Pin 16 : LPC GPIO1_27 */
#define GPIO_16_PORT 1
#define GPIO_16_PIN 27
/* WeIO Pin 17 : LPC GPIO1_28 */
#define GPIO_17_PORT 1
#define GPIO_17_PIN 28
/* WeIO Pin 18 : LPC GPIO1_13 */
#define GPIO_18_PORT 1
#define GPIO_18_PIN 13
/* WeIO Pin 19 : LPC GPIO1_14 */
#define GPIO_19_PORT 1
#define GPIO_19_PIN 14
/* WeIO Pin 20 : LPC GPIO1_15 */
#define GPIO_20_PORT 1
#define GPIO_20_PIN 15
/* WeIO Pin 21 : LPC GPIO1_24 */
#define GPIO_21_PORT 1
#define GPIO_21_PIN 24
/* WeIO Pin 22 : LPC GPIO1_25 */
#define GPIO_22_PORT 1
#define GPIO_22_PIN 25
/* WeIO Pin 23 : LPC GPIO1_26 */
#define GPIO_23_PORT 1
#define GPIO_23_PIN 26
/* WeIO Pin 24 : LPC GPIO0_11 */
#define GPIO_24_PORT 0
#define GPIO_24_PIN 11
/* WeIO Pin 25 : LPC GPIO0_12 */
#define GPIO_25_PORT 0
#define GPIO_25_PIN 12
/* WeIO Pin 26 : LPC GPIO0_13 */
#define GPIO_26_PORT 0
#define GPIO_26_PIN 13
/* WeIO Pin 27 : LPC GPIO0_14 */
#define GPIO_27_PORT 0
#define GPIO_27_PIN 14
/* WeIO Pin 28 : LPC GPIO0_15 */
#define GPIO_28_PORT 0
#define GPIO_28_PIN 15
/* WeIO Pin 29 : LPC GPIO0_16 */
#define GPIO_29_PORT 0
#define GPIO_29_PIN 16
/* WeIO Pin 30 : LPC GPIO0_22 */
#define GPIO_30_PORT 0
#define GPIO_30_PIN 22
/* WeIO Pin 31 : LPC GPIO0_23 */
#define GPIO_31_PORT 0
#define GPIO_31_PIN 23
/** @} */
/**
* @brief PWM configuration
* @{
*/
#define PWM_0_EN 1
#define PWM_0_CHANNELS 3
#define PWM_1_EN 1
#define PWM_1_CHANNELS 3
#define PWM_NUMOF (2U)
/* PWM0 common configuration */
#define PWM_0_DEV LPC_CT16B0
#define PWM_0_CLK BIT7
/* PWM_0 channel configuration */
#define PWM_0_CH0_EN 1
#define PWM_0_CH0_IOCON LPC_IOCON->PIO1_13
#define PWM_0_CH0_AF 0x82
#define PWM_0_CH1_EN 1
#define PWM_0_CH1_IOCON LPC_IOCON->PIO1_14
#define PWM_0_CH1_AF 0x82
#define PWM_0_CH2_EN 1
#define PWM_0_CH2_IOCON LPC_IOCON->PIO1_15
#define PWM_0_CH2_AF 0x82
/* PWM1 common configuration */
#define PWM_1_DEV LPC_CT32B0
#define PWM_1_CLK BIT9
/* PWM_1 channel configuration */
#define PWM_1_CH0_EN 1
#define PWM_1_CH0_IOCON LPC_IOCON->PIO1_24
#define PWM_1_CH0_AF 0x81
#define PWM_1_CH1_EN 1
#define PWM_1_CH1_IOCON LPC_IOCON->PIO1_25
#define PWM_1_CH1_AF 0x81
#define PWM_1_CH2_EN 1
#define PWM_1_CH2_IOCON LPC_IOCON->PIO1_26
#define PWM_1_CH2_AF 0x81
/* @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_H_ */
/** @} */
|