aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso812max/project_template/pin_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso812max/project_template/pin_mux.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso812max/project_template/pin_mux.c311
1 files changed, 311 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso812max/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso812max/project_template/pin_mux.c
new file mode 100644
index 000000000..ef9d1a469
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso812max/project_template/pin_mux.c
@@ -0,0 +1,311 @@
1/*
2 * Copyright 2018 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12
13/* clang-format off */
14/*
15 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
16!!GlobalInfo
17product: Pins v4.1
18processor: LPC812
19package_id: LPC812M101JDH20
20mcu_data: ksdk2_0
21processor_version: 4.0.1
22board: LPCXpresso812
23pin_labels:
24- {pin_num: '10', pin_signal: PIO0_16, label: 'P1[14]/J1[9]/P2[44]/D1[3]/PIO0_16-BLUE', identifier: LED_BLUE}
25- {pin_num: '1', pin_signal: PIO0_17, label: 'P1[12]/J1[10]/P2[43]/D1[4]/PIO0_17-GREEN', identifier: LED_GREEN}
26- {pin_num: '17', pin_signal: PIO0_7, label: 'P1[13]/J2[1]/P2[45]/D1[1]/PIO0_7-RED', identifier: LED_RED}
27- {pin_num: '18', pin_signal: PIO0_6/VDDCMP, label: 'P2[13]/J2[6]/TARGET_TX-PIO0_6', identifier: DEBUG_UART_TX}
28- {pin_num: '12', pin_signal: PIO0_1/ACMP_I2/CLKIN, label: 'U4[13]/TARGET_RX-PIO0_1', identifier: DEBUG_UART_RX}
29- {pin_num: '6', pin_signal: SWCLK/PIO0_3, label: 'P3[4]/P2[24]/U2[16]/TARGET_SWCLK-PIO0_3', identifier: DEBUG_SWD_SWCLK}
30- {pin_num: '7', pin_signal: SWDIO/PIO0_2, label: 'P3[2]/P2[19]/U2[17]/TARGET_SWDIO-PIO0_2', identifier: DEBUG_SWD_SWDIO}
31- {pin_num: '4', pin_signal: RESETN/PIO0_5, label: 'P3[10]/U4[3]/J8[3]/P2[4]/U2[3]/SW1[1]/TARGET_nRESET-PIO0_5', identifier: DEBUG_SWD_RESETN}
32- {pin_num: '2', pin_signal: PIO0_13, label: 'P1[6]/J1[8]/P2[8]/PIO0_13'}
33- {pin_num: '3', pin_signal: PIO0_12, label: 'P1[3]/J1[5]/P2[7]/PIO0_12'}
34- {pin_num: '5', pin_signal: PIO0_4, label: 'P1[8]/J2[7]/P2[9]/PIO0_4'}
35- {pin_num: '8', pin_signal: PIO0_11, label: 'U6[10]/U4[14]/P1[9]/J9[6]/J1[1]/P2[41]/PIO0_11-SCL'}
36- {pin_num: '9', pin_signal: PIO0_10, label: 'U6[9]/U4[15]/P1[10]/J9[5]/J1[2]/P2[40]/PIO0_10-SDA'}
37- {pin_num: '11', pin_signal: PIO0_15, label: 'P1[5]/J1[6]/P2[6]/PIO0_15'}
38- {pin_num: '13', pin_signal: PIO0_9/XTALOUT, label: 'P1[11]/J2[4]/P2[14]/U2[26]/PIO0_9-XTALOUT'}
39- {pin_num: '14', pin_signal: PIO0_8/XTALIN, label: 'J2[5]/P2[42]/U2[27]/PIO0_8-XTALIN'}
40- {pin_num: '19', pin_signal: PIO0_0/ACMP_I1, label: 'P1[7]/J2[8]/P2[10]/PIO0_0'}
41- {pin_num: '20', pin_signal: PIO0_14, label: 'P1[4]/J1[7]/P2[5]/PIO0_14'}
42- {pin_num: '15', pin_signal: VDD, label: C8/C9/FB2/VDD}
43- {pin_num: '16', pin_signal: VSS, label: GND}
44 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
45 */
46/* clang-format on */
47
48#include "fsl_common.h"
49#include "fsl_iocon.h"
50#include "fsl_swm.h"
51#include "pin_mux.h"
52
53/* FUNCTION ************************************************************************************************************
54 *
55 * Function Name : BOARD_InitBootPins
56 * Description : Calls initialization functions.
57 *
58 * END ****************************************************************************************************************/
59void BOARD_InitBootPins(void)
60{
61 BOARD_InitPins();
62 BOARD_InitDEBUG_UARTPins();
63}
64
65/* clang-format off */
66/*
67 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
68BOARD_InitPins:
69- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
70- pin_list: []
71 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
72 */
73/* clang-format on */
74
75/* FUNCTION ************************************************************************************************************
76 *
77 * Function Name : BOARD_InitPins
78 * Description : Configures pin routing and optionally pin electrical features.
79 *
80 * END ****************************************************************************************************************/
81/* Function assigned for the Cortex-M0P */
82void BOARD_InitPins(void)
83{
84}
85
86/* clang-format off */
87/*
88 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
89BOARD_InitLEDsPins:
90- options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
91- pin_list:
92 - {pin_num: '10', peripheral: GPIO, signal: 'PIO0, 16', pin_signal: PIO0_16, direction: OUTPUT, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled,
93 smode: bypass, clkdiv: div0}
94 - {pin_num: '1', peripheral: GPIO, signal: 'PIO0, 17', pin_signal: PIO0_17, direction: OUTPUT, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled,
95 smode: bypass, clkdiv: div0}
96 - {pin_num: '17', peripheral: GPIO, signal: 'PIO0, 7', pin_signal: PIO0_7, direction: OUTPUT, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled,
97 smode: bypass, clkdiv: div0}
98 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
99 */
100/* clang-format on */
101
102/* FUNCTION ************************************************************************************************************
103 *
104 * Function Name : BOARD_InitLEDsPins
105 * Description : Configures pin routing and optionally pin electrical features.
106 *
107 * END ****************************************************************************************************************/
108/* Function assigned for the Cortex-M0P */
109void BOARD_InitLEDsPins(void)
110{
111
112 const uint32_t pio0_config = (/* Selects pull-up function */
113 IOCON_PIO_MODE_PULLUP |
114 /* Disable hysteresis */
115 IOCON_PIO_HYS_DI |
116 /* Input not invert */
117 IOCON_PIO_INV_DI |
118 /* Disables Open-drain function */
119 IOCON_PIO_OD_DI |
120 /* Bypass input filter */
121 IOCON_PIO_SMODE_BYPASS |
122 /* IOCONCLKDIV0 */
123 IOCON_PIO_CLKDIV0);
124 /* PORT0 PIN (coords: ) is configured as */
125 IOCON_PinMuxSet(IOCON, 0, pio0_config);
126
127 const uint32_t pio15_config = (/* Selects pull-up function */
128 IOCON_PIO_MODE_PULLUP |
129 /* Disable hysteresis */
130 IOCON_PIO_HYS_DI |
131 /* Input not invert */
132 IOCON_PIO_INV_DI |
133 /* Disables Open-drain function */
134 IOCON_PIO_OD_DI |
135 /* Bypass input filter */
136 IOCON_PIO_SMODE_BYPASS |
137 /* IOCONCLKDIV0 */
138 IOCON_PIO_CLKDIV0);
139 /* PORT1 PIN5 (coords: ) is configured as */
140 IOCON_PinMuxSet(IOCON, 15, pio15_config);
141
142 const uint32_t pio9_config = (/* Selects pull-up function */
143 IOCON_PIO_MODE_PULLUP |
144 /* Disable hysteresis */
145 IOCON_PIO_HYS_DI |
146 /* Input not invert */
147 IOCON_PIO_INV_DI |
148 /* Disables Open-drain function */
149 IOCON_PIO_OD_DI |
150 /* Bypass input filter */
151 IOCON_PIO_SMODE_BYPASS |
152 /* IOCONCLKDIV0 */
153 IOCON_PIO_CLKDIV0);
154 /* PORT9 PIN (coords: ) is configured as */
155 IOCON_PinMuxSet(IOCON, 9, pio9_config);
156}
157
158/* clang-format off */
159/*
160 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
161BOARD_InitDEBUG_UARTPins:
162- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
163- pin_list:
164 - {pin_num: '18', peripheral: USART0, signal: TXD, pin_signal: PIO0_6/VDDCMP, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled, smode: bypass,
165 clkdiv: div0}
166 - {pin_num: '12', peripheral: USART0, signal: RXD, pin_signal: PIO0_1/ACMP_I2/CLKIN, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled,
167 smode: bypass, clkdiv: div0}
168 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
169 */
170/* clang-format on */
171
172/* FUNCTION ************************************************************************************************************
173 *
174 * Function Name : BOARD_InitDEBUG_UARTPins
175 * Description : Configures pin routing and optionally pin electrical features.
176 *
177 * END ****************************************************************************************************************/
178/* Function assigned for the Cortex-M0P */
179void BOARD_InitDEBUG_UARTPins(void)
180{
181 /* Enables clock for switch matrix.: 0x01u */
182 CLOCK_EnableClock(kCLOCK_Swm);
183
184 const uint32_t pio11_config = (/* Selects pull-up function */
185 IOCON_PIO_MODE_PULLUP |
186 /* Disable hysteresis */
187 IOCON_PIO_HYS_DI |
188 /* Input not invert */
189 IOCON_PIO_INV_DI |
190 /* Disables Open-drain function */
191 IOCON_PIO_OD_DI |
192 /* Bypass input filter */
193 IOCON_PIO_SMODE_BYPASS |
194 /* IOCONCLKDIV0 */
195 IOCON_PIO_CLKDIV0);
196 /* PORT1 PIN1 (coords: ) is configured as */
197 IOCON_PinMuxSet(IOCON, 11, pio11_config);
198
199 const uint32_t pio16_config = (/* Selects pull-up function */
200 IOCON_PIO_MODE_PULLUP |
201 /* Disable hysteresis */
202 IOCON_PIO_HYS_DI |
203 /* Input not invert */
204 IOCON_PIO_INV_DI |
205 /* Disables Open-drain function */
206 IOCON_PIO_OD_DI |
207 /* Bypass input filter */
208 IOCON_PIO_SMODE_BYPASS |
209 /* IOCONCLKDIV0 */
210 IOCON_PIO_CLKDIV0);
211 /* PORT1 PIN6 (coords: ) is configured as */
212 IOCON_PinMuxSet(IOCON, 16, pio16_config);
213
214 /* USART0_TXD connect to P0_6 */
215 SWM_SetMovablePinSelect(SWM0, kSWM_USART0_TXD, kSWM_PortPin_P0_6);
216
217 /* USART0_RXD connect to P0_1 */
218 SWM_SetMovablePinSelect(SWM0, kSWM_USART0_RXD, kSWM_PortPin_P0_1);
219
220 /* Disable clock for switch matrix. */
221 CLOCK_DisableClock(kCLOCK_Swm);
222}
223
224/* clang-format off */
225/*
226 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
227BOARD_InitSWD_DEBUGPins:
228- options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
229- pin_list:
230 - {pin_num: '6', peripheral: SWD, signal: SWCLK, pin_signal: SWCLK/PIO0_3, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled, smode: bypass,
231 clkdiv: div0}
232 - {pin_num: '7', peripheral: SWD, signal: SWDIO, pin_signal: SWDIO/PIO0_2, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled, smode: bypass,
233 clkdiv: div0}
234 - {pin_num: '4', peripheral: SYSCON, signal: RESETN, pin_signal: RESETN/PIO0_5, mode: pullUp, invert: disabled, hysteresis: disabled, opendrain: disabled, smode: bypass,
235 clkdiv: div0}
236 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
237 */
238/* clang-format on */
239
240/* FUNCTION ************************************************************************************************************
241 *
242 * Function Name : BOARD_InitSWD_DEBUGPins
243 * Description : Configures pin routing and optionally pin electrical features.
244 *
245 * END ****************************************************************************************************************/
246/* Function assigned for the Cortex-M0P */
247void BOARD_InitSWD_DEBUGPins(void)
248{
249 /* Enables clock for switch matrix.: 0x01u */
250 CLOCK_EnableClock(kCLOCK_Swm);
251
252 const uint32_t pio3_config = (/* Selects pull-up function */
253 IOCON_PIO_MODE_PULLUP |
254 /* Disable hysteresis */
255 IOCON_PIO_HYS_DI |
256 /* Input not invert */
257 IOCON_PIO_INV_DI |
258 /* Disables Open-drain function */
259 IOCON_PIO_OD_DI |
260 /* Bypass input filter */
261 IOCON_PIO_SMODE_BYPASS |
262 /* IOCONCLKDIV0 */
263 IOCON_PIO_CLKDIV0);
264 /* PORT3 PIN (coords: ) is configured as */
265 IOCON_PinMuxSet(IOCON, 3, pio3_config);
266
267 const uint32_t pio5_config = (/* Selects pull-up function */
268 IOCON_PIO_MODE_PULLUP |
269 /* Disable hysteresis */
270 IOCON_PIO_HYS_DI |
271 /* Input not invert */
272 IOCON_PIO_INV_DI |
273 /* Disables Open-drain function */
274 IOCON_PIO_OD_DI |
275 /* Bypass input filter */
276 IOCON_PIO_SMODE_BYPASS |
277 /* IOCONCLKDIV0 */
278 IOCON_PIO_CLKDIV0);
279 /* PORT5 PIN (coords: ) is configured as */
280 IOCON_PinMuxSet(IOCON, 5, pio5_config);
281
282 const uint32_t pio6_config = (/* Selects pull-up function */
283 IOCON_PIO_MODE_PULLUP |
284 /* Disable hysteresis */
285 IOCON_PIO_HYS_DI |
286 /* Input not invert */
287 IOCON_PIO_INV_DI |
288 /* Disables Open-drain function */
289 IOCON_PIO_OD_DI |
290 /* Bypass input filter */
291 IOCON_PIO_SMODE_BYPASS |
292 /* IOCONCLKDIV0 */
293 IOCON_PIO_CLKDIV0);
294 /* PORT6 PIN (coords: ) is configured as */
295 IOCON_PinMuxSet(IOCON, 6, pio6_config);
296
297 /* SWCLK connect to P0_3 */
298 SWM_SetFixedPinSelect(SWM0, kSWM_SWCLK, true);
299
300 /* SWDIO connect to P0_2 */
301 SWM_SetFixedPinSelect(SWM0, kSWM_SWDIO, true);
302
303 /* RESETN connect to P0_5 */
304 SWM_SetFixedPinSelect(SWM0, kSWM_RESETN, true);
305
306 /* Disable clock for switch matrix. */
307 CLOCK_DisableClock(kCLOCK_Swm);
308}
309/***********************************************************************************************************************
310 * EOF
311 **********************************************************************************************************************/