diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso845max/project_template/pin_mux.c')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso845max/project_template/pin_mux.c | 421 |
1 files changed, 421 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso845max/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso845max/project_template/pin_mux.c new file mode 100644 index 000000000..0a5bee4f9 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/boards/lpcxpresso845max/project_template/pin_mux.c | |||
@@ -0,0 +1,421 @@ | |||
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 | ||
17 | product: Pins v4.1 | ||
18 | processor: LPC845 | ||
19 | package_id: LPC845M301JBD64 | ||
20 | mcu_data: ksdk2_0 | ||
21 | processor_version: 4.0.1 | ||
22 | board: LPCXpresso845 | ||
23 | pin_labels: | ||
24 | - {pin_num: '48', pin_signal: PIO0_0/ACMP_I1, label: D1/P0_0-GREEN, identifier: LED_GREEN} | ||
25 | - {pin_num: '24', pin_signal: PIO1_15, label: 'D2/P3[44]/P1_15-BLUE', identifier: LED_BLUE} | ||
26 | - {pin_num: '4', pin_signal: PIO0_12, label: 'D3/P3[45]/SW1/P0_12-RED-ISP', identifier: LED_RED;SW1} | ||
27 | - {pin_num: '37', pin_signal: PIO1_17, label: 'P3[13]/P6[1]/U4[31]/TARGET_TX_DEBUG_P1_17', identifier: DEBUG_UART_TX} | ||
28 | - {pin_num: '36', pin_signal: PIO1_16, label: 'P7[1]/U4[32]/TARGET_RX_DEBUG_P1_16', identifier: DEBUG_UART_RX} | ||
29 | - {pin_num: '14', pin_signal: SWDIO/PIO0_2, label: 'U4[17]/P4[2]/TARGET_SWDIO', identifier: DEBUG_SWD_SWDIO} | ||
30 | - {pin_num: '12', pin_signal: SWCLK/PIO0_3, label: 'U4[16]/P4[4]/TARGET_SWCLK', identifier: DEBUG_SWD_SWCLK} | ||
31 | - {pin_num: '5', pin_signal: RESETN/PIO0_5, label: 'P3[4]/J5[3]/U4[8]/P4[10]/SW3[1]/TARGET_nRESET-P0_5', identifier: DEBUG_SWD_RESETN} | ||
32 | - {pin_num: '6', pin_signal: PIO0_4/ADC_11, label: 'P3[50]/SW2/P0_4-WAKEUP', identifier: SW2} | ||
33 | - {pin_num: '1', pin_signal: PIO1_8/CAPT_YL, label: 'SJ13/P3[24]/P1_8-CAPT_Y_LOW'} | ||
34 | - {pin_num: '2', pin_signal: PIO0_13/ADC_10, label: 'J3[8]/P0_13'} | ||
35 | - {pin_num: '3', pin_signal: PIO1_9/CAPT_YH, label: 'U3[54]/C19/P3[27]/CAPT_Y_HIGH'} | ||
36 | - {pin_num: '9', pin_signal: PIO1_12, label: 'J3[9]/P1_12-I2C_SCL1'} | ||
37 | - {pin_num: '10', pin_signal: PIO0_28, label: 'J2[2]/P0_28'} | ||
38 | - {pin_num: '11', pin_signal: PIO1_13, label: 'J3[10]/P1_13-I2C_SDA1'} | ||
39 | - {pin_num: '13', pin_signal: PIO0_31/CAPT_X0, label: 'P3[53]/P0_31-CAPT_X0'} | ||
40 | - {pin_num: '15', pin_signal: PIO1_0/CAPT_X1, label: 'P3[52]/P1_0-CAPT_X1'} | ||
41 | - {pin_num: '16', pin_signal: PIO0_11/I2C0_SDA, label: 'P3[40]/J1[2]/P0_11-I2C0_SDA'} | ||
42 | - {pin_num: '17', pin_signal: PIO0_10/I2C0_SCL, label: 'P3[41]/J1[1]/P0_10-I2C0_SCL'} | ||
43 | - {pin_num: '18', pin_signal: PIO1_1/CAPT_X2, label: 'P3[51]/P1_1-CAPT_X2'} | ||
44 | - {pin_num: '19', pin_signal: PIO0_16, label: 'J1[10]/P0_16'} | ||
45 | - {pin_num: '20', pin_signal: PIO1_2/CAPT_X3, label: 'P3[46]/P1_2'} | ||
46 | - {pin_num: '21', pin_signal: PIO0_27, label: 'J3[2]/P0_27-SPI_MOSI'} | ||
47 | - {pin_num: '22', pin_signal: PIO1_14, label: 'J1[9]/P1_14'} | ||
48 | - {pin_num: '23', pin_signal: PIO0_26, label: 'J3[3]/P0_26-SPI_MISO'} | ||
49 | - {pin_num: '27', pin_signal: PIO0_25, label: 'J2[7]/P3[48]/P0_25-ISP_U_TXD'} | ||
50 | - {pin_num: '28', pin_signal: PIO0_24, label: 'J2[8]/P3[49]/P0_24-ISP_U_RXD'} | ||
51 | - {pin_num: '29', pin_signal: PIO1_3/CAPT_X4, label: 'P3[39]/P1_3'} | ||
52 | - {pin_num: '30', pin_signal: PIO0_15, label: 'J3[4]/P0_15-SPI_SCK'} | ||
53 | - {pin_num: '31', pin_signal: PIO1_4/CAPT_X5, label: 'P3[38]/P1_4'} | ||
54 | - {pin_num: '32', pin_signal: PIO0_1/ACMP_I2/CLKIN, label: 'P3[43]/J2[1]/P0_1-CLKIN'} | ||
55 | - {pin_num: '33', pin_signal: PIO0_9/XTALOUT, label: 'P3[11]/U4[26]/P0_9-LINK_nWAKE'} | ||
56 | - {pin_num: '34', pin_signal: PIO0_8/XTALIN, label: 'P3[12]/U4[27]/P0_8-LINK_nSLEEP'} | ||
57 | - {pin_num: '35', pin_signal: PIO1_5/CAPT_X6, label: 'P3[8]/P1_5'} | ||
58 | - {pin_num: '38', pin_signal: PIO1_6/CAPT_X7, label: 'P3[9]/P1_6'} | ||
59 | - {pin_num: '43', pin_signal: PIO1_18, label: 'P3[42]/J1[8]/P1_18-SPI1_SSEL0'} | ||
60 | - {pin_num: '44', pin_signal: PIO1_19, label: 'P3[5]/J1[7]/P1_19-SPI1_MOSI'} | ||
61 | - {pin_num: '45', pin_signal: PIO0_7/ADC_0, label: 'P3[6]/J1[6]/P0_7-SPI1_MISO'} | ||
62 | - {pin_num: '46', pin_signal: PIO0_6/ADC_1/ACMPVREF, label: 'P3[7]/J1[5]/P0_6-SPI1_SCK'} | ||
63 | - {pin_num: '47', pin_signal: PIO1_7/CAPT_X8, label: 'P3[10]/P1_7'} | ||
64 | - {pin_num: '49', pin_signal: PIO0_14/ACMP_I3/ADC_2, label: 'P3[15]/J6[1]/P0_14-ADC2-ACMP3'} | ||
65 | - {pin_num: '50', pin_signal: PIO0_29/DACOUT_1, label: 'U1[3]/P0_29-DACOUT1'} | ||
66 | - {pin_num: '51', pin_signal: PIO0_23/ADC_3/ACMP_I4, label: 'P3[16]/J6[2]/P0_23-ADC3-ACMP4'} | ||
67 | - {pin_num: '54', pin_signal: PIO0_30/ACMP_I5, label: 'SJ14/P3[27]/U3[3]/CAPT_Y_HIGH'} | ||
68 | - {pin_num: '55', pin_signal: PIO0_22/ADC_4, label: 'J3[1]/P0_22-SPI_SSEL'} | ||
69 | - {pin_num: '56', pin_signal: PIO1_20, label: 'J2[3]/P1_20'} | ||
70 | - {pin_num: '57', pin_signal: PIO0_21/ADC_5, label: 'J2[6]/P0_21'} | ||
71 | - {pin_num: '58', pin_signal: PIO0_20/ADC_6, label: 'J2[5]/P0_20'} | ||
72 | - {pin_num: '59', pin_signal: PIO1_21, label: 'J2[4]/P1_21'} | ||
73 | - {pin_num: '60', pin_signal: PIO0_19/ADC_7, label: 'P3[17]/J6[3]/P0_19-ADC7'} | ||
74 | - {pin_num: '61', pin_signal: PIO0_18/ADC_8, label: 'P3[19]/J6[4]/P0_18-ADC8'} | ||
75 | - {pin_num: '62', pin_signal: PIO1_11, label: 'U1[7]/P3[21]/P1_11'} | ||
76 | - {pin_num: '63', pin_signal: PIO0_17/ADC_9/DACOUT_0, label: 'P3[20]/J6[5]/P0_17-ADC9-DACOUT0'} | ||
77 | - {pin_num: '64', pin_signal: PIO1_10, label: 'J3[7]/P1_10'} | ||
78 | - {pin_num: '7', pin_signal: VDD7, label: 'JP2[1]/VDD'} | ||
79 | - {pin_num: '26', pin_signal: VDD26, label: 'JP2[1]/C10/C11/C2/VDD'} | ||
80 | - {pin_num: '39', pin_signal: VDD39, label: 'JP2[1]/C10/C11/C2/VDD'} | ||
81 | - {pin_num: '52', pin_signal: VDDA, label: C17/FB6/VDDA} | ||
82 | - {pin_num: '53', pin_signal: VSSA, label: GND} | ||
83 | - {pin_num: '40', pin_signal: VSS40, label: GND} | ||
84 | - {pin_num: '25', pin_signal: VSS25, label: GND} | ||
85 | - {pin_num: '8', pin_signal: VSS8, label: GND} | ||
86 | - {pin_num: '41', pin_signal: VREFN, label: C14/C25/VREFN} | ||
87 | - {pin_num: '42', pin_signal: VREFP, label: C14/C25/FB3/VREFP} | ||
88 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
89 | */ | ||
90 | /* clang-format on */ | ||
91 | |||
92 | #include "fsl_common.h" | ||
93 | #include "fsl_iocon.h" | ||
94 | #include "fsl_swm.h" | ||
95 | #include "pin_mux.h" | ||
96 | |||
97 | /* FUNCTION ************************************************************************************************************ | ||
98 | * | ||
99 | * Function Name : BOARD_InitBootPins | ||
100 | * Description : Calls initialization functions. | ||
101 | * | ||
102 | * END ****************************************************************************************************************/ | ||
103 | void BOARD_InitBootPins(void) | ||
104 | { | ||
105 | BOARD_InitPins(); | ||
106 | BOARD_InitDEBUG_UARTPins(); | ||
107 | } | ||
108 | |||
109 | /* clang-format off */ | ||
110 | /* | ||
111 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
112 | BOARD_InitPins: | ||
113 | - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'} | ||
114 | - pin_list: [] | ||
115 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
116 | */ | ||
117 | /* clang-format on */ | ||
118 | |||
119 | /* FUNCTION ************************************************************************************************************ | ||
120 | * | ||
121 | * Function Name : BOARD_InitPins | ||
122 | * Description : Configures pin routing and optionally pin electrical features. | ||
123 | * | ||
124 | * END ****************************************************************************************************************/ | ||
125 | /* Function assigned for the Cortex-M0P */ | ||
126 | void BOARD_InitPins(void) | ||
127 | { | ||
128 | } | ||
129 | |||
130 | /* clang-format off */ | ||
131 | /* | ||
132 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
133 | BOARD_InitLEDsPins: | ||
134 | - options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'} | ||
135 | - pin_list: | ||
136 | - {pin_num: '48', peripheral: GPIO, signal: 'PIO0, 0', pin_signal: PIO0_0/ACMP_I1, direction: OUTPUT, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, | ||
137 | smode: bypass, clkdiv: div0} | ||
138 | - {pin_num: '24', peripheral: GPIO, signal: 'PIO1, 15', pin_signal: PIO1_15, direction: OUTPUT, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, | ||
139 | smode: bypass, clkdiv: div0} | ||
140 | - {pin_num: '4', peripheral: GPIO, signal: 'PIO0, 12', pin_signal: PIO0_12, identifier: LED_RED, direction: OUTPUT, mode: pullUp, invert: disabled, hysteresis: enabled, | ||
141 | opendrain: enabled, smode: bypass, clkdiv: div0} | ||
142 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
143 | */ | ||
144 | /* clang-format on */ | ||
145 | |||
146 | /* FUNCTION ************************************************************************************************************ | ||
147 | * | ||
148 | * Function Name : BOARD_InitLEDsPins | ||
149 | * Description : Configures pin routing and optionally pin electrical features. | ||
150 | * | ||
151 | * END ****************************************************************************************************************/ | ||
152 | /* Function assigned for the Cortex-M0P */ | ||
153 | void BOARD_InitLEDsPins(void) | ||
154 | { | ||
155 | /* Enables clock for IOCON.: enable */ | ||
156 | CLOCK_EnableClock(kCLOCK_Iocon); | ||
157 | |||
158 | const uint32_t pio17_config = (/* Selects pull-up function */ | ||
159 | IOCON_PIO_MODE_PULLUP | | ||
160 | /* Enable hysteresis */ | ||
161 | IOCON_PIO_HYS_EN | | ||
162 | /* Input not invert */ | ||
163 | IOCON_PIO_INV_DI | | ||
164 | /* Disables Open-drain function */ | ||
165 | IOCON_PIO_OD_DI | | ||
166 | /* Bypass input filter */ | ||
167 | IOCON_PIO_SMODE_BYPASS | | ||
168 | /* IOCONCLKDIV0 */ | ||
169 | IOCON_PIO_CLKDIV0); | ||
170 | /* PORT1 PIN7 (coords: ) is configured as */ | ||
171 | IOCON_PinMuxSet(IOCON, 17, pio17_config); | ||
172 | |||
173 | const uint32_t pio2_config = (/* Selects pull-up function */ | ||
174 | IOCON_PIO_MODE_PULLUP | | ||
175 | /* Enable hysteresis */ | ||
176 | IOCON_PIO_HYS_EN | | ||
177 | /* Input not invert */ | ||
178 | IOCON_PIO_INV_DI | | ||
179 | /* Enables Open-drain function */ | ||
180 | IOCON_PIO_OD_EN | | ||
181 | /* Bypass input filter */ | ||
182 | IOCON_PIO_SMODE_BYPASS | | ||
183 | /* IOCONCLKDIV0 */ | ||
184 | IOCON_PIO_CLKDIV0); | ||
185 | /* PORT2 PIN (coords: ) is configured as */ | ||
186 | IOCON_PinMuxSet(IOCON, 2, pio2_config); | ||
187 | |||
188 | const uint32_t pio40_config = (/* Selects pull-up function */ | ||
189 | IOCON_PIO_MODE_PULLUP | | ||
190 | /* Enable hysteresis */ | ||
191 | IOCON_PIO_HYS_EN | | ||
192 | /* Input not invert */ | ||
193 | IOCON_PIO_INV_DI | | ||
194 | /* Disables Open-drain function */ | ||
195 | IOCON_PIO_OD_DI | | ||
196 | /* Bypass input filter */ | ||
197 | IOCON_PIO_SMODE_BYPASS | | ||
198 | /* IOCONCLKDIV0 */ | ||
199 | IOCON_PIO_CLKDIV0); | ||
200 | /* PORT4 PIN0 (coords: ) is configured as */ | ||
201 | IOCON_PinMuxSet(IOCON, 40, pio40_config); | ||
202 | } | ||
203 | |||
204 | /* clang-format off */ | ||
205 | /* | ||
206 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
207 | BOARD_InitDEBUG_UARTPins: | ||
208 | - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'} | ||
209 | - pin_list: | ||
210 | - {pin_num: '37', peripheral: USART0, signal: TXD, pin_signal: PIO1_17, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, smode: bypass, | ||
211 | clkdiv: div0} | ||
212 | - {pin_num: '36', peripheral: USART0, signal: RXD, pin_signal: PIO1_16, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, smode: bypass, | ||
213 | clkdiv: div0} | ||
214 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
215 | */ | ||
216 | /* clang-format on */ | ||
217 | |||
218 | /* FUNCTION ************************************************************************************************************ | ||
219 | * | ||
220 | * Function Name : BOARD_InitDEBUG_UARTPins | ||
221 | * Description : Configures pin routing and optionally pin electrical features. | ||
222 | * | ||
223 | * END ****************************************************************************************************************/ | ||
224 | /* Function assigned for the Cortex-M0P */ | ||
225 | void BOARD_InitDEBUG_UARTPins(void) | ||
226 | { | ||
227 | /* Enables clock for IOCON.: enable */ | ||
228 | CLOCK_EnableClock(kCLOCK_Iocon); | ||
229 | /* Enables clock for switch matrix.: enable */ | ||
230 | CLOCK_EnableClock(kCLOCK_Swm); | ||
231 | |||
232 | const uint32_t pio44_config = (/* Selects pull-up function */ | ||
233 | IOCON_PIO_MODE_PULLUP | | ||
234 | /* Enable hysteresis */ | ||
235 | IOCON_PIO_HYS_EN | | ||
236 | /* Input not invert */ | ||
237 | IOCON_PIO_INV_DI | | ||
238 | /* Disables Open-drain function */ | ||
239 | IOCON_PIO_OD_DI | | ||
240 | /* Bypass input filter */ | ||
241 | IOCON_PIO_SMODE_BYPASS | | ||
242 | /* IOCONCLKDIV0 */ | ||
243 | IOCON_PIO_CLKDIV0); | ||
244 | /* PORT4 PIN4 (coords: ) is configured as */ | ||
245 | IOCON_PinMuxSet(IOCON, 44, pio44_config); | ||
246 | |||
247 | const uint32_t pio45_config = (/* Selects pull-up function */ | ||
248 | IOCON_PIO_MODE_PULLUP | | ||
249 | /* Enable hysteresis */ | ||
250 | IOCON_PIO_HYS_EN | | ||
251 | /* Input not invert */ | ||
252 | IOCON_PIO_INV_DI | | ||
253 | /* Disables Open-drain function */ | ||
254 | IOCON_PIO_OD_DI | | ||
255 | /* Bypass input filter */ | ||
256 | IOCON_PIO_SMODE_BYPASS | | ||
257 | /* IOCONCLKDIV0 */ | ||
258 | IOCON_PIO_CLKDIV0); | ||
259 | /* PORT4 PIN5 (coords: ) is configured as */ | ||
260 | IOCON_PinMuxSet(IOCON, 45, pio45_config); | ||
261 | |||
262 | /* USART0_TXD connect to P1_17 */ | ||
263 | SWM_SetMovablePinSelect(SWM0, kSWM_USART0_TXD, kSWM_PortPin_P1_17); | ||
264 | |||
265 | /* USART0_RXD connect to P1_16 */ | ||
266 | SWM_SetMovablePinSelect(SWM0, kSWM_USART0_RXD, kSWM_PortPin_P1_16); | ||
267 | |||
268 | /* Disable clock for switch matrix. */ | ||
269 | CLOCK_DisableClock(kCLOCK_Swm); | ||
270 | } | ||
271 | |||
272 | /* clang-format off */ | ||
273 | /* | ||
274 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
275 | BOARD_InitSWD_DEBUGPins: | ||
276 | - options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'} | ||
277 | - pin_list: | ||
278 | - {pin_num: '12', peripheral: SWD, signal: SWCLK, pin_signal: SWCLK/PIO0_3, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, smode: bypass, | ||
279 | clkdiv: div0} | ||
280 | - {pin_num: '14', peripheral: SWD, signal: SWDIO, pin_signal: SWDIO/PIO0_2, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, smode: bypass, | ||
281 | clkdiv: div0} | ||
282 | - {pin_num: '5', peripheral: SYSCON, signal: RESETN, pin_signal: RESETN/PIO0_5, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, smode: bypass, | ||
283 | clkdiv: div0} | ||
284 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
285 | */ | ||
286 | /* clang-format on */ | ||
287 | |||
288 | /* FUNCTION ************************************************************************************************************ | ||
289 | * | ||
290 | * Function Name : BOARD_InitSWD_DEBUGPins | ||
291 | * Description : Configures pin routing and optionally pin electrical features. | ||
292 | * | ||
293 | * END ****************************************************************************************************************/ | ||
294 | /* Function assigned for the Cortex-M0P */ | ||
295 | void BOARD_InitSWD_DEBUGPins(void) | ||
296 | { | ||
297 | /* Enables clock for IOCON.: enable */ | ||
298 | CLOCK_EnableClock(kCLOCK_Iocon); | ||
299 | /* Enables clock for switch matrix.: enable */ | ||
300 | CLOCK_EnableClock(kCLOCK_Swm); | ||
301 | |||
302 | const uint32_t pio3_config = (/* Selects pull-up function */ | ||
303 | IOCON_PIO_MODE_PULLUP | | ||
304 | /* Enable hysteresis */ | ||
305 | IOCON_PIO_HYS_EN | | ||
306 | /* Input not invert */ | ||
307 | IOCON_PIO_INV_DI | | ||
308 | /* Disables Open-drain function */ | ||
309 | IOCON_PIO_OD_DI | | ||
310 | /* Bypass input filter */ | ||
311 | IOCON_PIO_SMODE_BYPASS | | ||
312 | /* IOCONCLKDIV0 */ | ||
313 | IOCON_PIO_CLKDIV0); | ||
314 | /* PORT3 PIN (coords: ) is configured as */ | ||
315 | IOCON_PinMuxSet(IOCON, 3, pio3_config); | ||
316 | |||
317 | const uint32_t pio5_config = (/* Selects pull-up function */ | ||
318 | IOCON_PIO_MODE_PULLUP | | ||
319 | /* Enable hysteresis */ | ||
320 | IOCON_PIO_HYS_EN | | ||
321 | /* Input not invert */ | ||
322 | IOCON_PIO_INV_DI | | ||
323 | /* Disables Open-drain function */ | ||
324 | IOCON_PIO_OD_DI | | ||
325 | /* Bypass input filter */ | ||
326 | IOCON_PIO_SMODE_BYPASS | | ||
327 | /* IOCONCLKDIV0 */ | ||
328 | IOCON_PIO_CLKDIV0); | ||
329 | /* PORT5 PIN (coords: ) is configured as */ | ||
330 | IOCON_PinMuxSet(IOCON, 5, pio5_config); | ||
331 | |||
332 | const uint32_t pio6_config = (/* Selects pull-up function */ | ||
333 | IOCON_PIO_MODE_PULLUP | | ||
334 | /* Enable hysteresis */ | ||
335 | IOCON_PIO_HYS_EN | | ||
336 | /* Input not invert */ | ||
337 | IOCON_PIO_INV_DI | | ||
338 | /* Disables Open-drain function */ | ||
339 | IOCON_PIO_OD_DI | | ||
340 | /* Bypass input filter */ | ||
341 | IOCON_PIO_SMODE_BYPASS | | ||
342 | /* IOCONCLKDIV0 */ | ||
343 | IOCON_PIO_CLKDIV0); | ||
344 | /* PORT6 PIN (coords: ) is configured as */ | ||
345 | IOCON_PinMuxSet(IOCON, 6, pio6_config); | ||
346 | |||
347 | /* SWCLK connect to P0_3 */ | ||
348 | SWM_SetFixedPinSelect(SWM0, kSWM_SWCLK, true); | ||
349 | |||
350 | /* SWDIO connect to P0_2 */ | ||
351 | SWM_SetFixedPinSelect(SWM0, kSWM_SWDIO, true); | ||
352 | |||
353 | /* RESETN connect to P0_5 */ | ||
354 | SWM_SetFixedPinSelect(SWM0, kSWM_RESETN, true); | ||
355 | |||
356 | /* Disable clock for switch matrix. */ | ||
357 | CLOCK_DisableClock(kCLOCK_Swm); | ||
358 | } | ||
359 | |||
360 | /* clang-format off */ | ||
361 | /* | ||
362 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
363 | BOARD_InitBUTTONsPins: | ||
364 | - options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'} | ||
365 | - pin_list: | ||
366 | - {pin_num: '4', peripheral: GPIO, signal: 'PIO0, 12', pin_signal: PIO0_12, identifier: SW1, direction: INPUT, mode: pullUp, invert: disabled, hysteresis: enabled, | ||
367 | opendrain: disabled, smode: bypass, clkdiv: div0} | ||
368 | - {pin_num: '6', peripheral: GPIO, signal: 'PIO0, 4', pin_signal: PIO0_4/ADC_11, direction: INPUT, mode: pullUp, invert: disabled, hysteresis: enabled, opendrain: disabled, | ||
369 | smode: bypass, clkdiv: div0} | ||
370 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
371 | */ | ||
372 | /* clang-format on */ | ||
373 | |||
374 | /* FUNCTION ************************************************************************************************************ | ||
375 | * | ||
376 | * Function Name : BOARD_InitBUTTONsPins | ||
377 | * Description : Configures pin routing and optionally pin electrical features. | ||
378 | * | ||
379 | * END ****************************************************************************************************************/ | ||
380 | /* Function assigned for the Cortex-M0P */ | ||
381 | void BOARD_InitBUTTONsPins(void) | ||
382 | { | ||
383 | /* Enables clock for IOCON.: enable */ | ||
384 | CLOCK_EnableClock(kCLOCK_Iocon); | ||
385 | |||
386 | const uint32_t pio2_config = (/* Selects pull-up function */ | ||
387 | IOCON_PIO_MODE_PULLUP | | ||
388 | /* Enable hysteresis */ | ||
389 | IOCON_PIO_HYS_EN | | ||
390 | /* Input not invert */ | ||
391 | IOCON_PIO_INV_DI | | ||
392 | /* Disables Open-drain function */ | ||
393 | IOCON_PIO_OD_DI | | ||
394 | /* Bypass input filter */ | ||
395 | IOCON_PIO_SMODE_BYPASS | | ||
396 | /* IOCONCLKDIV0 */ | ||
397 | IOCON_PIO_CLKDIV0); | ||
398 | /* PORT2 PIN (coords: ) is configured as */ | ||
399 | IOCON_PinMuxSet(IOCON, 2, pio2_config); | ||
400 | |||
401 | const uint32_t pio4_config = (/* Selects pull-up function */ | ||
402 | IOCON_PIO_MODE_PULLUP | | ||
403 | /* Enable hysteresis */ | ||
404 | IOCON_PIO_HYS_EN | | ||
405 | /* Input not invert */ | ||
406 | IOCON_PIO_INV_DI | | ||
407 | /* Disables Open-drain function */ | ||
408 | IOCON_PIO_OD_DI | | ||
409 | /* Bypass input filter */ | ||
410 | IOCON_PIO_SMODE_BYPASS | | ||
411 | /* IOCONCLKDIV0 */ | ||
412 | IOCON_PIO_CLKDIV0); | ||
413 | /* PORT4 PIN (coords: ) is configured as */ | ||
414 | IOCON_PinMuxSet(IOCON, 4, pio4_config); | ||
415 | |||
416 | /* Disable clock for switch matrix. */ | ||
417 | CLOCK_DisableClock(kCLOCK_Swm); | ||
418 | } | ||
419 | /*********************************************************************************************************************** | ||
420 | * EOF | ||
421 | **********************************************************************************************************************/ | ||