aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk64f/project_template/pin_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/frdmk64f/project_template/pin_mux.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/boards/frdmk64f/project_template/pin_mux.c982
1 files changed, 982 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk64f/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk64f/project_template/pin_mux.c
new file mode 100644
index 000000000..0739a4ecb
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk64f/project_template/pin_mux.c
@@ -0,0 +1,982 @@
1/*
2 * Copyright 2018-2019 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/* clang-format off */
9/*
10 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
11!!GlobalInfo
12product: Pins v5.0
13processor: MK64FN1M0xxx12
14package_id: MK64FN1M0VLL12
15mcu_data: ksdk2_0
16processor_version: 4.0.0
17board: FRDM-K64F
18pin_labels:
19- {pin_num: '90', pin_signal: PTC16/UART3_RX/ENET0_1588_TMR0/FB_CS5_b/FB_TSIZ1/FB_BE23_16_BLS15_8_b, label: 'J1[2]', identifier: TMR_1588_0}
20- {pin_num: '91', pin_signal: PTC17/UART3_TX/ENET0_1588_TMR1/FB_CS4_b/FB_TSIZ0/FB_BE31_24_BLS7_0_b, label: 'J1[4]', identifier: TMR_1588_1}
21- {pin_num: '57', pin_signal: PTB9/SPI1_PCS1/UART3_CTS_b/FB_AD20, label: 'J1[6]'}
22- {pin_num: '35', pin_signal: PTA1/UART0_RX/FTM0_CH6/JTAG_TDI/EZP_DI, label: 'J1[8]'}
23- {pin_num: '69', pin_signal: PTB23/SPI2_SIN/SPI0_PCS5/FB_AD28, label: 'J1[10]'}
24- {pin_num: '36', pin_signal: PTA2/UART0_TX/FTM0_CH7/JTAG_TDO/TRACE_SWO/EZP_DO, label: 'J1[12]/J9[6]/TRACE_SWO'}
25- {pin_num: '72', pin_signal: ADC0_SE4b/CMP1_IN0/PTC2/SPI0_PCS2/UART1_CTS_b/FTM0_CH1/FB_AD12/I2S0_TX_FS, label: 'J1[14]'}
26- {pin_num: '73', pin_signal: CMP1_IN1/PTC3/LLWU_P7/SPI0_PCS1/UART1_RX/FTM0_CH2/CLKOUT/I2S0_TX_BCLK, label: 'J1[16]'}
27- {pin_num: '64', pin_signal: PTB18/CAN0_TX/FTM2_CH0/I2S0_TX_BCLK/FB_AD15/FTM2_QD_PHA, label: 'J1[1]'}
28- {pin_num: '65', pin_signal: PTB19/CAN0_RX/FTM2_CH1/I2S0_TX_FS/FB_OE_b/FTM2_QD_PHB, label: 'J1[3]'}
29- {pin_num: '71', pin_signal: ADC0_SE15/PTC1/LLWU_P6/SPI0_PCS3/UART1_RTS_b/FTM0_CH0/FB_AD13/I2S0_TXD0, label: 'J1[5]'}
30- {pin_num: '80', pin_signal: ADC1_SE4b/CMP0_IN2/PTC8/FTM3_CH4/I2S0_MCLK/FB_AD7, label: 'J1[7]'}
31- {pin_num: '81', pin_signal: ADC1_SE5b/CMP0_IN3/PTC9/FTM3_CH5/I2S0_RX_BCLK/FB_AD6/FTM2_FLT0, label: 'J1[9]'}
32- {pin_num: '77', pin_signal: PTC5/LLWU_P9/SPI0_SCK/LPTMR0_ALT2/I2S0_RXD0/FB_AD10/CMP0_OUT/FTM0_CH2, label: 'J1[15]'}
33- {pin_num: '79', pin_signal: CMP0_IN1/PTC7/SPI0_SIN/USB_SOF_OUT/I2S0_RX_FS/FB_AD8, label: 'J1[13]', identifier: CMP0_IN1}
34- {pin_num: '70', pin_signal: ADC0_SE14/PTC0/SPI0_PCS4/PDB0_EXTRG/USB_SOF_OUT/FB_AD14/I2S0_TXD1, label: 'J1[11]'}
35- {pin_num: '84', pin_signal: PTC12/UART4_RTS_b/FB_AD27/FTM3_FLT0, label: 'J2[2]'}
36- {pin_num: '76', pin_signal: PTC4/LLWU_P8/SPI0_PCS0/UART1_TX/FTM0_CH3/FB_AD11/CMP1_OUT, label: 'J2[4]'}
37- {pin_num: '93', pin_signal: PTD0/LLWU_P12/SPI0_PCS0/UART2_RTS_b/FTM3_CH0/FB_ALE/FB_CS1_b/FB_TS_b, label: 'J2[6]'}
38- {pin_num: '95', pin_signal: PTD2/LLWU_P13/SPI0_SOUT/UART2_RX/FTM3_CH2/FB_AD4/I2C0_SCL, label: 'J2[8]', identifier: UART2_RX}
39- {pin_num: '96', pin_signal: PTD3/SPI0_SIN/UART2_TX/FTM3_CH3/FB_AD3/I2C0_SDA, label: 'J2[10]', identifier: UART2_TX}
40- {pin_num: '94', pin_signal: ADC0_SE5b/PTD1/SPI0_SCK/UART2_CTS_b/FTM3_CH1/FB_CS0_b, label: 'J2[12]'}
41- {pin_num: '32', pin_signal: ADC0_SE18/PTE25/UART4_RX/I2C0_SDA/EWM_IN, label: 'J2[18]/U8[6]/I2C0_SDA', identifier: ACCEL_SDA}
42- {pin_num: '31', pin_signal: ADC0_SE17/PTE24/UART4_TX/I2C0_SCL/EWM_OUT_b, label: 'J2[20]/U8[4]/I2C0_SCL', identifier: ACCEL_SCL}
43- {pin_num: '26', pin_signal: VREF_OUT/CMP1_IN5/CMP0_IN5/ADC1_SE18, label: 'J2[17]'}
44- {pin_num: '21', pin_signal: ADC1_DM0/ADC0_DM3, label: 'J2[13]'}
45- {pin_num: '18', pin_signal: ADC0_DP0/ADC1_DP3, label: 'J2[5]'}
46- {pin_num: '19', pin_signal: ADC0_DM0/ADC1_DM3, label: 'J2[7]'}
47- {pin_num: '20', pin_signal: ADC1_DP0/ADC0_DP3, label: 'J2[11]'}
48- {pin_num: '33', pin_signal: PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB_CLKIN, label: 'J2[1]/D12[4]/LEDRGB_GREEN', identifier: LED_GREEN}
49- {pin_num: '27', pin_signal: DAC0_OUT/CMP1_IN3/ADC0_SE23, label: 'J4[11]', identifier: DAC0_OUT}
50- {pin_num: '66', pin_signal: PTB20/SPI2_PCS0/FB_AD31/CMP0_OUT, label: 'J6[3]/J4[9]/RF_WIFI_CE', identifier: RF_WIFI_CE}
51- {pin_num: '17', pin_signal: ADC1_DM1, label: 'J4[7]'}
52- {pin_num: '16', pin_signal: ADC1_DP1, label: 'J4[5]'}
53- {pin_num: '15', pin_signal: ADC0_DM1, label: 'J4[3]'}
54- {pin_num: '14', pin_signal: ADC0_DP1, label: 'J4[1]'}
55- {pin_num: '55', pin_signal: ADC0_SE12/PTB2/I2C0_SCL/UART0_RTS_b/ENET0_1588_TMR0/FTM0_FLT3, label: 'J4[2]', identifier: ADC0_SE12}
56- {pin_num: '56', pin_signal: ADC0_SE13/PTB3/I2C0_SDA/UART0_CTS_b/UART0_COL_b/ENET0_1588_TMR1/FTM0_FLT0, label: 'J4[4]'}
57- {pin_num: '58', pin_signal: ADC1_SE14/PTB10/SPI1_PCS0/UART3_RX/FB_AD19/FTM0_FLT1, label: 'J4[6]'}
58- {pin_num: '59', pin_signal: ADC1_SE15/PTB11/SPI1_SCK/UART3_TX/FB_AD18/FTM0_FLT2, label: 'J4[8]'}
59- {pin_num: '83', pin_signal: ADC1_SE7b/PTC11/LLWU_P11/I2C1_SDA/FTM3_CH7/I2S0_RXD1/FB_RW_b, label: 'J4[10]'}
60- {pin_num: '82', pin_signal: ADC1_SE6b/PTC10/I2C1_SCL/FTM3_CH6/I2S0_RX_FS/FB_AD5, label: 'J4[12]'}
61- {pin_num: '38', pin_signal: PTA4/LLWU_P3/FTM0_CH1/NMI_b/EZP_CS_b, label: SW3, identifier: SW3}
62- {pin_num: '78', pin_signal: CMP0_IN0/PTC6/LLWU_P10/SPI0_SOUT/PDB0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK, label: 'U8[11]/SW2', identifier: SW2;ACCEL_INT1}
63- {pin_num: '52', pin_signal: RESET_b, label: 'J3[6]/J9[10]/D1/RESET', identifier: RESET}
64- {pin_num: '6', pin_signal: PTE5/SPI1_PCS2/UART3_RX/SDHC0_D2/FTM3_CH0, label: 'J15[P1]/SDHC0_D2', identifier: SDHC0_D2}
65- {pin_num: '5', pin_signal: PTE4/LLWU_P2/SPI1_PCS0/UART3_TX/SDHC0_D3/TRACE_D0, label: 'J15[P2]/SDHC0_D3', identifier: SDHC0_D3}
66- {pin_num: '4', pin_signal: ADC0_DM2/ADC1_SE7a/PTE3/SPI1_SIN/UART1_RTS_b/SDHC0_CMD/TRACE_D1/SPI1_SOUT, label: 'J15[P3]/SDHC0_CMD', identifier: SDHC0_CMD}
67- {pin_num: '3', pin_signal: ADC0_DP2/ADC1_SE6a/PTE2/LLWU_P1/SPI1_SCK/UART1_CTS_b/SDHC0_DCLK/TRACE_D2, label: 'J15[P5]/SDHC0_DCLK', identifier: SDHC0_DCLK}
68- {pin_num: '2', pin_signal: ADC1_SE5a/PTE1/LLWU_P0/SPI1_SOUT/UART1_RX/SDHC0_D0/TRACE_D3/I2C1_SCL/SPI1_SIN, label: 'J15[P7]/SDHC0_D0', identifier: SDHC0_D0}
69- {pin_num: '1', pin_signal: ADC1_SE4a/PTE0/SPI1_PCS1/UART1_TX/SDHC0_D1/TRACE_CLKOUT/I2C1_SDA/RTC_CLKOUT, label: 'J15[P8]/SDHC0_D1', identifier: SDHC0_D1}
70- {pin_num: '7', pin_signal: PTE6/SPI1_PCS3/UART3_CTS_b/I2S0_MCLK/FTM3_CH1/USB_SOF_OUT, label: 'J15[G1]/SD_CARD_DETECT', identifier: SDHC_CD}
71- {pin_num: '98', pin_signal: ADC0_SE6b/PTD5/SPI0_PCS2/UART0_CTS_b/UART0_COL_b/FTM0_CH5/FB_AD1/EWM_OUT_b/SPI1_SCK, label: 'J6[5]/RF_WIFI_SCK', identifier: WIFI_SCK}
72- {pin_num: '100', pin_signal: PTD7/CMT_IRO/UART0_TX/FTM0_CH7/FTM0_FLT1/SPI1_SIN, label: 'J6[7]/RF_WIFI_MISO', identifier: WIFI_MISO}
73- {pin_num: '97', pin_signal: PTD4/LLWU_P14/SPI0_PCS1/UART0_RTS_b/FTM0_CH4/FB_AD2/EWM_IN/SPI1_PCS0, label: 'J6[4]/RF_WIFI_CS', identifier: WIFI_CS}
74- {pin_num: '99', pin_signal: ADC0_SE7b/PTD6/LLWU_P15/SPI0_PCS3/UART0_RX/FTM0_CH6/FB_AD0/FTM0_FLT0/SPI1_SOUT, label: 'J6[6]/RF_WIFI_MOSI', identifier: WIFI_MOSI}
75- {pin_num: '92', pin_signal: PTC18/UART3_RTS_b/ENET0_1588_TMR2/FB_TBST_b/FB_CS2_b/FB_BE15_8_BLS23_16_b, label: 'J6[8]/RF_WIFI_IRQ', identifier: WIFI_IRQ;TMR_1588_2}
76- {pin_num: '86', pin_signal: PTC14/UART4_RX/FB_AD25, label: 'J199[3]/BT_TX'}
77- {pin_num: '87', pin_signal: PTC15/UART4_TX/FB_AD24, label: 'J199[4]/BT_RX'}
78- {pin_num: '54', pin_signal: ADC0_SE9/ADC1_SE9/PTB1/I2C0_SDA/FTM1_CH1/RMII0_MDC/MII0_MDC/FTM1_QD_PHB, label: 'U13[11]/RMII0_MDC', identifier: RMII0_MDC}
79- {pin_num: '53', pin_signal: ADC0_SE8/ADC1_SE8/PTB0/LLWU_P5/I2C0_SCL/FTM1_CH0/RMII0_MDIO/MII0_MDIO/FTM1_QD_PHA, label: 'U13[10]/RMII0_MDIO', identifier: RMII0_MDIO}
80- {pin_num: '50', pin_signal: EXTAL0/PTA18/FTM0_FLT2/FTM_CLKIN0, label: 'U13[16]/RMII_RXCLK', identifier: EXTAL0;RMII_RXCLK}
81- {pin_num: '43', pin_signal: CMP2_IN1/PTA13/LLWU_P4/CAN0_RX/FTM1_CH1/RMII0_RXD0/MII0_RXD0/I2C2_SDA/I2S0_TX_FS/FTM1_QD_PHB, label: 'U13[13]/RMII0_RXD_0', identifier: RMII0_RXD0}
82- {pin_num: '42', pin_signal: CMP2_IN0/PTA12/CAN0_TX/FTM1_CH0/RMII0_RXD1/MII0_RXD1/I2C2_SCL/I2S0_TXD0/FTM1_QD_PHA, label: 'U13[12]/RMII0_RXD_1', identifier: RMII0_RXD1}
83- {pin_num: '39', pin_signal: PTA5/USB_CLKIN/FTM0_CH2/RMII0_RXER/MII0_RXER/CMP2_OUT/I2S0_TX_BCLK/JTAG_TRST_b, label: 'U13[17]/RMII0_RXER', identifier: RMII0_RXER}
84- {pin_num: '44', pin_signal: PTA14/SPI0_PCS0/UART0_TX/RMII0_CRS_DV/MII0_RXDV/I2C2_SCL/I2S0_RX_BCLK/I2S0_TXD1, label: 'U13[15]/RMII0_CRS_DV', identifier: RMII0_CRS_DV}
85- {pin_num: '85', pin_signal: PTC13/UART4_CTS_b/FB_AD26, label: 'U8[9]', identifier: ACCEL_INT2}
86- {pin_num: '62', pin_signal: PTB16/SPI1_SOUT/UART0_RX/FTM_CLKIN0/FB_AD17/EWM_IN, label: 'U7[4]/UART0_RX', identifier: DEBUG_UART_RX}
87- {pin_num: '63', pin_signal: PTB17/SPI1_SIN/UART0_TX/FTM_CLKIN1/FB_AD16/EWM_OUT_b, label: 'U10[1]/UART0_TX', identifier: DEBUG_UART_TX}
88- {pin_num: '37', pin_signal: PTA3/UART0_RTS_b/FTM0_CH0/JTAG_TMS/SWD_DIO, label: 'J9[2]/SWD_DIO'}
89- {pin_num: '34', pin_signal: PTA0/UART0_CTS_b/UART0_COL_b/FTM0_CH5/JTAG_TCLK/SWD_CLK/EZP_CLK, label: 'J9[4]/SWD_CLK'}
90- {pin_num: '68', pin_signal: PTB22/SPI2_SOUT/FB_AD29/CMP2_OUT, label: 'D12[1]/LEDRGB_RED', identifier: LED_RED}
91- {pin_num: '67', pin_signal: PTB21/SPI2_SCK/FB_AD30/CMP1_OUT, label: 'D12[3]/LEDRGB_BLUE', identifier: LED_BLUE}
92- {pin_num: '13', pin_signal: VREGIN, label: VREGIN_K64}
93- {pin_num: '29', pin_signal: EXTAL32, label: 'Y3[2]/EXTAL32_RTC', identifier: ETAL32K}
94- {pin_num: '28', pin_signal: XTAL32, label: 'Y3[1]/XTAL32_RTC', identifier: XTAL32K}
95- {pin_num: '51', pin_signal: XTAL0/PTA19/FTM1_FLT0/FTM_CLKIN1/LPTMR0_ALT1, label: GND}
96- {pin_num: '30', pin_signal: VBAT, label: VBAT}
97- {pin_num: '8', pin_signal: VDD16, label: P3V3_K64F}
98- {pin_num: '22', pin_signal: VDDA, label: P3V3_K64F}
99- {pin_num: '12', pin_signal: VOUT33, label: VOUT33_K64}
100- {pin_num: '10', pin_signal: USB0_DP, label: 'J22[3]/K64_MICRO_USB_DP', identifier: USB_DP}
101- {pin_num: '11', pin_signal: USB0_DM, label: 'J22[2]/K64_MICRO_USB_DN', identifier: USB_DM}
102- {pin_num: '23', pin_signal: VREFH, label: VREFH}
103- {pin_num: '45', pin_signal: PTA15/SPI0_SCK/UART0_RX/RMII0_TXEN/MII0_TXEN/I2S0_RXD0, label: 'U13[19]/RMII0_TXEN', identifier: RMII0_TXEN}
104- {pin_num: '46', pin_signal: PTA16/SPI0_SOUT/UART0_CTS_b/UART0_COL_b/RMII0_TXD0/MII0_TXD0/I2S0_RX_FS/I2S0_RXD1, label: 'U13[20]/RMII0_TXD0', identifier: RMII0_TXD0}
105- {pin_num: '47', pin_signal: ADC1_SE17/PTA17/SPI0_SIN/UART0_RTS_b/RMII0_TXD1/MII0_TXD1/I2S0_MCLK, label: 'U13[21]/RMII0_TXD1', identifier: RMII0_TXD1}
106- {pin_num: '24', pin_signal: VREFL, label: GND}
107- {pin_num: '9', pin_signal: VSS17, label: GND}
108- {pin_num: '40', pin_signal: VDD63, label: P3V3_K64F}
109- {pin_num: '25', pin_signal: VSSA, label: GND}
110- {pin_num: '41', pin_signal: VSS64, label: GND}
111- {pin_num: '48', pin_signal: VDD80, label: P3V3_K64F}
112- {pin_num: '49', pin_signal: VSS81, label: GND}
113- {pin_num: '61', pin_signal: VDD110, label: P3V3_K64F}
114- {pin_num: '75', pin_signal: VDD124, label: P3V3_K64F}
115- {pin_num: '89', pin_signal: VDD140, label: P3V3_K64F}
116- {pin_num: '60', pin_signal: VSS109, label: GND}
117- {pin_num: '74', pin_signal: VSS123, label: GND}
118- {pin_num: '88', pin_signal: VSS139, label: GND}
119 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
120 */
121/* clang-format on */
122
123#include "fsl_common.h"
124#include "fsl_port.h"
125#include "fsl_gpio.h"
126#include "pin_mux.h"
127
128/* FUNCTION ************************************************************************************************************
129 *
130 * Function Name : BOARD_InitBootPins
131 * Description : Calls initialization functions.
132 *
133 * END ****************************************************************************************************************/
134void BOARD_InitBootPins(void)
135{
136 BOARD_InitPins();
137 BOARD_InitDEBUG_UARTPins();
138}
139
140/* clang-format off */
141/*
142 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
143BOARD_InitPins:
144- options: {callFromInitBoot: 'true', prefix: BOARD_, coreID: core0, enableClock: 'true'}
145- pin_list:
146 - {pin_num: '36', peripheral: TPIU, signal: SWO, pin_signal: PTA2/UART0_TX/FTM0_CH7/JTAG_TDO/TRACE_SWO/EZP_DO, drive_strength: low, pull_select: down, pull_enable: disable}
147 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
148 */
149/* clang-format on */
150
151/* FUNCTION ************************************************************************************************************
152 *
153 * Function Name : BOARD_InitPins
154 * Description : Configures pin routing and optionally pin electrical features.
155 *
156 * END ****************************************************************************************************************/
157void BOARD_InitPins(void)
158{
159 /* Port A Clock Gate Control: Clock enabled */
160 CLOCK_EnableClock(kCLOCK_PortA);
161
162 /* PORTA2 (pin 36) is configured as TRACE_SWO */
163 PORT_SetPinMux(PORTA, 2U, kPORT_MuxAlt7);
164
165 PORTA->PCR[2] = ((PORTA->PCR[2] &
166 /* Mask bits to zero which are setting */
167 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_DSE_MASK | PORT_PCR_ISF_MASK)))
168
169 /* Pull Select: Internal pulldown resistor is enabled on the corresponding pin, if the
170 * corresponding PE field is set. */
171 | PORT_PCR_PS(kPORT_PullDown)
172
173 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
174 | PORT_PCR_PE(kPORT_PullDisable)
175
176 /* Drive Strength Enable: Low drive strength is configured on the corresponding pin, if pin
177 * is configured as a digital output. */
178 | PORT_PCR_DSE(kPORT_LowDriveStrength));
179}
180
181/* clang-format off */
182/*
183 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
184BOARD_InitButtonsPins:
185- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
186- pin_list:
187 - {pin_num: '78', peripheral: GPIOC, signal: 'GPIO, 6', pin_signal: CMP0_IN0/PTC6/LLWU_P10/SPI0_SOUT/PDB0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK, identifier: SW2,
188 direction: INPUT, gpio_interrupt: kPORT_InterruptFallingEdge, slew_rate: fast, open_drain: disable, drive_strength: low, pull_select: up, pull_enable: enable,
189 passive_filter: disable}
190 - {pin_num: '38', peripheral: GPIOA, signal: 'GPIO, 4', pin_signal: PTA4/LLWU_P3/FTM0_CH1/NMI_b/EZP_CS_b, direction: INPUT, gpio_interrupt: kPORT_InterruptFallingEdge,
191 slew_rate: fast, open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
192 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
193 */
194/* clang-format on */
195
196/* FUNCTION ************************************************************************************************************
197 *
198 * Function Name : BOARD_InitButtonsPins
199 * Description : Configures pin routing and optionally pin electrical features.
200 *
201 * END ****************************************************************************************************************/
202void BOARD_InitButtonsPins(void)
203{
204 /* Port A Clock Gate Control: Clock enabled */
205 CLOCK_EnableClock(kCLOCK_PortA);
206 /* Port C Clock Gate Control: Clock enabled */
207 CLOCK_EnableClock(kCLOCK_PortC);
208
209 gpio_pin_config_t SW3_config = {
210 .pinDirection = kGPIO_DigitalInput,
211 .outputLogic = 0U
212 };
213 /* Initialize GPIO functionality on pin PTA4 (pin 38) */
214 GPIO_PinInit(BOARD_SW3_GPIO, BOARD_SW3_PIN, &SW3_config);
215
216 gpio_pin_config_t SW2_config = {
217 .pinDirection = kGPIO_DigitalInput,
218 .outputLogic = 0U
219 };
220 /* Initialize GPIO functionality on pin PTC6 (pin 78) */
221 GPIO_PinInit(BOARD_SW2_GPIO, BOARD_SW2_PIN, &SW2_config);
222
223 const port_pin_config_t SW3 = {/* Internal pull-up/down resistor is disabled */
224 kPORT_PullDisable,
225 /* Fast slew rate is configured */
226 kPORT_FastSlewRate,
227 /* Passive filter is disabled */
228 kPORT_PassiveFilterDisable,
229 /* Open drain is disabled */
230 kPORT_OpenDrainDisable,
231 /* Low drive strength is configured */
232 kPORT_LowDriveStrength,
233 /* Pin is configured as PTA4 */
234 kPORT_MuxAsGpio,
235 /* Pin Control Register fields [15:0] are not locked */
236 kPORT_UnlockRegister};
237 /* PORTA4 (pin 38) is configured as PTA4 */
238 PORT_SetPinConfig(BOARD_SW3_PORT, BOARD_SW3_PIN, &SW3);
239
240 /* Interrupt configuration on PORTA4 (pin 38): Interrupt on falling edge */
241 PORT_SetPinInterruptConfig(BOARD_SW3_PORT, BOARD_SW3_PIN, kPORT_InterruptFallingEdge);
242
243 const port_pin_config_t SW2 = {/* Internal pull-up resistor is enabled */
244 kPORT_PullUp,
245 /* Fast slew rate is configured */
246 kPORT_FastSlewRate,
247 /* Passive filter is disabled */
248 kPORT_PassiveFilterDisable,
249 /* Open drain is disabled */
250 kPORT_OpenDrainDisable,
251 /* Low drive strength is configured */
252 kPORT_LowDriveStrength,
253 /* Pin is configured as PTC6 */
254 kPORT_MuxAsGpio,
255 /* Pin Control Register fields [15:0] are not locked */
256 kPORT_UnlockRegister};
257 /* PORTC6 (pin 78) is configured as PTC6 */
258 PORT_SetPinConfig(BOARD_SW2_PORT, BOARD_SW2_PIN, &SW2);
259
260 /* Interrupt configuration on PORTC6 (pin 78): Interrupt on falling edge */
261 PORT_SetPinInterruptConfig(BOARD_SW2_PORT, BOARD_SW2_PIN, kPORT_InterruptFallingEdge);
262}
263
264/* clang-format off */
265/*
266 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
267BOARD_InitLEDsPins:
268- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
269- pin_list:
270 - {pin_num: '67', peripheral: GPIOB, signal: 'GPIO, 21', pin_signal: PTB21/SPI2_SCK/FB_AD30/CMP1_OUT, direction: OUTPUT, gpio_init_state: 'true', slew_rate: slow,
271 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
272 - {pin_num: '68', peripheral: GPIOB, signal: 'GPIO, 22', pin_signal: PTB22/SPI2_SOUT/FB_AD29/CMP2_OUT, direction: OUTPUT, gpio_init_state: 'true', slew_rate: slow,
273 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
274 - {pin_num: '33', peripheral: GPIOE, signal: 'GPIO, 26', pin_signal: PTE26/ENET_1588_CLKIN/UART4_CTS_b/RTC_CLKOUT/USB_CLKIN, direction: OUTPUT, gpio_init_state: 'true',
275 slew_rate: slow, open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
276 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
277 */
278/* clang-format on */
279
280/* FUNCTION ************************************************************************************************************
281 *
282 * Function Name : BOARD_InitLEDsPins
283 * Description : Configures pin routing and optionally pin electrical features.
284 *
285 * END ****************************************************************************************************************/
286void BOARD_InitLEDsPins(void)
287{
288 /* Port B Clock Gate Control: Clock enabled */
289 CLOCK_EnableClock(kCLOCK_PortB);
290 /* Port E Clock Gate Control: Clock enabled */
291 CLOCK_EnableClock(kCLOCK_PortE);
292
293 gpio_pin_config_t LED_BLUE_config = {
294 .pinDirection = kGPIO_DigitalOutput,
295 .outputLogic = 1U
296 };
297 /* Initialize GPIO functionality on pin PTB21 (pin 67) */
298 GPIO_PinInit(BOARD_LED_BLUE_GPIO, BOARD_LED_BLUE_PIN, &LED_BLUE_config);
299
300 gpio_pin_config_t LED_RED_config = {
301 .pinDirection = kGPIO_DigitalOutput,
302 .outputLogic = 1U
303 };
304 /* Initialize GPIO functionality on pin PTB22 (pin 68) */
305 GPIO_PinInit(BOARD_LED_RED_GPIO, BOARD_LED_RED_PIN, &LED_RED_config);
306
307 gpio_pin_config_t LED_GREEN_config = {
308 .pinDirection = kGPIO_DigitalOutput,
309 .outputLogic = 1U
310 };
311 /* Initialize GPIO functionality on pin PTE26 (pin 33) */
312 GPIO_PinInit(BOARD_LED_GREEN_GPIO, BOARD_LED_GREEN_PIN, &LED_GREEN_config);
313
314 const port_pin_config_t LED_BLUE = {/* Internal pull-up/down resistor is disabled */
315 kPORT_PullDisable,
316 /* Slow slew rate is configured */
317 kPORT_SlowSlewRate,
318 /* Passive filter is disabled */
319 kPORT_PassiveFilterDisable,
320 /* Open drain is disabled */
321 kPORT_OpenDrainDisable,
322 /* Low drive strength is configured */
323 kPORT_LowDriveStrength,
324 /* Pin is configured as PTB21 */
325 kPORT_MuxAsGpio,
326 /* Pin Control Register fields [15:0] are not locked */
327 kPORT_UnlockRegister};
328 /* PORTB21 (pin 67) is configured as PTB21 */
329 PORT_SetPinConfig(BOARD_LED_BLUE_PORT, BOARD_LED_BLUE_PIN, &LED_BLUE);
330
331 const port_pin_config_t LED_RED = {/* Internal pull-up/down resistor is disabled */
332 kPORT_PullDisable,
333 /* Slow slew rate is configured */
334 kPORT_SlowSlewRate,
335 /* Passive filter is disabled */
336 kPORT_PassiveFilterDisable,
337 /* Open drain is disabled */
338 kPORT_OpenDrainDisable,
339 /* Low drive strength is configured */
340 kPORT_LowDriveStrength,
341 /* Pin is configured as PTB22 */
342 kPORT_MuxAsGpio,
343 /* Pin Control Register fields [15:0] are not locked */
344 kPORT_UnlockRegister};
345 /* PORTB22 (pin 68) is configured as PTB22 */
346 PORT_SetPinConfig(BOARD_LED_RED_PORT, BOARD_LED_RED_PIN, &LED_RED);
347
348 const port_pin_config_t LED_GREEN = {/* Internal pull-up/down resistor is disabled */
349 kPORT_PullDisable,
350 /* Slow slew rate is configured */
351 kPORT_SlowSlewRate,
352 /* Passive filter is disabled */
353 kPORT_PassiveFilterDisable,
354 /* Open drain is disabled */
355 kPORT_OpenDrainDisable,
356 /* Low drive strength is configured */
357 kPORT_LowDriveStrength,
358 /* Pin is configured as PTE26 */
359 kPORT_MuxAsGpio,
360 /* Pin Control Register fields [15:0] are not locked */
361 kPORT_UnlockRegister};
362 /* PORTE26 (pin 33) is configured as PTE26 */
363 PORT_SetPinConfig(BOARD_LED_GREEN_PORT, BOARD_LED_GREEN_PIN, &LED_GREEN);
364}
365
366/* clang-format off */
367/*
368 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
369BOARD_InitDEBUG_UARTPins:
370- options: {callFromInitBoot: 'true', prefix: BOARD_, coreID: core0, enableClock: 'true'}
371- pin_list:
372 - {pin_num: '63', peripheral: UART0, signal: TX, pin_signal: PTB17/SPI1_SIN/UART0_TX/FTM_CLKIN1/FB_AD16/EWM_OUT_b, direction: OUTPUT, slew_rate: fast, open_drain: disable,
373 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
374 - {pin_num: '62', peripheral: UART0, signal: RX, pin_signal: PTB16/SPI1_SOUT/UART0_RX/FTM_CLKIN0/FB_AD17/EWM_IN, slew_rate: fast, open_drain: disable, drive_strength: low,
375 pull_select: down, pull_enable: disable, passive_filter: disable}
376 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
377 */
378/* clang-format on */
379
380/* FUNCTION ************************************************************************************************************
381 *
382 * Function Name : BOARD_InitDEBUG_UARTPins
383 * Description : Configures pin routing and optionally pin electrical features.
384 *
385 * END ****************************************************************************************************************/
386void BOARD_InitDEBUG_UARTPins(void)
387{
388 /* Port B Clock Gate Control: Clock enabled */
389 CLOCK_EnableClock(kCLOCK_PortB);
390
391 const port_pin_config_t DEBUG_UART_RX = {/* Internal pull-up/down resistor is disabled */
392 kPORT_PullDisable,
393 /* Fast slew rate is configured */
394 kPORT_FastSlewRate,
395 /* Passive filter is disabled */
396 kPORT_PassiveFilterDisable,
397 /* Open drain is disabled */
398 kPORT_OpenDrainDisable,
399 /* Low drive strength is configured */
400 kPORT_LowDriveStrength,
401 /* Pin is configured as UART0_RX */
402 kPORT_MuxAlt3,
403 /* Pin Control Register fields [15:0] are not locked */
404 kPORT_UnlockRegister};
405 /* PORTB16 (pin 62) is configured as UART0_RX */
406 PORT_SetPinConfig(BOARD_DEBUG_UART_RX_PORT, BOARD_DEBUG_UART_RX_PIN, &DEBUG_UART_RX);
407
408 const port_pin_config_t DEBUG_UART_TX = {/* Internal pull-up/down resistor is disabled */
409 kPORT_PullDisable,
410 /* Fast slew rate is configured */
411 kPORT_FastSlewRate,
412 /* Passive filter is disabled */
413 kPORT_PassiveFilterDisable,
414 /* Open drain is disabled */
415 kPORT_OpenDrainDisable,
416 /* Low drive strength is configured */
417 kPORT_LowDriveStrength,
418 /* Pin is configured as UART0_TX */
419 kPORT_MuxAlt3,
420 /* Pin Control Register fields [15:0] are not locked */
421 kPORT_UnlockRegister};
422 /* PORTB17 (pin 63) is configured as UART0_TX */
423 PORT_SetPinConfig(BOARD_DEBUG_UART_TX_PORT, BOARD_DEBUG_UART_TX_PIN, &DEBUG_UART_TX);
424
425 SIM->SOPT5 = ((SIM->SOPT5 &
426 /* Mask bits to zero which are setting */
427 (~(SIM_SOPT5_UART0TXSRC_MASK)))
428
429 /* UART 0 transmit data source select: UART0_TX pin. */
430 | SIM_SOPT5_UART0TXSRC(SOPT5_UART0TXSRC_UART_TX));
431}
432
433/* clang-format off */
434/*
435 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
436BOARD_InitOSCPins:
437- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
438- pin_list:
439 - {pin_num: '50', peripheral: OSC, signal: EXTAL0, pin_signal: EXTAL0/PTA18/FTM0_FLT2/FTM_CLKIN0, identifier: EXTAL0, slew_rate: no_init, open_drain: no_init, drive_strength: no_init,
440 pull_select: no_init, pull_enable: no_init, passive_filter: no_init}
441 - {pin_num: '29', peripheral: RTC, signal: EXTAL32, pin_signal: EXTAL32}
442 - {pin_num: '28', peripheral: RTC, signal: XTAL32, pin_signal: XTAL32}
443 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
444 */
445/* clang-format on */
446
447/* FUNCTION ************************************************************************************************************
448 *
449 * Function Name : BOARD_InitOSCPins
450 * Description : Configures pin routing and optionally pin electrical features.
451 *
452 * END ****************************************************************************************************************/
453void BOARD_InitOSCPins(void)
454{
455 /* Port A Clock Gate Control: Clock enabled */
456 CLOCK_EnableClock(kCLOCK_PortA);
457
458 /* PORTA18 (pin 50) is configured as EXTAL0 */
459 PORT_SetPinMux(BOARD_EXTAL0_PORT, BOARD_EXTAL0_PIN, kPORT_PinDisabledOrAnalog);
460}
461
462/* clang-format off */
463/*
464 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
465BOARD_InitACCELPins:
466- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
467- pin_list:
468 - {pin_num: '32', peripheral: I2C0, signal: SDA, pin_signal: ADC0_SE18/PTE25/UART4_RX/I2C0_SDA/EWM_IN, slew_rate: fast, open_drain: enable, drive_strength: low,
469 pull_select: down, pull_enable: disable, passive_filter: disable}
470 - {pin_num: '31', peripheral: I2C0, signal: SCL, pin_signal: ADC0_SE17/PTE24/UART4_TX/I2C0_SCL/EWM_OUT_b, slew_rate: fast, open_drain: enable, drive_strength: low,
471 pull_select: down, pull_enable: disable, passive_filter: disable}
472 - {pin_num: '78', peripheral: GPIOC, signal: 'GPIO, 6', pin_signal: CMP0_IN0/PTC6/LLWU_P10/SPI0_SOUT/PDB0_EXTRG/I2S0_RX_BCLK/FB_AD9/I2S0_MCLK, identifier: ACCEL_INT1,
473 direction: INPUT, slew_rate: fast, open_drain: enable, drive_strength: low, pull_select: up, pull_enable: enable, passive_filter: disable}
474 - {pin_num: '85', peripheral: GPIOC, signal: 'GPIO, 13', pin_signal: PTC13/UART4_CTS_b/FB_AD26, direction: INPUT, slew_rate: fast, open_drain: enable, drive_strength: low,
475 pull_select: up, pull_enable: enable, passive_filter: disable}
476 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
477 */
478/* clang-format on */
479
480/* FUNCTION ************************************************************************************************************
481 *
482 * Function Name : BOARD_InitACCELPins
483 * Description : Configures pin routing and optionally pin electrical features.
484 *
485 * END ****************************************************************************************************************/
486void BOARD_InitACCELPins(void)
487{
488 /* Port C Clock Gate Control: Clock enabled */
489 CLOCK_EnableClock(kCLOCK_PortC);
490 /* Port E Clock Gate Control: Clock enabled */
491 CLOCK_EnableClock(kCLOCK_PortE);
492
493 gpio_pin_config_t ACCEL_INT1_config = {
494 .pinDirection = kGPIO_DigitalInput,
495 .outputLogic = 0U
496 };
497 /* Initialize GPIO functionality on pin PTC6 (pin 78) */
498 GPIO_PinInit(BOARD_ACCEL_INT1_GPIO, BOARD_ACCEL_INT1_PIN, &ACCEL_INT1_config);
499
500 gpio_pin_config_t ACCEL_INT2_config = {
501 .pinDirection = kGPIO_DigitalInput,
502 .outputLogic = 0U
503 };
504 /* Initialize GPIO functionality on pin PTC13 (pin 85) */
505 GPIO_PinInit(BOARD_ACCEL_INT2_GPIO, BOARD_ACCEL_INT2_PIN, &ACCEL_INT2_config);
506
507 const port_pin_config_t ACCEL_INT2 = {/* Internal pull-up resistor is enabled */
508 kPORT_PullUp,
509 /* Fast slew rate is configured */
510 kPORT_FastSlewRate,
511 /* Passive filter is disabled */
512 kPORT_PassiveFilterDisable,
513 /* Open drain is enabled */
514 kPORT_OpenDrainEnable,
515 /* Low drive strength is configured */
516 kPORT_LowDriveStrength,
517 /* Pin is configured as PTC13 */
518 kPORT_MuxAsGpio,
519 /* Pin Control Register fields [15:0] are not locked */
520 kPORT_UnlockRegister};
521 /* PORTC13 (pin 85) is configured as PTC13 */
522 PORT_SetPinConfig(BOARD_ACCEL_INT2_PORT, BOARD_ACCEL_INT2_PIN, &ACCEL_INT2);
523
524 const port_pin_config_t ACCEL_INT1 = {/* Internal pull-up resistor is enabled */
525 kPORT_PullUp,
526 /* Fast slew rate is configured */
527 kPORT_FastSlewRate,
528 /* Passive filter is disabled */
529 kPORT_PassiveFilterDisable,
530 /* Open drain is enabled */
531 kPORT_OpenDrainEnable,
532 /* Low drive strength is configured */
533 kPORT_LowDriveStrength,
534 /* Pin is configured as PTC6 */
535 kPORT_MuxAsGpio,
536 /* Pin Control Register fields [15:0] are not locked */
537 kPORT_UnlockRegister};
538 /* PORTC6 (pin 78) is configured as PTC6 */
539 PORT_SetPinConfig(BOARD_ACCEL_INT1_PORT, BOARD_ACCEL_INT1_PIN, &ACCEL_INT1);
540
541 const port_pin_config_t ACCEL_SCL = {/* Internal pull-up/down resistor is disabled */
542 kPORT_PullDisable,
543 /* Fast slew rate is configured */
544 kPORT_FastSlewRate,
545 /* Passive filter is disabled */
546 kPORT_PassiveFilterDisable,
547 /* Open drain is enabled */
548 kPORT_OpenDrainEnable,
549 /* Low drive strength is configured */
550 kPORT_LowDriveStrength,
551 /* Pin is configured as I2C0_SCL */
552 kPORT_MuxAlt5,
553 /* Pin Control Register fields [15:0] are not locked */
554 kPORT_UnlockRegister};
555 /* PORTE24 (pin 31) is configured as I2C0_SCL */
556 PORT_SetPinConfig(BOARD_ACCEL_SCL_PORT, BOARD_ACCEL_SCL_PIN, &ACCEL_SCL);
557
558 const port_pin_config_t ACCEL_SDA = {/* Internal pull-up/down resistor is disabled */
559 kPORT_PullDisable,
560 /* Fast slew rate is configured */
561 kPORT_FastSlewRate,
562 /* Passive filter is disabled */
563 kPORT_PassiveFilterDisable,
564 /* Open drain is enabled */
565 kPORT_OpenDrainEnable,
566 /* Low drive strength is configured */
567 kPORT_LowDriveStrength,
568 /* Pin is configured as I2C0_SDA */
569 kPORT_MuxAlt5,
570 /* Pin Control Register fields [15:0] are not locked */
571 kPORT_UnlockRegister};
572 /* PORTE25 (pin 32) is configured as I2C0_SDA */
573 PORT_SetPinConfig(BOARD_ACCEL_SDA_PORT, BOARD_ACCEL_SDA_PIN, &ACCEL_SDA);
574}
575
576/* clang-format off */
577/*
578 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
579BOARD_InitENETPins:
580- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
581- pin_list:
582 - {pin_num: '54', peripheral: ENET, signal: RMII_MDC, pin_signal: ADC0_SE9/ADC1_SE9/PTB1/I2C0_SDA/FTM1_CH1/RMII0_MDC/MII0_MDC/FTM1_QD_PHB, slew_rate: fast, open_drain: disable,
583 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
584 - {pin_num: '53', peripheral: ENET, signal: RMII_MDIO, pin_signal: ADC0_SE8/ADC1_SE8/PTB0/LLWU_P5/I2C0_SCL/FTM1_CH0/RMII0_MDIO/MII0_MDIO/FTM1_QD_PHA, slew_rate: fast,
585 open_drain: enable, drive_strength: low, pull_select: up, pull_enable: enable, passive_filter: disable}
586 - {pin_num: '43', peripheral: ENET, signal: RMII_RXD0, pin_signal: CMP2_IN1/PTA13/LLWU_P4/CAN0_RX/FTM1_CH1/RMII0_RXD0/MII0_RXD0/I2C2_SDA/I2S0_TX_FS/FTM1_QD_PHB,
587 slew_rate: fast, open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
588 - {pin_num: '42', peripheral: ENET, signal: RMII_RXD1, pin_signal: CMP2_IN0/PTA12/CAN0_TX/FTM1_CH0/RMII0_RXD1/MII0_RXD1/I2C2_SCL/I2S0_TXD0/FTM1_QD_PHA, slew_rate: fast,
589 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
590 - {pin_num: '39', peripheral: ENET, signal: RMII_RXER, pin_signal: PTA5/USB_CLKIN/FTM0_CH2/RMII0_RXER/MII0_RXER/CMP2_OUT/I2S0_TX_BCLK/JTAG_TRST_b, slew_rate: fast,
591 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
592 - {pin_num: '46', peripheral: ENET, signal: RMII_TXD0, pin_signal: PTA16/SPI0_SOUT/UART0_CTS_b/UART0_COL_b/RMII0_TXD0/MII0_TXD0/I2S0_RX_FS/I2S0_RXD1, slew_rate: fast,
593 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
594 - {pin_num: '47', peripheral: ENET, signal: RMII_TXD1, pin_signal: ADC1_SE17/PTA17/SPI0_SIN/UART0_RTS_b/RMII0_TXD1/MII0_TXD1/I2S0_MCLK, slew_rate: fast, open_drain: disable,
595 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
596 - {pin_num: '45', peripheral: ENET, signal: RMII_TXEN, pin_signal: PTA15/SPI0_SCK/UART0_RX/RMII0_TXEN/MII0_TXEN/I2S0_RXD0, slew_rate: fast, open_drain: disable,
597 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
598 - {pin_num: '44', peripheral: ENET, signal: RMII_CRS_DV, pin_signal: PTA14/SPI0_PCS0/UART0_TX/RMII0_CRS_DV/MII0_RXDV/I2C2_SCL/I2S0_RX_BCLK/I2S0_TXD1, slew_rate: fast,
599 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
600 - {pin_num: '50', peripheral: ENET, signal: RMII_CLKIN, pin_signal: EXTAL0/PTA18/FTM0_FLT2/FTM_CLKIN0, identifier: RMII_RXCLK, slew_rate: fast, open_drain: disable,
601 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
602 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
603 */
604/* clang-format on */
605
606/* FUNCTION ************************************************************************************************************
607 *
608 * Function Name : BOARD_InitENETPins
609 * Description : Configures pin routing and optionally pin electrical features.
610 *
611 * END ****************************************************************************************************************/
612void BOARD_InitENETPins(void)
613{
614 /* Port A Clock Gate Control: Clock enabled */
615 CLOCK_EnableClock(kCLOCK_PortA);
616 /* Port B Clock Gate Control: Clock enabled */
617 CLOCK_EnableClock(kCLOCK_PortB);
618
619 const port_pin_config_t RMII0_RXD1 = {/* Internal pull-up/down resistor is disabled */
620 kPORT_PullDisable,
621 /* Fast slew rate is configured */
622 kPORT_FastSlewRate,
623 /* Passive filter is disabled */
624 kPORT_PassiveFilterDisable,
625 /* Open drain is disabled */
626 kPORT_OpenDrainDisable,
627 /* Low drive strength is configured */
628 kPORT_LowDriveStrength,
629 /* Pin is configured as RMII0_RXD1 */
630 kPORT_MuxAlt4,
631 /* Pin Control Register fields [15:0] are not locked */
632 kPORT_UnlockRegister};
633 /* PORTA12 (pin 42) is configured as RMII0_RXD1 */
634 PORT_SetPinConfig(BOARD_RMII0_RXD1_PORT, BOARD_RMII0_RXD1_PIN, &RMII0_RXD1);
635
636 const port_pin_config_t RMII0_RXD0 = {/* Internal pull-up/down resistor is disabled */
637 kPORT_PullDisable,
638 /* Fast slew rate is configured */
639 kPORT_FastSlewRate,
640 /* Passive filter is disabled */
641 kPORT_PassiveFilterDisable,
642 /* Open drain is disabled */
643 kPORT_OpenDrainDisable,
644 /* Low drive strength is configured */
645 kPORT_LowDriveStrength,
646 /* Pin is configured as RMII0_RXD0 */
647 kPORT_MuxAlt4,
648 /* Pin Control Register fields [15:0] are not locked */
649 kPORT_UnlockRegister};
650 /* PORTA13 (pin 43) is configured as RMII0_RXD0 */
651 PORT_SetPinConfig(BOARD_RMII0_RXD0_PORT, BOARD_RMII0_RXD0_PIN, &RMII0_RXD0);
652
653 const port_pin_config_t RMII0_CRS_DV = {/* Internal pull-up/down resistor is disabled */
654 kPORT_PullDisable,
655 /* Fast slew rate is configured */
656 kPORT_FastSlewRate,
657 /* Passive filter is disabled */
658 kPORT_PassiveFilterDisable,
659 /* Open drain is disabled */
660 kPORT_OpenDrainDisable,
661 /* Low drive strength is configured */
662 kPORT_LowDriveStrength,
663 /* Pin is configured as RMII0_CRS_DV */
664 kPORT_MuxAlt4,
665 /* Pin Control Register fields [15:0] are not locked */
666 kPORT_UnlockRegister};
667 /* PORTA14 (pin 44) is configured as RMII0_CRS_DV */
668 PORT_SetPinConfig(BOARD_RMII0_CRS_DV_PORT, BOARD_RMII0_CRS_DV_PIN, &RMII0_CRS_DV);
669
670 const port_pin_config_t RMII0_TXEN = {/* Internal pull-up/down resistor is disabled */
671 kPORT_PullDisable,
672 /* Fast slew rate is configured */
673 kPORT_FastSlewRate,
674 /* Passive filter is disabled */
675 kPORT_PassiveFilterDisable,
676 /* Open drain is disabled */
677 kPORT_OpenDrainDisable,
678 /* Low drive strength is configured */
679 kPORT_LowDriveStrength,
680 /* Pin is configured as RMII0_TXEN */
681 kPORT_MuxAlt4,
682 /* Pin Control Register fields [15:0] are not locked */
683 kPORT_UnlockRegister};
684 /* PORTA15 (pin 45) is configured as RMII0_TXEN */
685 PORT_SetPinConfig(BOARD_RMII0_TXEN_PORT, BOARD_RMII0_TXEN_PIN, &RMII0_TXEN);
686
687 const port_pin_config_t RMII0_TXD0 = {/* Internal pull-up/down resistor is disabled */
688 kPORT_PullDisable,
689 /* Fast slew rate is configured */
690 kPORT_FastSlewRate,
691 /* Passive filter is disabled */
692 kPORT_PassiveFilterDisable,
693 /* Open drain is disabled */
694 kPORT_OpenDrainDisable,
695 /* Low drive strength is configured */
696 kPORT_LowDriveStrength,
697 /* Pin is configured as RMII0_TXD0 */
698 kPORT_MuxAlt4,
699 /* Pin Control Register fields [15:0] are not locked */
700 kPORT_UnlockRegister};
701 /* PORTA16 (pin 46) is configured as RMII0_TXD0 */
702 PORT_SetPinConfig(BOARD_RMII0_TXD0_PORT, BOARD_RMII0_TXD0_PIN, &RMII0_TXD0);
703
704 const port_pin_config_t RMII0_TXD1 = {/* Internal pull-up/down resistor is disabled */
705 kPORT_PullDisable,
706 /* Fast slew rate is configured */
707 kPORT_FastSlewRate,
708 /* Passive filter is disabled */
709 kPORT_PassiveFilterDisable,
710 /* Open drain is disabled */
711 kPORT_OpenDrainDisable,
712 /* Low drive strength is configured */
713 kPORT_LowDriveStrength,
714 /* Pin is configured as RMII0_TXD1 */
715 kPORT_MuxAlt4,
716 /* Pin Control Register fields [15:0] are not locked */
717 kPORT_UnlockRegister};
718 /* PORTA17 (pin 47) is configured as RMII0_TXD1 */
719 PORT_SetPinConfig(BOARD_RMII0_TXD1_PORT, BOARD_RMII0_TXD1_PIN, &RMII0_TXD1);
720
721 const port_pin_config_t RMII_RXCLK = {/* Internal pull-up/down resistor is disabled */
722 kPORT_PullDisable,
723 /* Fast slew rate is configured */
724 kPORT_FastSlewRate,
725 /* Passive filter is disabled */
726 kPORT_PassiveFilterDisable,
727 /* Open drain is disabled */
728 kPORT_OpenDrainDisable,
729 /* Low drive strength is configured */
730 kPORT_LowDriveStrength,
731 /* Pin is configured as EXTAL0 */
732 kPORT_PinDisabledOrAnalog,
733 /* Pin Control Register fields [15:0] are not locked */
734 kPORT_UnlockRegister};
735 /* PORTA18 (pin 50) is configured as EXTAL0 */
736 PORT_SetPinConfig(BOARD_RMII_RXCLK_PORT, BOARD_RMII_RXCLK_PIN, &RMII_RXCLK);
737
738 const port_pin_config_t RMII0_RXER = {/* Internal pull-up/down resistor is disabled */
739 kPORT_PullDisable,
740 /* Fast slew rate is configured */
741 kPORT_FastSlewRate,
742 /* Passive filter is disabled */
743 kPORT_PassiveFilterDisable,
744 /* Open drain is disabled */
745 kPORT_OpenDrainDisable,
746 /* Low drive strength is configured */
747 kPORT_LowDriveStrength,
748 /* Pin is configured as RMII0_RXER */
749 kPORT_MuxAlt4,
750 /* Pin Control Register fields [15:0] are not locked */
751 kPORT_UnlockRegister};
752 /* PORTA5 (pin 39) is configured as RMII0_RXER */
753 PORT_SetPinConfig(BOARD_RMII0_RXER_PORT, BOARD_RMII0_RXER_PIN, &RMII0_RXER);
754
755 const port_pin_config_t RMII0_MDIO = {/* Internal pull-up resistor is enabled */
756 kPORT_PullUp,
757 /* Fast slew rate is configured */
758 kPORT_FastSlewRate,
759 /* Passive filter is disabled */
760 kPORT_PassiveFilterDisable,
761 /* Open drain is enabled */
762 kPORT_OpenDrainEnable,
763 /* Low drive strength is configured */
764 kPORT_LowDriveStrength,
765 /* Pin is configured as RMII0_MDIO */
766 kPORT_MuxAlt4,
767 /* Pin Control Register fields [15:0] are not locked */
768 kPORT_UnlockRegister};
769 /* PORTB0 (pin 53) is configured as RMII0_MDIO */
770 PORT_SetPinConfig(BOARD_RMII0_MDIO_PORT, BOARD_RMII0_MDIO_PIN, &RMII0_MDIO);
771
772 const port_pin_config_t RMII0_MDC = {/* Internal pull-up/down resistor is disabled */
773 kPORT_PullDisable,
774 /* Fast slew rate is configured */
775 kPORT_FastSlewRate,
776 /* Passive filter is disabled */
777 kPORT_PassiveFilterDisable,
778 /* Open drain is disabled */
779 kPORT_OpenDrainDisable,
780 /* Low drive strength is configured */
781 kPORT_LowDriveStrength,
782 /* Pin is configured as RMII0_MDC */
783 kPORT_MuxAlt4,
784 /* Pin Control Register fields [15:0] are not locked */
785 kPORT_UnlockRegister};
786 /* PORTB1 (pin 54) is configured as RMII0_MDC */
787 PORT_SetPinConfig(BOARD_RMII0_MDC_PORT, BOARD_RMII0_MDC_PIN, &RMII0_MDC);
788
789 SIM->SOPT2 = ((SIM->SOPT2 &
790 /* Mask bits to zero which are setting */
791 (~(SIM_SOPT2_RMIISRC_MASK)))
792
793 /* RMII clock source select: EXTAL clock. */
794 | SIM_SOPT2_RMIISRC(SOPT2_RMIISRC_EXTAL));
795}
796
797/* clang-format off */
798/*
799 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
800BOARD_InitSDHCPins:
801- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
802- pin_list:
803 - {pin_num: '1', peripheral: SDHC, signal: 'DATA, 1', pin_signal: ADC1_SE4a/PTE0/SPI1_PCS1/UART1_TX/SDHC0_D1/TRACE_CLKOUT/I2C1_SDA/RTC_CLKOUT, slew_rate: fast,
804 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
805 - {pin_num: '2', peripheral: SDHC, signal: 'DATA, 0', pin_signal: ADC1_SE5a/PTE1/LLWU_P0/SPI1_SOUT/UART1_RX/SDHC0_D0/TRACE_D3/I2C1_SCL/SPI1_SIN, slew_rate: fast,
806 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
807 - {pin_num: '3', peripheral: SDHC, signal: DCLK, pin_signal: ADC0_DP2/ADC1_SE6a/PTE2/LLWU_P1/SPI1_SCK/UART1_CTS_b/SDHC0_DCLK/TRACE_D2, slew_rate: fast, open_drain: disable,
808 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
809 - {pin_num: '4', peripheral: SDHC, signal: CMD, pin_signal: ADC0_DM2/ADC1_SE7a/PTE3/SPI1_SIN/UART1_RTS_b/SDHC0_CMD/TRACE_D1/SPI1_SOUT, slew_rate: fast, open_drain: disable,
810 drive_strength: low, pull_select: down, pull_enable: disable, passive_filter: disable}
811 - {pin_num: '5', peripheral: SDHC, signal: 'DATA, 3', pin_signal: PTE4/LLWU_P2/SPI1_PCS0/UART3_TX/SDHC0_D3/TRACE_D0, slew_rate: fast, open_drain: disable, drive_strength: low,
812 pull_select: down, pull_enable: disable, passive_filter: disable}
813 - {pin_num: '6', peripheral: SDHC, signal: 'DATA, 2', pin_signal: PTE5/SPI1_PCS2/UART3_RX/SDHC0_D2/FTM3_CH0, slew_rate: fast, open_drain: disable, drive_strength: low,
814 pull_select: down, pull_enable: disable, passive_filter: disable}
815 - {pin_num: '7', peripheral: GPIOE, signal: 'GPIO, 6', pin_signal: PTE6/SPI1_PCS3/UART3_CTS_b/I2S0_MCLK/FTM3_CH1/USB_SOF_OUT, direction: INPUT, slew_rate: slow,
816 open_drain: disable, drive_strength: low, pull_select: down, pull_enable: enable, passive_filter: disable}
817 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
818 */
819/* clang-format on */
820
821/* FUNCTION ************************************************************************************************************
822 *
823 * Function Name : BOARD_InitSDHCPins
824 * Description : Configures pin routing and optionally pin electrical features.
825 *
826 * END ****************************************************************************************************************/
827void BOARD_InitSDHCPins(void)
828{
829 /* Port E Clock Gate Control: Clock enabled */
830 CLOCK_EnableClock(kCLOCK_PortE);
831
832 gpio_pin_config_t SDHC_CD_config = {
833 .pinDirection = kGPIO_DigitalInput,
834 .outputLogic = 0U
835 };
836 /* Initialize GPIO functionality on pin PTE6 (pin 7) */
837 GPIO_PinInit(BOARD_SDHC_CD_GPIO, BOARD_SDHC_CD_PIN, &SDHC_CD_config);
838
839 const port_pin_config_t SDHC0_D1 = {/* Internal pull-up/down resistor is disabled */
840 kPORT_PullDisable,
841 /* Fast slew rate is configured */
842 kPORT_FastSlewRate,
843 /* Passive filter is disabled */
844 kPORT_PassiveFilterDisable,
845 /* Open drain is disabled */
846 kPORT_OpenDrainDisable,
847 /* Low drive strength is configured */
848 kPORT_LowDriveStrength,
849 /* Pin is configured as SDHC0_D1 */
850 kPORT_MuxAlt4,
851 /* Pin Control Register fields [15:0] are not locked */
852 kPORT_UnlockRegister};
853 /* PORTE0 (pin 1) is configured as SDHC0_D1 */
854 PORT_SetPinConfig(BOARD_SDHC0_D1_PORT, BOARD_SDHC0_D1_PIN, &SDHC0_D1);
855
856 const port_pin_config_t SDHC0_D0 = {/* Internal pull-up/down resistor is disabled */
857 kPORT_PullDisable,
858 /* Fast slew rate is configured */
859 kPORT_FastSlewRate,
860 /* Passive filter is disabled */
861 kPORT_PassiveFilterDisable,
862 /* Open drain is disabled */
863 kPORT_OpenDrainDisable,
864 /* Low drive strength is configured */
865 kPORT_LowDriveStrength,
866 /* Pin is configured as SDHC0_D0 */
867 kPORT_MuxAlt4,
868 /* Pin Control Register fields [15:0] are not locked */
869 kPORT_UnlockRegister};
870 /* PORTE1 (pin 2) is configured as SDHC0_D0 */
871 PORT_SetPinConfig(BOARD_SDHC0_D0_PORT, BOARD_SDHC0_D0_PIN, &SDHC0_D0);
872
873 const port_pin_config_t SDHC0_DCLK = {/* Internal pull-up/down resistor is disabled */
874 kPORT_PullDisable,
875 /* Fast slew rate is configured */
876 kPORT_FastSlewRate,
877 /* Passive filter is disabled */
878 kPORT_PassiveFilterDisable,
879 /* Open drain is disabled */
880 kPORT_OpenDrainDisable,
881 /* Low drive strength is configured */
882 kPORT_LowDriveStrength,
883 /* Pin is configured as SDHC0_DCLK */
884 kPORT_MuxAlt4,
885 /* Pin Control Register fields [15:0] are not locked */
886 kPORT_UnlockRegister};
887 /* PORTE2 (pin 3) is configured as SDHC0_DCLK */
888 PORT_SetPinConfig(BOARD_SDHC0_DCLK_PORT, BOARD_SDHC0_DCLK_PIN, &SDHC0_DCLK);
889
890 const port_pin_config_t SDHC0_CMD = {/* Internal pull-up/down resistor is disabled */
891 kPORT_PullDisable,
892 /* Fast slew rate is configured */
893 kPORT_FastSlewRate,
894 /* Passive filter is disabled */
895 kPORT_PassiveFilterDisable,
896 /* Open drain is disabled */
897 kPORT_OpenDrainDisable,
898 /* Low drive strength is configured */
899 kPORT_LowDriveStrength,
900 /* Pin is configured as SDHC0_CMD */
901 kPORT_MuxAlt4,
902 /* Pin Control Register fields [15:0] are not locked */
903 kPORT_UnlockRegister};
904 /* PORTE3 (pin 4) is configured as SDHC0_CMD */
905 PORT_SetPinConfig(BOARD_SDHC0_CMD_PORT, BOARD_SDHC0_CMD_PIN, &SDHC0_CMD);
906
907 const port_pin_config_t SDHC0_D3 = {/* Internal pull-up/down resistor is disabled */
908 kPORT_PullDisable,
909 /* Fast slew rate is configured */
910 kPORT_FastSlewRate,
911 /* Passive filter is disabled */
912 kPORT_PassiveFilterDisable,
913 /* Open drain is disabled */
914 kPORT_OpenDrainDisable,
915 /* Low drive strength is configured */
916 kPORT_LowDriveStrength,
917 /* Pin is configured as SDHC0_D3 */
918 kPORT_MuxAlt4,
919 /* Pin Control Register fields [15:0] are not locked */
920 kPORT_UnlockRegister};
921 /* PORTE4 (pin 5) is configured as SDHC0_D3 */
922 PORT_SetPinConfig(BOARD_SDHC0_D3_PORT, BOARD_SDHC0_D3_PIN, &SDHC0_D3);
923
924 const port_pin_config_t SDHC0_D2 = {/* Internal pull-up/down resistor is disabled */
925 kPORT_PullDisable,
926 /* Fast slew rate is configured */
927 kPORT_FastSlewRate,
928 /* Passive filter is disabled */
929 kPORT_PassiveFilterDisable,
930 /* Open drain is disabled */
931 kPORT_OpenDrainDisable,
932 /* Low drive strength is configured */
933 kPORT_LowDriveStrength,
934 /* Pin is configured as SDHC0_D2 */
935 kPORT_MuxAlt4,
936 /* Pin Control Register fields [15:0] are not locked */
937 kPORT_UnlockRegister};
938 /* PORTE5 (pin 6) is configured as SDHC0_D2 */
939 PORT_SetPinConfig(BOARD_SDHC0_D2_PORT, BOARD_SDHC0_D2_PIN, &SDHC0_D2);
940
941 const port_pin_config_t SDHC_CD = {/* Internal pull-down resistor is enabled */
942 kPORT_PullDown,
943 /* Slow slew rate is configured */
944 kPORT_SlowSlewRate,
945 /* Passive filter is disabled */
946 kPORT_PassiveFilterDisable,
947 /* Open drain is disabled */
948 kPORT_OpenDrainDisable,
949 /* Low drive strength is configured */
950 kPORT_LowDriveStrength,
951 /* Pin is configured as PTE6 */
952 kPORT_MuxAsGpio,
953 /* Pin Control Register fields [15:0] are not locked */
954 kPORT_UnlockRegister};
955 /* PORTE6 (pin 7) is configured as PTE6 */
956 PORT_SetPinConfig(BOARD_SDHC_CD_PORT, BOARD_SDHC_CD_PIN, &SDHC_CD);
957}
958
959/* clang-format off */
960/*
961 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
962BOARD_InitUSBPins:
963- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
964- pin_list:
965 - {pin_num: '10', peripheral: USB0, signal: DP, pin_signal: USB0_DP}
966 - {pin_num: '11', peripheral: USB0, signal: DM, pin_signal: USB0_DM}
967 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
968 */
969/* clang-format on */
970
971/* FUNCTION ************************************************************************************************************
972 *
973 * Function Name : BOARD_InitUSBPins
974 * Description : Configures pin routing and optionally pin electrical features.
975 *
976 * END ****************************************************************************************************************/
977void BOARD_InitUSBPins(void)
978{
979}
980/***********************************************************************************************************************
981 * EOF
982 **********************************************************************************************************************/