-
Notifications
You must be signed in to change notification settings - Fork 38
/
mcu_definitions.h
331 lines (309 loc) · 8.59 KB
/
mcu_definitions.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
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
/****************************************************************************
**
** Copyright (C) ${COPYRIGHT_YEAR} MikroElektronika d.o.o.
** Contact: https://www.mikroe.com/contact
**
** This file is part of the mikroSDK package
**
** Commercial License Usage
**
** Licensees holding valid commercial NECTO compilers AI licenses may use this
** file in accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The MikroElektronika Company.
** For licensing terms and conditions see
** https://www.mikroe.com/legal/software-license-agreement.
** For further information use the contact form at
** https://www.mikroe.com/contact.
**
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used for
** non-commercial projects under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** The above copyright notice and this permission notice shall be
** included in all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** OF MERCHANTABILITY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
** TO THE WARRANTIES FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
** DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**
****************************************************************************/
/*!
* @file mcu_definitions.h
* @brief MCU specific pin and module definitions.
*/
#ifndef _MCU_DEFINITIONS_H_
#define _MCU_DEFINITIONS_H_
#include "mcu_reg_addresses.h"
#include "dma_definitions.h"
#include "can_definitions.h"
//ADC
#define ADC0_IN10_PC0
#define ADC1_IN10_PC0
#define ADC0_IN11_PC1
#define ADC1_IN11_PC1
#define ADC0_IN12_PC2
#define ADC1_IN12_PC2
#define ADC0_IN13_PC3
#define ADC1_IN13_PC3
#define ADC0_IN0_PA0
#define ADC1_IN0_PA0
#define ADC0_IN1_PA1
#define ADC1_IN1_PA1
#define ADC0_IN2_PA2
#define ADC1_IN2_PA2
#define ADC0_IN3_PA3
#define ADC1_IN3_PA3
#define ADC0_IN4_PA4
#define ADC1_IN4_PA4
#define ADC0_IN5_PA5
#define ADC1_IN5_PA5
#define ADC0_IN6_PA6
#define ADC1_IN6_PA6
#define ADC0_IN7_PA7
#define ADC1_IN7_PA7
#define ADC0_IN14_PC4
#define ADC1_IN14_PC4
#define ADC0_IN15_PC5
#define ADC1_IN15_PC5
#define ADC0_IN8_PB0
#define ADC1_IN8_PB0
#define ADC0_IN9_PB1
#define ADC1_IN9_PB1
#define ADC_MODULE_0 (1)
#define ADC_MODULE_1 (2)
#define ADC_MODULE_COUNT (2)
//EOF ADC
//I2C
#define I2C1_SCL_PB10_REMAP_NONE
#define I2C1_SDA_PB11_REMAP_NONE
#define I2C0_SCL_PB6_REMAP_NONE
#define I2C0_SDA_PB7_REMAP_NONE
#define I2C0_SCL_PB8_REMAP_FULL
#define I2C0_SDA_PB9_REMAP_FULL
#define I2C_MODULE_1 (2)
#define I2C_MODULE_0 (1)
#define I2C_MODULE_COUNT (2)
//EOF I2C
//U(S)ART
#define UART1_TX_PA2_REMAP_NONE
#define UART1_RX_PA3_REMAP_NONE
#define UART2_TX_PB10_REMAP_NONE
#define UART2_RX_PB11_REMAP_NONE
#define UART2_TX_PD8_REMAP_FULL
#define UART2_RX_PD9_REMAP_FULL
#define UART0_TX_PA9_REMAP_NONE
#define UART0_RX_PA10_REMAP_NONE
#define UART3_TX_PC10_REMAP_NONE
#define UART2_TX_PC10_REMAP_PARTIAL
#define UART3_RX_PC11_REMAP_NONE
#define UART2_RX_PC11_REMAP_PARTIAL
#define UART4_TX_PC12_REMAP_NONE
#define UART4_RX_PD2_REMAP_NONE
#define UART1_TX_PD5_REMAP_FULL
#define UART1_RX_PD6_REMAP_FULL
#define UART0_TX_PB6_REMAP_FULL
#define UART0_RX_PB7_REMAP_FULL
#define UART_MODULE_1 (2)
#define UART_MODULE_2 (3)
#define UART_MODULE_0 (1)
#define UART_MODULE_3 (4)
#define UART_MODULE_4 (5)
#define UART_MODULE_COUNT (5)
//EOF U(S)ART
//SPI
#define SPI0_SCK_PA5_REMAP_NONE
#define SPI0_MISO_PA6_REMAP_NONE
#define SPI0_MOSI_PA7_REMAP_NONE
#define SPI1_SCK_PB13_REMAP_NONE
#define SPI1_MISO_PB14_REMAP_NONE
#define SPI1_MOSI_PB15_REMAP_NONE
#define SPI2_SCK_PC10_REMAP_FULL
#define SPI2_MISO_PC11_REMAP_FULL
#define SPI2_MOSI_PC12_REMAP_FULL
#define SPI2_SCK_PB3_REMAP_NONE
#define SPI0_SCK_PB3_REMAP_FULL
#define SPI2_MISO_PB4_REMAP_NONE
#define SPI0_MISO_PB4_REMAP_FULL
#define SPI2_MOSI_PB5_REMAP_NONE
#define SPI0_MOSI_PB5_REMAP_FULL
#define SPI_MODULE_0 (1)
#define SPI_MODULE_1 (2)
#define SPI_MODULE_2 (3)
#define SPI_MODULE_COUNT (3)
//EOF SPI
//TIM
#define TIMER1_CH0_PA0_REMAP_NONE
#define TIMER4_CH0_PA0_REMAP_NONE
#define TIMER1_CH1_PA1_REMAP_NONE
#define TIMER4_CH1_PA1_REMAP_NONE
#define TIMER1_CH2_PA2_REMAP_NONE
#define TIMER4_CH2_PA2_REMAP_NONE
#define TIMER1_CH3_PA3_REMAP_NONE
#define TIMER4_CH3_PA3_REMAP_NONE
#define TIMER2_CH0_PA6_REMAP_NONE
#define TIMER2_CH1_PA7_REMAP_NONE
#define TIMER0_CH0_PA7_REMAP_PARTIAL
#define TIMER0_CH0_ON_PA7_INVERTED_REMAP_NONE
#define TIMER2_CH2_PB0_REMAP_NONE
#define TIMER0_CH1_PB0_REMAP_PARTIAL
#define TIMER0_CH1_ON_PB0_INVERTED_REMAP_NONE
#define TIMER2_CH3_PB1_REMAP_NONE
#define TIMER0_CH2_PB1_REMAP_PARTIAL
#define TIMER0_CH2_ON_PB1_INVERTED_REMAP_NONE
#define TIMER0_CH0_PE8_REMAP_FULL
#define TIMER0_CH0_ON_PE8_INVERTED_REMAP_NONE
#define TIMER0_CH0_PE9_REMAP_FULL
#define TIMER0_CH1_PE10_REMAP_FULL
#define TIMER0_CH1_ON_PE10_INVERTED_REMAP_NONE
#define TIMER0_CH1_PE11_REMAP_FULL
#define TIMER0_CH2_PE12_REMAP_FULL
#define TIMER0_CH2_ON_PE12_INVERTED_REMAP_NONE
#define TIMER0_CH2_PE13_REMAP_FULL
#define TIMER0_CH3_PE14_REMAP_FULL
#define TIMER1_CH2_PB10_REMAP_FULL
#define TIMER1_CH3_PB11_REMAP_FULL
#define TIMER0_CH0_PB13_REMAP_NONE
#define TIMER0_CH0_ON_PB13_INVERTED_REMAP_NONE
#define TIMER0_CH1_PB14_REMAP_NONE
#define TIMER0_CH1_ON_PB14_INVERTED_REMAP_NONE
#define TIMER0_CH2_PB15_REMAP_NONE
#define TIMER0_CH2_ON_PB15_INVERTED_REMAP_NONE
#define TIMER3_CH0_PD12_REMAP_FULL
#define TIMER3_CH1_PD13_REMAP_FULL
#define TIMER3_CH2_PD14_REMAP_FULL
#define TIMER3_CH3_PD15_REMAP_FULL
#define TIMER2_CH1_PC7_REMAP_FULL
#define TIMER2_CH2_PC8_REMAP_FULL
#define TIMER2_CH3_PC9_REMAP_FULL
#define TIMER0_CH0_PA8_REMAP_NONE
#define TIMER0_CH1_PA9_REMAP_NONE
#define TIMER0_CH2_PA10_REMAP_NONE
#define TIMER0_CH3_PA11_REMAP_NONE
#define TIMER1_CH0_PA15_REMAP_NONE
#define TIMER1_CH1_PB3_REMAP_PARTIAL
#define TIMER2_CH0_PB4_REMAP_PARTIAL
#define TIMER2_CH1_PB5_REMAP_PARTIAL
#define TIMER2_CH0_PC6_REMAP_FULL
#define TIMER3_CH0_PB6_REMAP_NONE
#define TIMER3_CH1_PB7_REMAP_NONE
#define TIMER3_CH2_PB8_REMAP_NONE
#define TIMER3_CH3_PB9_REMAP_NONE
#define TIM_MODULE_1 (2)
#define TIM_MODULE_4 (5)
#define TIM_MODULE_2 (3)
#define TIM_MODULE_0 (1)
#define TIM_MODULE_3 (4)
#define TIM_MODULE_COUNT (5)
//EOF TIM
//GPIO
#define __PE2_CN
#define __PE3_CN
#define __PE4_CN
#define __PE5_CN
#define __PE6_CN
#define __PC13_CN
#define __PC14_CN
#define __PC15_CN
#define __PC0_CN
#define __PC1_CN
#define __PC2_CN
#define __PC3_CN
#define __PA0_CN
#define __PA1_CN
#define __PA2_CN
#define __PA3_CN
#define __PA4_CN
#define __PA5_CN
#define __PA6_CN
#define __PA7_CN
#define __PC4_CN
#define __PC5_CN
#define __PC6_CN
#define __PB0_CN
#define __PB1_CN
#define __PB2_CN
#define __PE7_CN
#define __PE8_CN
#define __PE9_CN
#define __PE10_CN
#define __PE11_CN
#define __PE12_CN
#define __PE13_CN
#define __PE14_CN
#define __PE15_CN
#define __PB10_CN
#define __PB11_CN
#define __PB12_CN
#define __PB13_CN
#define __PB14_CN
#define __PB15_CN
#define __PD8_CN
#define __PD9_CN
#define __PD10_CN
#define __PD11_CN
#define __PD12_CN
#define __PD13_CN
#define __PD14_CN
#define __PD15_CN
#define __PC7_CN
#define __PC8_CN
#define __PC9_CN
#define __PA8_CN
#define __PA9_CN
#define __PA10_CN
#define __PA11_CN
#define __PA12_CN
#define __PA13_CN
#define __PA14_CN
#define __PA15_CN
#define __PC10_CN
#define __PC11_CN
#define __PC12_CN
#define __PD0_CN
#define __PD1_CN
#define __PD2_CN
#define __PD3_CN
#define __PD4_CN
#define __PD5_CN
#define __PD6_CN
#define __PD7_CN
#define __PB3_CN
#define __PB4_CN
#define __PB5_CN
#define __PB6_CN
#define __PB7_CN
#define __PB8_CN
#define __PB9_CN
#define __PE0_CN
#define __PE1_CN
#define __PORT_E_CN
#define __PORT_C_CN
#define __PORT_A_CN
#define __PORT_B_CN
#define __PORT_D_CN
#define PORT_SIZE (16)
#define PORT_COUNT (5)
//EOF GPIO
//IVT_TABLE
#define ECLIC_VECTOR_NUMBER_UART1 (57)
#define ECLIC_VECTOR_ADDRESS_UART1 (0x000000E4)
#define ECLIC_VECTOR_NUMBER_UART2 (58)
#define ECLIC_VECTOR_ADDRESS_UART2 (0x000000E8)
#define ECLIC_VECTOR_NUMBER_UART0 (56)
#define ECLIC_VECTOR_ADDRESS_UART0 (0x000000E0)
#define ECLIC_VECTOR_NUMBER_UART3 (71)
#define ECLIC_VECTOR_ADDRESS_UART3 (0x0000011C)
#define ECLIC_VECTOR_NUMBER_UART4 (72)
#define ECLIC_VECTOR_ADDRESS_UART4 (0x00000120)
//EOF IVT_TABLE
#endif // _MCU_DEFINITIONS_H_
// ------------------------------------------------------------------------- END