-
Notifications
You must be signed in to change notification settings - Fork 38
/
hal_ll_can_pin_map.h
282 lines (270 loc) · 9.61 KB
/
hal_ll_can_pin_map.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
/****************************************************************************
**
** 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 hal_ll_can_pin_map.h
* @brief CAN HAL LOW LEVEL PIN MAPS.
*/
#ifndef _HAL_LL_CAN_PIN_MAP_H_
#define _HAL_LL_CAN_PIN_MAP_H_
#ifdef __cplusplus
extern "C"{
#endif
#include "hal_ll_pin_names.h"
/*!< @brief Helper macro for getting adequate module index number */
#define hal_ll_can_module_num(_module_num) (_module_num - 1)
/*!< @brief Macro defining `weak` attribute */
#define __weak __attribute__((weak))
/*!< @brief Pin structure */
typedef struct
{
uint8_t module_index;
hal_ll_pin_name_t pin;
hal_ll_base_addr_t base;
} hal_ll_can_pin_map_t;
/*!< @brief CAN RX pins */
static const hal_ll_can_pin_map_t hal_ll_can_rx_map[] =
{
//------------ BEGIN RX
#ifdef CAN1_RX_RE5
{hal_ll_can_module_num(CAN_MODULE_1), PE5, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RG7
{hal_ll_can_module_num(CAN_MODULE_1), PG7, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RB3
{hal_ll_can_module_num(CAN_MODULE_1), PB3, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RB1
{hal_ll_can_module_num(CAN_MODULE_1), PB1, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RF5
{hal_ll_can_module_num(CAN_MODULE_1), PF5, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RD11
{hal_ll_can_module_num(CAN_MODULE_1), PD11, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RC13
{hal_ll_can_module_num(CAN_MODULE_1), PC13, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RD3
{hal_ll_can_module_num(CAN_MODULE_1), PD3, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RF0
{hal_ll_can_module_num(CAN_MODULE_1), PF0, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RC4
{hal_ll_can_module_num(CAN_MODULE_1), PC4, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RD15
{hal_ll_can_module_num(CAN_MODULE_1), PD15, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RA15
{hal_ll_can_module_num(CAN_MODULE_1), PA15, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RG0
{hal_ll_can_module_num(CAN_MODULE_1), PG0, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RF5_ALT
{hal_ll_can_module_num(CAN_MODULE_1), PF5, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RF12_ALT
{hal_ll_can_module_num(CAN_MODULE_1), PF12, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RB14
{hal_ll_can_module_num(CAN_MODULE_2), PB14, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RC3_ALT
{hal_ll_can_module_num(CAN_MODULE_2), PC3, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RG0
{hal_ll_can_module_num(CAN_MODULE_2), PG0, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RG6
{hal_ll_can_module_num(CAN_MODULE_2), PG6, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RB0
{hal_ll_can_module_num(CAN_MODULE_2), PB0, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RB7
{hal_ll_can_module_num(CAN_MODULE_2), PB7, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RB8
{hal_ll_can_module_num(CAN_MODULE_2), PB8, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RB15
{hal_ll_can_module_num(CAN_MODULE_2), PB15, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RD9
{hal_ll_can_module_num(CAN_MODULE_2), PD9, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RD4
{hal_ll_can_module_num(CAN_MODULE_2), PD4, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RE3
{hal_ll_can_module_num(CAN_MODULE_2), PE3, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RC3
{hal_ll_can_module_num(CAN_MODULE_2), PC3, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RE9
{hal_ll_can_module_num(CAN_MODULE_2), PE9, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RF12
{hal_ll_can_module_num(CAN_MODULE_2), PF12, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RF8
{hal_ll_can_module_num(CAN_MODULE_2), PF8, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_RX_RD12
{hal_ll_can_module_num(CAN_MODULE_2), PD12, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN1_RX_RD7
{hal_ll_can_module_num(CAN_MODULE_1), PD7, HAL_LL_CAN1_BASE_ADDRESS},
#endif
{HAL_LL_MODULE_ERROR, HAL_LL_PIN_NC, HAL_LL_MODULE_ERROR}
//------------ END RX
};
/*!< @brief CAN TX pins */
static const hal_ll_can_pin_map_t hal_ll_can_tx_map[] =
{
//------------ BEGIN TX
#ifdef CAN1_TX_RG8
{hal_ll_can_module_num(CAN_MODULE_1), PG8, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RB5
{hal_ll_can_module_num(CAN_MODULE_1), PB5, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RB9
{hal_ll_can_module_num(CAN_MODULE_1), PB9, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RB10
{hal_ll_can_module_num(CAN_MODULE_1), PB10, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RF4
{hal_ll_can_module_num(CAN_MODULE_1), PF4, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RD10
{hal_ll_can_module_num(CAN_MODULE_1), PD10, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RC14
{hal_ll_can_module_num(CAN_MODULE_1), PC14, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RD2
{hal_ll_can_module_num(CAN_MODULE_1), PD2, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RF1
{hal_ll_can_module_num(CAN_MODULE_1), PF1, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RC1
{hal_ll_can_module_num(CAN_MODULE_1), PC1, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RD14
{hal_ll_can_module_num(CAN_MODULE_1), PD14, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RF2
{hal_ll_can_module_num(CAN_MODULE_1), PF2, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RA14
{hal_ll_can_module_num(CAN_MODULE_1), PA14, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RG1
{hal_ll_can_module_num(CAN_MODULE_1), PG1, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RF4_ALT
{hal_ll_can_module_num(CAN_MODULE_1), PF4, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RF13_ALT
{hal_ll_can_module_num(CAN_MODULE_1), PF13, HAL_LL_CAN1_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RB8
{hal_ll_can_module_num(CAN_MODULE_2), PB8, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RC2_ALT
{hal_ll_can_module_num(CAN_MODULE_2), PC2, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RG1
{hal_ll_can_module_num(CAN_MODULE_2), PG1, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RG9
{hal_ll_can_module_num(CAN_MODULE_2), PG9, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RB2
{hal_ll_can_module_num(CAN_MODULE_2), PB2, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RB6
{hal_ll_can_module_num(CAN_MODULE_2), PB6, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RB14
{hal_ll_can_module_num(CAN_MODULE_2), PB14, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RF3
{hal_ll_can_module_num(CAN_MODULE_2), PF3, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RD0
{hal_ll_can_module_num(CAN_MODULE_2), PD0, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RD1
{hal_ll_can_module_num(CAN_MODULE_2), PD1, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RD5
{hal_ll_can_module_num(CAN_MODULE_2), PD5, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RC2
{hal_ll_can_module_num(CAN_MODULE_2), PC2, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RE8
{hal_ll_can_module_num(CAN_MODULE_2), PE8, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RF13
{hal_ll_can_module_num(CAN_MODULE_2), PF13, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN2_TX_RF2
{hal_ll_can_module_num(CAN_MODULE_2), PF2, HAL_LL_CAN2_BASE_ADDRESS},
#endif
#ifdef CAN1_TX_RD6
{hal_ll_can_module_num(CAN_MODULE_1), PD6, HAL_LL_CAN1_BASE_ADDRESS},
#endif
{HAL_LL_MODULE_ERROR, HAL_LL_PIN_NC, HAL_LL_MODULE_ERROR}
//------------ END TX
};
#ifdef __cplusplus
}
#endif
#endif // _HAL_LL_CAN_PIN_MAP_H_
// ------------------------------------------------------------------------- END