1 /*
2  * Copyright 2019-2021 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 v9.0
18 processor: LPC55S36
19 package_id: LPC55S36JBD100
20 mcu_data: ksdk2_0
21 processor_version: 0.10.0
22  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
23  */
24 /* clang-format on */
25 
26 #include "fsl_common.h"
27 #include "fsl_iocon.h"
28 #include "pin_mux.h"
29 #include "board.h"
30 
31 /* clang-format off */
32 /*
33  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
34 BOARD_InitPins:
35 - options: {callFromInitBoot: 'true', coreID: cm33_core0, enableClock: 'true'}
36 - pin_list:
37   - {pin_num: '93', peripheral: FLEXCOMM0, signal: RXD_SDA_MOSI_DATA, pin_signal: PIO0_29/FC0_RXD_SDA_MOSI_DATA/CTIMER2_MAT3/SCT0_OUT8/TRACEDATA2/FC6_RXD_SDA_MOSI_DATA/CMP0_OUT/SECURE_GPIO0_29/PWM0_A1/SPI_DIN/EXTTRIG_IN3,
38     mode: inactive, slew_rate: standard, invert: disabled, open_drain: disabled}
39   - {pin_num: '95', peripheral: FLEXCOMM0, signal: TXD_SCL_MISO_WS, pin_signal: PIO0_30/FC0_TXD_SCL_MISO_WS/CTIMER0_MAT0/SCT0_OUT9/TRACEDATA1/CAN0_TD/FC6_TXD_SCL_MISO_WS/SECURE_GPIO0_30/PWM1_A1/AOI1_OUT0,
40     mode: inactive, slew_rate: standard, invert: disabled, open_drain: disabled}
41  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
42  */
43 /* clang-format on */
44 
45 /* FUNCTION ************************************************************************************************************
46  *
47  * Function Name : BOARD_InitPins
48  * Description   : Configures pin routing and optionally pin electrical features.
49  *
50  * END ****************************************************************************************************************/
51 /* Function assigned for the Cortex-M33 */
BOARD_InitPins(void)52 void BOARD_InitPins(void)
53 {
54     /* Enables the clock for the I/O controller.: Enable Clock. */
55     CLOCK_EnableClock(kCLOCK_Iocon);
56 
57     const uint32_t port0_pin29_config = (/* Pin is configured as FC0_RXD_SDA_MOSI_DATA */
58                                          IOCON_PIO_FUNC1 |
59                                          /* No addition pin function */
60                                          IOCON_PIO_MODE_INACT |
61                                          /* Standard mode, output slew rate control is enabled */
62                                          IOCON_PIO_SLEW_STANDARD |
63                                          /* Input function is not inverted */
64                                          IOCON_PIO_INV_DI |
65                                          /* Enables digital function */
66                                          IOCON_PIO_DIGITAL_EN |
67                                          /* Open drain is disabled */
68                                          IOCON_PIO_OPENDRAIN_DI);
69     /* PORT0 PIN29 (coords: 93) is configured as FC0_RXD_SDA_MOSI_DATA */
70     IOCON_PinMuxSet(IOCON, 0U, 29U, port0_pin29_config);
71 
72     const uint32_t port0_pin30_config = (/* Pin is configured as FC0_TXD_SCL_MISO_WS */
73                                          IOCON_PIO_FUNC1 |
74                                          /* No addition pin function */
75                                          IOCON_PIO_MODE_INACT |
76                                          /* Standard mode, output slew rate control is enabled */
77                                          IOCON_PIO_SLEW_STANDARD |
78                                          /* Input function is not inverted */
79                                          IOCON_PIO_INV_DI |
80                                          /* Enables digital function */
81                                          IOCON_PIO_DIGITAL_EN |
82                                          /* Open drain is disabled */
83                                          IOCON_PIO_OPENDRAIN_DI);
84     /* PORT0 PIN30 (coords: 95) is configured as FC0_TXD_SCL_MISO_WS */
85     IOCON_PinMuxSet(IOCON, 0U, 30U, port0_pin30_config);
86 }
87 
88 /* clang-format off */
89 /*
90  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
91 I2C2_InitPins:
92 - options: {callFromInitBoot: 'true', coreID: cm33_core0, enableClock: 'true'}
93 - pin_list:
94   - {pin_num: '68', peripheral: FLEXCOMM2, signal: CTS_SDA_SSEL0, pin_signal: PIO1_26/FC2_CTS_SDA_SSEL0/SCT0_OUT3/CT_INP3/UTICK_CAP1/HS_SPI_SSEL3/PWM0_A1/QSPI_CS1_DIS/AOI1_OUT2,
95     mode: pullUp, slew_rate: standard, invert: disabled, open_drain: disabled}
96   - {pin_num: '77', peripheral: FLEXCOMM2, signal: TXD_SCL_MISO_WS, pin_signal: PIO1_25/FC2_TXD_SCL_MISO_WS/SCT0_OUT2/UTICK_CAP0/PWM1_A2/SPI_SCLK/AOI0_OUT3, mode: pullUp,
97     slew_rate: standard, invert: disabled, open_drain: disabled}
98  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
99  */
100 /* clang-format on */
101 
102 /* FUNCTION ************************************************************************************************************
103  *
104  * Function Name : I2C2_InitPins
105  * Description   : Configures pin routing and optionally pin electrical features.
106  *
107  * END ****************************************************************************************************************/
108 /* Function assigned for the Cortex-M33 */
I2C2_InitPins(void)109 void I2C2_InitPins(void)
110 {
111     /* Enables the clock for the I/O controller.: Enable Clock. */
112     CLOCK_EnableClock(kCLOCK_Iocon);
113 
114     const uint32_t port1_pin25_config = (/* Pin is configured as FC2_TXD_SCL_MISO_WS */
115                                          IOCON_PIO_FUNC1 |
116                                          /* Selects pull-up function */
117                                          IOCON_PIO_MODE_PULLUP |
118                                          /* Standard mode, output slew rate control is enabled */
119                                          IOCON_PIO_SLEW_STANDARD |
120                                          /* Input function is not inverted */
121                                          IOCON_PIO_INV_DI |
122                                          /* Enables digital function */
123                                          IOCON_PIO_DIGITAL_EN |
124                                          /* Open drain is disabled */
125                                          IOCON_PIO_OPENDRAIN_DI);
126     /* PORT1 PIN25 (coords: 77) is configured as FC2_TXD_SCL_MISO_WS */
127     IOCON_PinMuxSet(IOCON, 1U, 25U, port1_pin25_config);
128 
129     const uint32_t port1_pin26_config = (/* Pin is configured as FC2_CTS_SDA_SSEL0 */
130                                          IOCON_PIO_FUNC1 |
131                                          /* Selects pull-up function */
132                                          IOCON_PIO_MODE_PULLUP |
133                                          /* Standard mode, output slew rate control is enabled */
134                                          IOCON_PIO_SLEW_STANDARD |
135                                          /* Input function is not inverted */
136                                          IOCON_PIO_INV_DI |
137                                          /* Enables digital function */
138                                          IOCON_PIO_DIGITAL_EN |
139                                          /* Open drain is disabled */
140                                          IOCON_PIO_OPENDRAIN_DI);
141     /* PORT1 PIN26 (coords: 68) is configured as FC2_CTS_SDA_SSEL0 */
142     IOCON_PinMuxSet(IOCON, 1U, 26U, port1_pin26_config);
143 
144     /* attach 12 MHz clock to FLEXCOMM2 (I2C slave) */
145     CLOCK_SetClkDiv(kCLOCK_DivFlexcom2Clk, 0u, false);
146     CLOCK_SetClkDiv(kCLOCK_DivFlexcom2Clk, 1u, true);
147     CLOCK_AttachClk(kFRO12M_to_FLEXCOMM2);
148 
149     /* reset FLEXCOMM for I2C */
150     RESET_PeripheralReset(kFC2_RST_SHIFT_RSTn);
151 }
152 
153 /* clang-format off */
154 /*
155  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
156 I2C2_DeinitPins:
157 - options: {callFromInitBoot: 'false', coreID: cm33_core0, enableClock: 'true'}
158 - pin_list:
159   - {pin_num: '77', peripheral: GPIO, signal: 'PIO1, 25', pin_signal: PIO1_25/FC2_TXD_SCL_MISO_WS/SCT0_OUT2/UTICK_CAP0/PWM1_A2/SPI_SCLK/AOI0_OUT3, mode: inactive,
160     slew_rate: standard, invert: disabled, open_drain: disabled}
161   - {pin_num: '68', peripheral: GPIO, signal: 'PIO1, 26', pin_signal: PIO1_26/FC2_CTS_SDA_SSEL0/SCT0_OUT3/CT_INP3/UTICK_CAP1/HS_SPI_SSEL3/PWM0_A1/QSPI_CS1_DIS/AOI1_OUT2,
162     mode: inactive, slew_rate: standard, invert: disabled, open_drain: disabled}
163  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
164  */
165 /* clang-format on */
166 
167 /* FUNCTION ************************************************************************************************************
168  *
169  * Function Name : I2C2_DeinitPins
170  * Description   : Configures pin routing and optionally pin electrical features.
171  *
172  * END ****************************************************************************************************************/
173 /* Function assigned for the Cortex-M33 */
I2C2_DeinitPins(void)174 void I2C2_DeinitPins(void)
175 {
176     /* Enables the clock for the I/O controller.: Enable Clock. */
177     CLOCK_EnableClock(kCLOCK_Iocon);
178 
179     const uint32_t port1_pin25_config = (/* Pin is configured as PIO1_25 */
180                                          IOCON_PIO_FUNC0 |
181                                          /* No addition pin function */
182                                          IOCON_PIO_MODE_INACT |
183                                          /* Standard mode, output slew rate control is enabled */
184                                          IOCON_PIO_SLEW_STANDARD |
185                                          /* Input function is not inverted */
186                                          IOCON_PIO_INV_DI |
187                                          /* Enables digital function */
188                                          IOCON_PIO_DIGITAL_EN |
189                                          /* Open drain is disabled */
190                                          IOCON_PIO_OPENDRAIN_DI);
191     /* PORT1 PIN25 (coords: 77) is configured as PIO1_25 */
192     IOCON_PinMuxSet(IOCON, 1U, 25U, port1_pin25_config);
193 
194     const uint32_t port1_pin26_config = (/* Pin is configured as PIO1_26 */
195                                          IOCON_PIO_FUNC0 |
196                                          /* No addition pin function */
197                                          IOCON_PIO_MODE_INACT |
198                                          /* Standard mode, output slew rate control is enabled */
199                                          IOCON_PIO_SLEW_STANDARD |
200                                          /* Input function is not inverted */
201                                          IOCON_PIO_INV_DI |
202                                          /* Enables digital function */
203                                          IOCON_PIO_DIGITAL_EN |
204                                          /* Open drain is disabled */
205                                          IOCON_PIO_OPENDRAIN_DI);
206     /* PORT1 PIN26 (coords: 68) is configured as PIO1_26 */
207     IOCON_PinMuxSet(IOCON, 1U, 26U, port1_pin26_config);
208 }
209 
210 /* clang-format off */
211 /*
212  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
213 SPI2_InitPins:
214 - options: {callFromInitBoot: 'true', coreID: cm33_core0, enableClock: 'true'}
215 - pin_list:
216   - {pin_num: '68', peripheral: FLEXCOMM2, signal: CTS_SDA_SSEL0, pin_signal: PIO1_26/FC2_CTS_SDA_SSEL0/SCT0_OUT3/CT_INP3/UTICK_CAP1/HS_SPI_SSEL3/PWM0_A1/QSPI_CS1_DIS/AOI1_OUT2,
217     mode: pullUp, slew_rate: standard, invert: disabled, open_drain: disabled}
218   - {pin_num: '77', peripheral: FLEXCOMM2, signal: TXD_SCL_MISO_WS, pin_signal: PIO1_25/FC2_TXD_SCL_MISO_WS/SCT0_OUT2/UTICK_CAP0/PWM1_A2/SPI_SCLK/AOI0_OUT3, mode: pullUp,
219     slew_rate: standard, invert: disabled, open_drain: disabled}
220   - {pin_num: '49', peripheral: FLEXCOMM2, signal: SCK, pin_signal: PIO1_23/FC2_SCK/SCT0_OUT0/FC3_SSEL2/PWM1_A1/TRIGOUT_4/HSCMP2_IN1, mode: pullUp, slew_rate: standard,
221     invert: disabled, open_drain: disabled, asw0: disabled}
222   - {pin_num: '3', peripheral: FLEXCOMM2, signal: RXD_SDA_MOSI_DATA, pin_signal: PIO1_24/FC2_RXD_SDA_MOSI_DATA/SCT0_OUT1/FC3_SSEL3/AOI0_OUT2/ADC1_8B, mode: pullUp,
223     slew_rate: standard, invert: disabled, open_drain: disabled, asw0: disabled}
224  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
225  */
226 /* clang-format on */
227 
228 /* FUNCTION ************************************************************************************************************
229  *
230  * Function Name : SPI2_InitPins
231  * Description   : Configures pin routing and optionally pin electrical features.
232  *
233  * END ****************************************************************************************************************/
234 /* Function assigned for the Cortex-M33 */
SPI2_InitPins(void)235 void SPI2_InitPins(void)
236 {
237     /* Enables the clock for the I/O controller.: Enable Clock. */
238     CLOCK_EnableClock(kCLOCK_Iocon);
239 
240     const uint32_t port1_pin23_config = (/* Pin is configured as FC2_SCK */
241                                          IOCON_PIO_FUNC1 |
242                                          /* Selects pull-up function */
243                                          IOCON_PIO_MODE_PULLUP |
244                                          /* Standard mode, output slew rate control is enabled */
245                                          IOCON_PIO_SLEW_STANDARD |
246                                          /* Input function is not inverted */
247                                          IOCON_PIO_INV_DI |
248                                          /* Enables digital function */
249                                          IOCON_PIO_DIGITAL_EN |
250                                          /* Open drain is disabled */
251                                          IOCON_PIO_OPENDRAIN_DI |
252                                          /* Analog switch 0 is open (disabled) */
253                                          IOCON_PIO_ASW0_DI);
254     /* PORT1 PIN23 (coords: 49) is configured as FC2_SCK */
255     IOCON_PinMuxSet(IOCON, 1U, 23U, port1_pin23_config);
256 
257     const uint32_t port1_pin24_config = (/* Pin is configured as FC2_RXD_SDA_MOSI_DATA */
258                                          IOCON_PIO_FUNC1 |
259                                          /* Selects pull-up function */
260                                          IOCON_PIO_MODE_PULLUP |
261                                          /* Standard mode, output slew rate control is enabled */
262                                          IOCON_PIO_SLEW_STANDARD |
263                                          /* Input function is not inverted */
264                                          IOCON_PIO_INV_DI |
265                                          /* Enables digital function */
266                                          IOCON_PIO_DIGITAL_EN |
267                                          /* Open drain is disabled */
268                                          IOCON_PIO_OPENDRAIN_DI |
269                                          /* Analog switch 0 is open (disabled) */
270                                          IOCON_PIO_ASW0_DI);
271     /* PORT1 PIN24 (coords: 3) is configured as FC2_RXD_SDA_MOSI_DATA */
272     IOCON_PinMuxSet(IOCON, 1U, 24U, port1_pin24_config);
273 
274     const uint32_t port1_pin25_config = (/* Pin is configured as FC2_TXD_SCL_MISO_WS */
275                                          IOCON_PIO_FUNC1 |
276                                          /* Selects pull-up function */
277                                          IOCON_PIO_MODE_PULLUP |
278                                          /* Standard mode, output slew rate control is enabled */
279                                          IOCON_PIO_SLEW_STANDARD |
280                                          /* Input function is not inverted */
281                                          IOCON_PIO_INV_DI |
282                                          /* Enables digital function */
283                                          IOCON_PIO_DIGITAL_EN |
284                                          /* Open drain is disabled */
285                                          IOCON_PIO_OPENDRAIN_DI);
286     /* PORT1 PIN25 (coords: 77) is configured as FC2_TXD_SCL_MISO_WS */
287     IOCON_PinMuxSet(IOCON, 1U, 25U, port1_pin25_config);
288 
289     const uint32_t port1_pin26_config = (/* Pin is configured as FC2_CTS_SDA_SSEL0 */
290                                          IOCON_PIO_FUNC1 |
291                                          /* Selects pull-up function */
292                                          IOCON_PIO_MODE_PULLUP |
293                                          /* Standard mode, output slew rate control is enabled */
294                                          IOCON_PIO_SLEW_STANDARD |
295                                          /* Input function is not inverted */
296                                          IOCON_PIO_INV_DI |
297                                          /* Enables digital function */
298                                          IOCON_PIO_DIGITAL_EN |
299                                          /* Open drain is disabled */
300                                          IOCON_PIO_OPENDRAIN_DI);
301     /* PORT1 PIN26 (coords: 68) is configured as FC2_CTS_SDA_SSEL0 */
302     IOCON_PinMuxSet(IOCON, 1U, 26U, port1_pin26_config);
303 
304     /* attach 12 MHz clock to FLEXCOMM2 (SPI2 master) */
305     CLOCK_SetClkDiv(kCLOCK_DivFlexcom2Clk, 0u, false);
306     CLOCK_SetClkDiv(kCLOCK_DivFlexcom2Clk, 1u, true);
307     CLOCK_AttachClk(kFRO12M_to_FLEXCOMM2);
308 
309     /* reset FLEXCOMM for SPI */
310     RESET_PeripheralReset(kFC2_RST_SHIFT_RSTn);
311 }
312 
313 /* clang-format off */
314 /*
315  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
316 SPI2_DeinitPins:
317 - options: {callFromInitBoot: 'false', coreID: cm33_core0, enableClock: 'true'}
318 - pin_list:
319   - {pin_num: '77', peripheral: GPIO, signal: 'PIO1, 25', pin_signal: PIO1_25/FC2_TXD_SCL_MISO_WS/SCT0_OUT2/UTICK_CAP0/PWM1_A2/SPI_SCLK/AOI0_OUT3, mode: inactive,
320     slew_rate: standard, invert: disabled, open_drain: disabled}
321   - {pin_num: '68', peripheral: GPIO, signal: 'PIO1, 26', pin_signal: PIO1_26/FC2_CTS_SDA_SSEL0/SCT0_OUT3/CT_INP3/UTICK_CAP1/HS_SPI_SSEL3/PWM0_A1/QSPI_CS1_DIS/AOI1_OUT2,
322     mode: inactive, slew_rate: standard, invert: disabled, open_drain: disabled}
323   - {pin_num: '3', peripheral: GPIO, signal: 'PIO1, 24', pin_signal: PIO1_24/FC2_RXD_SDA_MOSI_DATA/SCT0_OUT1/FC3_SSEL3/AOI0_OUT2/ADC1_8B, mode: inactive, slew_rate: standard,
324     invert: disabled, open_drain: disabled, asw0: disabled}
325   - {pin_num: '49', peripheral: GPIO, signal: 'PIO1, 23', pin_signal: PIO1_23/FC2_SCK/SCT0_OUT0/FC3_SSEL2/PWM1_A1/TRIGOUT_4/HSCMP2_IN1, mode: inactive, slew_rate: standard,
326     invert: disabled, open_drain: disabled, asw0: disabled}
327  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
328  */
329 /* clang-format on */
330 
331 /* FUNCTION ************************************************************************************************************
332  *
333  * Function Name : SPI2_DeinitPins
334  * Description   : Configures pin routing and optionally pin electrical features.
335  *
336  * END ****************************************************************************************************************/
337 /* Function assigned for the Cortex-M33 */
SPI2_DeinitPins(void)338 void SPI2_DeinitPins(void)
339 {
340     /* Enables the clock for the I/O controller.: Enable Clock. */
341     CLOCK_EnableClock(kCLOCK_Iocon);
342 
343     const uint32_t port1_pin23_config = (/* Pin is configured as PIO1_23 */
344                                          IOCON_PIO_FUNC0 |
345                                          /* No addition pin function */
346                                          IOCON_PIO_MODE_INACT |
347                                          /* Standard mode, output slew rate control is enabled */
348                                          IOCON_PIO_SLEW_STANDARD |
349                                          /* Input function is not inverted */
350                                          IOCON_PIO_INV_DI |
351                                          /* Enables digital function */
352                                          IOCON_PIO_DIGITAL_EN |
353                                          /* Open drain is disabled */
354                                          IOCON_PIO_OPENDRAIN_DI |
355                                          /* Analog switch 0 is open (disabled) */
356                                          IOCON_PIO_ASW0_DI);
357     /* PORT1 PIN23 (coords: 49) is configured as PIO1_23 */
358     IOCON_PinMuxSet(IOCON, 1U, 23U, port1_pin23_config);
359 
360     const uint32_t port1_pin24_config = (/* Pin is configured as PIO1_24 */
361                                          IOCON_PIO_FUNC0 |
362                                          /* No addition pin function */
363                                          IOCON_PIO_MODE_INACT |
364                                          /* Standard mode, output slew rate control is enabled */
365                                          IOCON_PIO_SLEW_STANDARD |
366                                          /* Input function is not inverted */
367                                          IOCON_PIO_INV_DI |
368                                          /* Enables digital function */
369                                          IOCON_PIO_DIGITAL_EN |
370                                          /* Open drain is disabled */
371                                          IOCON_PIO_OPENDRAIN_DI |
372                                          /* Analog switch 0 is open (disabled) */
373                                          IOCON_PIO_ASW0_DI);
374     /* PORT1 PIN24 (coords: 3) is configured as PIO1_24 */
375     IOCON_PinMuxSet(IOCON, 1U, 24U, port1_pin24_config);
376 
377     const uint32_t port1_pin25_config = (/* Pin is configured as PIO1_25 */
378                                          IOCON_PIO_FUNC0 |
379                                          /* No addition pin function */
380                                          IOCON_PIO_MODE_INACT |
381                                          /* Standard mode, output slew rate control is enabled */
382                                          IOCON_PIO_SLEW_STANDARD |
383                                          /* Input function is not inverted */
384                                          IOCON_PIO_INV_DI |
385                                          /* Enables digital function */
386                                          IOCON_PIO_DIGITAL_EN |
387                                          /* Open drain is disabled */
388                                          IOCON_PIO_OPENDRAIN_DI);
389     /* PORT1 PIN25 (coords: 77) is configured as PIO1_25 */
390     IOCON_PinMuxSet(IOCON, 1U, 25U, port1_pin25_config);
391 
392     const uint32_t port1_pin26_config = (/* Pin is configured as PIO1_26 */
393                                          IOCON_PIO_FUNC0 |
394                                          /* No addition pin function */
395                                          IOCON_PIO_MODE_INACT |
396                                          /* Standard mode, output slew rate control is enabled */
397                                          IOCON_PIO_SLEW_STANDARD |
398                                          /* Input function is not inverted */
399                                          IOCON_PIO_INV_DI |
400                                          /* Enables digital function */
401                                          IOCON_PIO_DIGITAL_EN |
402                                          /* Open drain is disabled */
403                                          IOCON_PIO_OPENDRAIN_DI);
404     /* PORT1 PIN26 (coords: 68) is configured as PIO1_26 */
405     IOCON_PinMuxSet(IOCON, 1U, 26U, port1_pin26_config);
406 }
407 
408 /* clang-format off */
409 /*
410  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
411 USART0_InitPins:
412 - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
413 - pin_list:
414   - {pin_num: '94', peripheral: FLEXCOMM0, signal: TXD_SCL_MISO_WS, pin_signal: PIO0_30/FC0_TXD_SCL_MISO_WS/CTIMER0_MAT0/SCT0_OUT9/SECURE_GPIO0_30, mode: inactive,
415     slew_rate: standard, invert: disabled, open_drain: disabled}
416   - {pin_num: '92', peripheral: FLEXCOMM0, signal: RXD_SDA_MOSI_DATA, pin_signal: PIO0_29/FC0_RXD_SDA_MOSI_DATA/CTIMER2_MAT3/SCT0_OUT8/CMP0_OUT/PLU_OUT2/SECURE_GPIO0_29,
417     mode: inactive, slew_rate: standard, invert: disabled, open_drain: disabled}
418  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
419  */
420 /* clang-format on */
421 
422 /* FUNCTION ************************************************************************************************************
423  *
424  * Function Name : USART0_InitPins
425  * Description   : Configures pin routing and optionally pin electrical features.
426  *
427  * END ****************************************************************************************************************/
428 /* Function assigned for the Cortex-M33 */
USART0_InitPins(void)429 void USART0_InitPins(void)
430 {
431     /* Enables the clock for the I/O controller.: Enable Clock. */
432     CLOCK_EnableClock(kCLOCK_Iocon);
433 
434     const uint32_t port0_pin29_config = (/* Pin is configured as FC0_RXD_SDA_MOSI_DATA */
435                                          IOCON_PIO_FUNC1 |
436                                          /* No addition pin function */
437                                          IOCON_PIO_MODE_INACT |
438                                          /* Standard mode, output slew rate control is enabled */
439                                          IOCON_PIO_SLEW_STANDARD |
440                                          /* Input function is not inverted */
441                                          IOCON_PIO_INV_DI |
442                                          /* Enables digital function */
443                                          IOCON_PIO_DIGITAL_EN |
444                                          /* Open drain is disabled */
445                                          IOCON_PIO_OPENDRAIN_DI);
446     /* PORT0 PIN29 (coords: 92) is configured as FC0_RXD_SDA_MOSI_DATA */
447     IOCON_PinMuxSet(IOCON, 0U, 29U, port0_pin29_config);
448 
449     const uint32_t port0_pin30_config = (/* Pin is configured as FC0_TXD_SCL_MISO_WS */
450                                          IOCON_PIO_FUNC1 |
451                                          /* No addition pin function */
452                                          IOCON_PIO_MODE_INACT |
453                                          /* Standard mode, output slew rate control is enabled */
454                                          IOCON_PIO_SLEW_STANDARD |
455                                          /* Input function is not inverted */
456                                          IOCON_PIO_INV_DI |
457                                          /* Enables digital function */
458                                          IOCON_PIO_DIGITAL_EN |
459                                          /* Open drain is disabled */
460                                          IOCON_PIO_OPENDRAIN_DI);
461     /* PORT0 PIN30 (coords: 94) is configured as FC0_TXD_SCL_MISO_WS */
462     IOCON_PinMuxSet(IOCON, 0U, 30U, port0_pin30_config);
463 
464     /* attach 12 MHz clock to FLEXCOMM0 (debug console) */
465     CLOCK_SetClkDiv(kCLOCK_DivFlexcom0Clk, 0u, false);
466     CLOCK_SetClkDiv(kCLOCK_DivFlexcom0Clk, 1u, true);
467     CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
468 }
469 
470 /* clang-format off */
471 /*
472  * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
473 USART0_DeinitPins:
474 - options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
475 - pin_list:
476   - {pin_num: '92', peripheral: GPIO, signal: 'PIO0, 29', pin_signal: PIO0_29/FC0_RXD_SDA_MOSI_DATA/CTIMER2_MAT3/SCT0_OUT8/CMP0_OUT/PLU_OUT2/SECURE_GPIO0_29, mode: inactive,
477     slew_rate: standard, invert: disabled, open_drain: disabled}
478   - {pin_num: '94', peripheral: GPIO, signal: 'PIO0, 30', pin_signal: PIO0_30/FC0_TXD_SCL_MISO_WS/CTIMER0_MAT0/SCT0_OUT9/SECURE_GPIO0_30, mode: inactive, slew_rate: standard,
479     invert: disabled, open_drain: disabled}
480  * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
481  */
482 /* clang-format on */
483 
484 /* FUNCTION ************************************************************************************************************
485  *
486  * Function Name : USART0_DeinitPins
487  * Description   : Configures pin routing and optionally pin electrical features.
488  *
489  * END ****************************************************************************************************************/
490 /* Function assigned for the Cortex-M33 */
USART0_DeinitPins(void)491 void USART0_DeinitPins(void)
492 {
493     /* Enables the clock for the I/O controller.: Enable Clock. */
494     CLOCK_EnableClock(kCLOCK_Iocon);
495 
496     const uint32_t port0_pin29_config = (/* Pin is configured as PIO0_29 */
497                                          IOCON_PIO_FUNC0 |
498                                          /* No addition pin function */
499                                          IOCON_PIO_MODE_INACT |
500                                          /* Standard mode, output slew rate control is enabled */
501                                          IOCON_PIO_SLEW_STANDARD |
502                                          /* Input function is not inverted */
503                                          IOCON_PIO_INV_DI |
504                                          /* Enables digital function */
505                                          IOCON_PIO_DIGITAL_EN |
506                                          /* Open drain is disabled */
507                                          IOCON_PIO_OPENDRAIN_DI);
508     /* PORT0 PIN29 (coords: 92) is configured as PIO0_29 */
509     IOCON_PinMuxSet(IOCON, 0U, 29U, port0_pin29_config);
510 
511     const uint32_t port0_pin30_config = (/* Pin is configured as PIO0_30 */
512                                          IOCON_PIO_FUNC0 |
513                                          /* No addition pin function */
514                                          IOCON_PIO_MODE_INACT |
515                                          /* Standard mode, output slew rate control is enabled */
516                                          IOCON_PIO_SLEW_STANDARD |
517                                          /* Input function is not inverted */
518                                          IOCON_PIO_INV_DI |
519                                          /* Enables digital function */
520                                          IOCON_PIO_DIGITAL_EN |
521                                          /* Open drain is disabled */
522                                          IOCON_PIO_OPENDRAIN_DI);
523     /* PORT0 PIN30 (coords: 94) is configured as PIO0_30 */
524     IOCON_PinMuxSet(IOCON, 0U, 30U, port0_pin30_config);
525 }
526 /***********************************************************************************************************************
527  * EOF
528  **********************************************************************************************************************/
529