aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2B31A/project_template/pin_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/devices/K32L2B31A/project_template/pin_mux.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/devices/K32L2B31A/project_template/pin_mux.c792
1 files changed, 792 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2B31A/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2B31A/project_template/pin_mux.c
new file mode 100644
index 000000000..45286b77d
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/devices/K32L2B31A/project_template/pin_mux.c
@@ -0,0 +1,792 @@
1/*
2 * Copyright 2019 NXP
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12
13/* clang-format off */
14/*
15 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
16!!GlobalInfo
17product: Pins v6.0
18processor: K32L2B31xxxxA
19package_id: K32L2B31VLH0A
20mcu_data: ksdk2_0
21processor_version: 0.0.0
22board: FRDM-K32L2B
23pin_labels:
24- {pin_num: '23', pin_signal: PTA1/LPUART0_RX/TPM2_CH0, label: 'J1[2]/D0/UART0_RX', identifier: DEBUG_UART0_RX}
25- {pin_num: '24', pin_signal: PTA2/LPUART0_TX/TPM2_CH1, label: 'J1[4]/D1/UART0_TX', identifier: DEBUG_UART0_TX}
26- {pin_num: '60', pin_signal: LCD_P43/PTD3/SPI0_MISO/UART2_TX/TPM0_CH3/SPI0_MOSI/FXIO0_D3, label: 'J1[6]/D2/LCD_P43', identifier: LCD_P43}
27- {pin_num: '28', pin_signal: PTA12/TPM1_CH0, label: 'J1[8]/D3'}
28- {pin_num: '26', pin_signal: PTA4/I2C1_SDA/TPM0_CH1/NMI_b, label: 'J1[10]/D4/SW1', identifier: SW1}
29- {pin_num: '27', pin_signal: PTA5/USB_CLKIN/TPM0_CH2, label: 'J1[12]/D5/USB_CLKIN', identifier: USB0_CLKIN}
30- {pin_num: '17', pin_signal: CMP0_IN5/ADC0_SE4b/PTE29/TPM0_CH2/TPM_CLKIN0, label: 'J1[14]/D6/CMP0_IN5'}
31- {pin_num: '18', pin_signal: DAC0_OUT/ADC0_SE23/CMP0_IN4/PTE30/TPM0_CH3/TPM_CLKIN1/LPUART1_TX/LPTMR0_ALT1, label: 'J1[16]/J4[11]/D7/CMP0_IN4/DAC_OUT'}
32- {pin_num: '29', pin_signal: PTA13/TPM1_CH1, label: 'J2[2]/D8'}
33- {pin_num: '59', pin_signal: LCD_P42/PTD2/SPI0_MOSI/UART2_RX/TPM0_CH2/SPI0_MISO/FXIO0_D2, label: 'J2[4]/D9/LCD_P42', identifier: LCD_P42}
34- {pin_num: '61', pin_signal: LCD_P44/PTD4/LLWU_P14/SPI1_SS/UART2_RX/TPM0_CH4/FXIO0_D4, label: 'J2[6]/D10/SPI1_PCS0/LCD_P44', identifier: LCD_P44}
35- {pin_num: '63', pin_signal: LCD_P46/ADC0_SE7b/PTD6/LLWU_P15/SPI1_MOSI/LPUART0_RX/SPI1_MISO/FXIO0_D6, label: 'J2[8]/D11/SPI1_MOSI/LCD_P46'}
36- {pin_num: '64', pin_signal: LCD_P47/PTD7/SPI1_MISO/LPUART0_TX/SPI1_MOSI/FXIO0_D7, label: 'J2[10]/D12/SPI1_MISO/LCD_P47'}
37- {pin_num: '62', pin_signal: LCD_P45/ADC0_SE6b/PTD5/SPI1_SCK/UART2_TX/TPM0_CH5/FXIO0_D5, label: 'J2[12]/D13/SPI1_SCK/LED1/LCD_P45', identifier: LED1}
38- {pin_num: '1', pin_signal: LCD_P48/PTE0/CLKOUT32K/SPI1_MISO/LPUART1_TX/RTC_CLKOUT/CMP0_OUT/I2C1_SDA, label: 'J2[18]/J4[9]/D14/I2C1_SDA/CMP0_OUT/LCD_P48', identifier: I2C1_SDA}
39- {pin_num: '2', pin_signal: LCD_P49/PTE1/SPI1_MOSI/LPUART1_RX/SPI1_MISO/I2C1_SCL, label: 'J2[20]/D15/I2C1_SCL/LCD_P49', identifier: I2C1_SCL}
40- {pin_num: '39', pin_signal: LCD_P12/PTB16/SPI1_MOSI/LPUART0_RX/TPM_CLKIN0/SPI1_MISO, label: 'J2[19]/LCD_P12'}
41- {pin_num: '40', pin_signal: LCD_P13/PTB17/SPI1_MISO/LPUART0_TX/TPM_CLKIN1/SPI1_MOSI, label: 'J2[17]/LCD_P13'}
42- {pin_num: '54', pin_signal: LCD_P25/PTC5/LLWU_P9/SPI0_SCK/LPTMR0_ALT2/CMP0_OUT, label: 'J1[15]/INT1_ACCEL/LCD_P25', identifier: INT1_ACCEL}
43- {pin_num: '56', pin_signal: LCD_P27/CMP0_IN1/PTC7/SPI0_MISO/USB_SOF_OUT/SPI0_MOSI, label: 'J1[11]/USB_SOF_OUT/LCD_P27', identifier: LCD_P27}
44- {pin_num: '55', pin_signal: LCD_P26/CMP0_IN0/PTC6/LLWU_P10/SPI0_MOSI/EXTRG_IN/SPI0_MISO, label: 'J1[9]/LCD_P26', identifier: LCD_P26}
45- {pin_num: '53', pin_signal: LCD_P24/PTC4/LLWU_P8/SPI0_SS/LPUART1_TX/TPM0_CH3, label: 'J1[7]/LCD_P24', identifier: LCD_P24}
46- {pin_num: '43', pin_signal: LCD_P20/ADC0_SE14/PTC0/EXTRG_IN/USB_SOF_OUT/CMP0_OUT, label: 'J1[5]/LCD_P20/USB_SOF_OUT', identifier: LCD_P20;USB_SOF_OUT}
47- {pin_num: '42', pin_signal: LCD_P15/PTB19/TPM2_CH1, label: 'J1[3]/LCD_P15', identifier: LCD_P15}
48- {pin_num: '41', pin_signal: LCD_P14/PTB18/TPM2_CH0, label: 'J1[1]/LCD_P14', identifier: LCD_P14}
49- {pin_num: '12', pin_signal: ADC0_DM3/ADC0_SE7a/PTE23/TPM2_CH1/UART2_RX/FXIO0_D7, label: 'J4[7]/DIFF_ADC1_DM'}
50- {pin_num: '11', pin_signal: ADC0_DP3/ADC0_SE3/PTE22/TPM2_CH0/UART2_TX/FXIO0_D6, label: 'J4[5]/DIFF_ADC1_DP'}
51- {pin_num: '10', pin_signal: LCD_P60/ADC0_DM0/ADC0_SE4a/PTE21/TPM1_CH1/LPUART0_RX/FXIO0_D5, label: 'J4[3]/DIFF_ADC0_DM/LCD_P60', identifier: LCD_P60}
52- {pin_num: '9', pin_signal: LCD_P59/ADC0_DP0/ADC0_SE0/PTE20/TPM1_CH0/LPUART0_TX/FXIO0_D4, label: 'J4[1]/DIFF_ADC0_DP/LCD_P59', identifier: LCD_P59}
53- {pin_num: '35', pin_signal: LCD_P0/ADC0_SE8/PTB0/LLWU_P5/I2C0_SCL/TPM1_CH0, label: 'J4[2]/A0/LCD_P0'}
54- {pin_num: '36', pin_signal: LCD_P1/ADC0_SE9/PTB1/I2C0_SDA/TPM1_CH1, label: 'J4[4]/A1/LCD_P1'}
55- {pin_num: '37', pin_signal: LCD_P2/ADC0_SE12/PTB2/I2C0_SCL/TPM2_CH0, label: 'J4[6]/A2/LCD_P2'}
56- {pin_num: '38', pin_signal: LCD_P3/ADC0_SE13/PTB3/I2C0_SDA/TPM2_CH1, label: 'J4[8]/A3/LCD_P3'}
57- {pin_num: '45', pin_signal: LCD_P22/ADC0_SE11/PTC2/I2C1_SDA/TPM0_CH1, label: 'J4[10]/A4/LCD_P22'}
58- {pin_num: '44', pin_signal: LCD_P21/ADC0_SE15/PTC1/LLWU_P6/RTC_CLKIN/I2C1_SCL/TPM0_CH0, label: 'J4[12]/A5/LCD_P21'}
59- {pin_num: '5', pin_signal: USB0_DP, label: 'J10[3]/USB_DP', identifier: USB0_DP}
60- {pin_num: '6', pin_signal: USB0_DM, label: 'J10[2]/USB_DM', identifier: USB0_DM}
61- {pin_num: '22', pin_signal: PTA0/TPM0_CH5/SWD_CLK, label: 'J11[4]/K32L2_SWD_CLK'}
62- {pin_num: '25', pin_signal: PTA3/I2C1_SCL/TPM0_CH0/SWD_DIO, label: 'J11[2]/SWD_DIO_TGTMCU'}
63- {pin_num: '32', pin_signal: EXTAL0/PTA18/LPUART1_RX/TPM_CLKIN0, label: EXTAL_32KHZ, identifier: EXTAL_32KHZ}
64- {pin_num: '33', pin_signal: XTAL0/PTA19/LPUART1_TX/TPM_CLKIN1/LPTMR0_ALT1, label: XTAL_32KHZ, identifier: XTAL_32KHZ}
65- {pin_num: '34', pin_signal: PTA20/RESET_b, label: 'J11[10]/J3[6]/RESET/SW2'}
66- {pin_num: '46', pin_signal: LCD_P23/PTC3/LLWU_P7/SPI1_SCK/LPUART1_RX/TPM0_CH2/CLKOUT, label: SW3/LLWU_P7/LCD_P23, identifier: SW3}
67- {pin_num: '58', pin_signal: LCD_P41/ADC0_SE5b/PTD1/SPI0_SCK/TPM0_CH1/FXIO0_D1, label: 'U2[9]/U10[9]/INT2_ACCEL/INT1_MAG/LCD_P41', identifier: INT2_ACCEL;INT1_MAG}
68- {pin_num: '21', pin_signal: PTE25/TPM0_CH1/I2C0_SDA, label: 'U2[6]/U10[6]/I2C0_SDA', identifier: I2C0_SDA}
69- {pin_num: '20', pin_signal: PTE24/TPM0_CH0/I2C0_SCL, label: 'U2[7]/U10[4]/I2C0_SCL', identifier: I2C0_SCL}
70- {pin_num: '3', pin_signal: VDD17, label: P3V3_K32L2B}
71- {pin_num: '13', pin_signal: VDDA, label: P3V3_K32L2B}
72- {pin_num: '30', pin_signal: VDD94, label: P3V3_K32L2B}
73- {pin_num: '4', pin_signal: VSS18, label: GND}
74- {pin_num: '16', pin_signal: VSSA, label: GND}
75- {pin_num: '31', pin_signal: VSS95, label: GND}
76- {pin_num: '47', pin_signal: VSS136, label: GND}
77- {pin_num: '7', pin_signal: VOUT33, label: VOUT33}
78- {pin_num: '8', pin_signal: VREGIN, label: USB_REGIN, identifier: USB0_VREGIN}
79- {pin_num: '15', pin_signal: VREFL, label: GND}
80- {pin_num: '14', pin_signal: VREFH, label: 'J19[2]/P3V3_K32L2B'}
81- {pin_num: '19', pin_signal: PTE31/TPM0_CH4, label: LED2, identifier: LED2}
82- {pin_num: '48', pin_signal: VLL3, label: 'J12[1]/P3V3_K32L2B'}
83- {pin_num: '49', pin_signal: VLL2/LCD_P4/PTC20, label: TP12/LCD_P4}
84- {pin_num: '50', pin_signal: VLL1/LCD_P5/PTC21, label: TP10/LCD_P5}
85- {pin_num: '51', pin_signal: VCAP2/LCD_P6/PTC22, label: LCD_P6}
86- {pin_num: '52', pin_signal: VCAP1/LCD_P39/PTC23, label: LCD_P39}
87- {pin_num: '57', pin_signal: LCD_P40/PTD0/SPI0_SS/TPM0_CH0/FXIO0_D0, label: LCD-09_P40, identifier: LCD_P40}
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_port.h"
94#include "fsl_gpio.h"
95#include "pin_mux.h"
96
97/* FUNCTION ************************************************************************************************************
98 *
99 * Function Name : BOARD_InitBootPins
100 * Description : Calls initialization functions.
101 *
102 * END ****************************************************************************************************************/
103void 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 *************************************
112BOARD_InitPins:
113- options: {callFromInitBoot: 'true', prefix: BOARD_, 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 ****************************************************************************************************************/
125void BOARD_InitPins(void)
126{
127}
128
129/* clang-format off */
130/*
131 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
132BOARD_InitLCDPins:
133- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
134- pin_list:
135 - {pin_num: '41', peripheral: LCD, signal: 'P, 14', pin_signal: LCD_P14/PTB18/TPM2_CH0, slew_rate: slow, pull_select: up, pull_enable: disable}
136 - {pin_num: '42', peripheral: LCD, signal: 'P, 15', pin_signal: LCD_P15/PTB19/TPM2_CH1, slew_rate: slow, pull_select: up, pull_enable: disable}
137 - {pin_num: '43', peripheral: LCD, signal: 'P, 20', pin_signal: LCD_P20/ADC0_SE14/PTC0/EXTRG_IN/USB_SOF_OUT/CMP0_OUT, identifier: LCD_P20, slew_rate: slow, pull_select: up,
138 pull_enable: disable}
139 - {pin_num: '53', peripheral: LCD, signal: 'P, 24', pin_signal: LCD_P24/PTC4/LLWU_P8/SPI0_SS/LPUART1_TX/TPM0_CH3, slew_rate: slow, pull_select: up, pull_enable: disable}
140 - {pin_num: '55', peripheral: LCD, signal: 'P, 26', pin_signal: LCD_P26/CMP0_IN0/PTC6/LLWU_P10/SPI0_MOSI/EXTRG_IN/SPI0_MISO, slew_rate: slow, pull_select: up, pull_enable: disable}
141 - {pin_num: '56', peripheral: LCD, signal: 'P, 27', pin_signal: LCD_P27/CMP0_IN1/PTC7/SPI0_MISO/USB_SOF_OUT/SPI0_MOSI, slew_rate: slow, pull_select: up, pull_enable: disable}
142 - {pin_num: '57', peripheral: LCD, signal: 'P, 40', pin_signal: LCD_P40/PTD0/SPI0_SS/TPM0_CH0/FXIO0_D0, slew_rate: slow, pull_select: up, pull_enable: disable}
143 - {pin_num: '59', peripheral: LCD, signal: 'P, 42', pin_signal: LCD_P42/PTD2/SPI0_MOSI/UART2_RX/TPM0_CH2/SPI0_MISO/FXIO0_D2, slew_rate: slow, pull_select: up, pull_enable: disable}
144 - {pin_num: '60', peripheral: LCD, signal: 'P, 43', pin_signal: LCD_P43/PTD3/SPI0_MISO/UART2_TX/TPM0_CH3/SPI0_MOSI/FXIO0_D3, slew_rate: slow, pull_select: up, pull_enable: disable}
145 - {pin_num: '61', peripheral: LCD, signal: 'P, 44', pin_signal: LCD_P44/PTD4/LLWU_P14/SPI1_SS/UART2_RX/TPM0_CH4/FXIO0_D4, slew_rate: slow, pull_select: up, pull_enable: disable}
146 - {pin_num: '9', peripheral: LCD, signal: 'P, 59', pin_signal: LCD_P59/ADC0_DP0/ADC0_SE0/PTE20/TPM1_CH0/LPUART0_TX/FXIO0_D4, slew_rate: slow, pull_select: up, pull_enable: disable}
147 - {pin_num: '10', peripheral: LCD, signal: 'P, 60', pin_signal: LCD_P60/ADC0_DM0/ADC0_SE4a/PTE21/TPM1_CH1/LPUART0_RX/FXIO0_D5, slew_rate: slow, pull_select: up,
148 pull_enable: disable}
149 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
150 */
151/* clang-format on */
152
153/* FUNCTION ************************************************************************************************************
154 *
155 * Function Name : BOARD_InitLCDPins
156 * Description : Configures pin routing and optionally pin electrical features.
157 *
158 * END ****************************************************************************************************************/
159void BOARD_InitLCDPins(void)
160{
161 /* Port B Clock Gate Control: Clock enabled */
162 CLOCK_EnableClock(kCLOCK_PortB);
163 /* Port C Clock Gate Control: Clock enabled */
164 CLOCK_EnableClock(kCLOCK_PortC);
165 /* Port D Clock Gate Control: Clock enabled */
166 CLOCK_EnableClock(kCLOCK_PortD);
167 /* Port E Clock Gate Control: Clock enabled */
168 CLOCK_EnableClock(kCLOCK_PortE);
169
170 /* PORTB18 (pin 41) is configured as LCD_P14 */
171 PORT_SetPinMux(BOARD_LCD_P14_PORT, BOARD_LCD_P14_PIN, kPORT_PinDisabledOrAnalog);
172
173 PORTB->PCR[18] = ((PORTB->PCR[18] &
174 /* Mask bits to zero which are setting */
175 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
176
177 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
178 * corresponding PE field is set. */
179 | PORT_PCR_PS(kPORT_PullUp)
180
181 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding
182 * pin. */
183 | PORT_PCR_PE(kPORT_PullDisable)
184
185 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
186 * configured as a digital output. */
187 | PORT_PCR_SRE(kPORT_SlowSlewRate));
188
189 /* PORTB19 (pin 42) is configured as LCD_P15 */
190 PORT_SetPinMux(BOARD_LCD_P15_PORT, BOARD_LCD_P15_PIN, kPORT_PinDisabledOrAnalog);
191
192 PORTB->PCR[19] = ((PORTB->PCR[19] &
193 /* Mask bits to zero which are setting */
194 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
195
196 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
197 * corresponding PE field is set. */
198 | PORT_PCR_PS(kPORT_PullUp)
199
200 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding
201 * pin. */
202 | PORT_PCR_PE(kPORT_PullDisable)
203
204 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
205 * configured as a digital output. */
206 | PORT_PCR_SRE(kPORT_SlowSlewRate));
207
208 /* PORTC0 (pin 43) is configured as LCD_P20 */
209 PORT_SetPinMux(BOARD_LCD_P20_PORT, BOARD_LCD_P20_PIN, kPORT_PinDisabledOrAnalog);
210
211 PORTC->PCR[0] = ((PORTC->PCR[0] &
212 /* Mask bits to zero which are setting */
213 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
214
215 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
216 * corresponding PE field is set. */
217 | PORT_PCR_PS(kPORT_PullUp)
218
219 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
220 | PORT_PCR_PE(kPORT_PullDisable)
221
222 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
223 * configured as a digital output. */
224 | PORT_PCR_SRE(kPORT_SlowSlewRate));
225
226 /* PORTC4 (pin 53) is configured as LCD_P24 */
227 PORT_SetPinMux(BOARD_LCD_P24_PORT, BOARD_LCD_P24_PIN, kPORT_PinDisabledOrAnalog);
228
229 PORTC->PCR[4] = ((PORTC->PCR[4] &
230 /* Mask bits to zero which are setting */
231 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
232
233 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
234 * corresponding PE field is set. */
235 | PORT_PCR_PS(kPORT_PullUp)
236
237 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
238 | PORT_PCR_PE(kPORT_PullDisable)
239
240 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
241 * configured as a digital output. */
242 | PORT_PCR_SRE(kPORT_SlowSlewRate));
243
244 /* PORTC6 (pin 55) is configured as LCD_P26 */
245 PORT_SetPinMux(BOARD_LCD_P26_PORT, BOARD_LCD_P26_PIN, kPORT_PinDisabledOrAnalog);
246
247 PORTC->PCR[6] = ((PORTC->PCR[6] &
248 /* Mask bits to zero which are setting */
249 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
250
251 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
252 * corresponding PE field is set. */
253 | PORT_PCR_PS(kPORT_PullUp)
254
255 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
256 | PORT_PCR_PE(kPORT_PullDisable)
257
258 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
259 * configured as a digital output. */
260 | PORT_PCR_SRE(kPORT_SlowSlewRate));
261
262 /* PORTC7 (pin 56) is configured as LCD_P27 */
263 PORT_SetPinMux(BOARD_LCD_P27_PORT, BOARD_LCD_P27_PIN, kPORT_PinDisabledOrAnalog);
264
265 PORTC->PCR[7] = ((PORTC->PCR[7] &
266 /* Mask bits to zero which are setting */
267 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
268
269 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
270 * corresponding PE field is set. */
271 | PORT_PCR_PS(kPORT_PullUp)
272
273 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
274 | PORT_PCR_PE(kPORT_PullDisable)
275
276 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
277 * configured as a digital output. */
278 | PORT_PCR_SRE(kPORT_SlowSlewRate));
279
280 /* PORTD0 (pin 57) is configured as LCD_P40 */
281 PORT_SetPinMux(BOARD_LCD_P40_PORT, BOARD_LCD_P40_PIN, kPORT_PinDisabledOrAnalog);
282
283 PORTD->PCR[0] = ((PORTD->PCR[0] &
284 /* Mask bits to zero which are setting */
285 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
286
287 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
288 * corresponding PE field is set. */
289 | PORT_PCR_PS(kPORT_PullUp)
290
291 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
292 | PORT_PCR_PE(kPORT_PullDisable)
293
294 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
295 * configured as a digital output. */
296 | PORT_PCR_SRE(kPORT_SlowSlewRate));
297
298 /* PORTD2 (pin 59) is configured as LCD_P42 */
299 PORT_SetPinMux(BOARD_LCD_P42_PORT, BOARD_LCD_P42_PIN, kPORT_PinDisabledOrAnalog);
300
301 PORTD->PCR[2] = ((PORTD->PCR[2] &
302 /* Mask bits to zero which are setting */
303 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
304
305 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
306 * corresponding PE field is set. */
307 | PORT_PCR_PS(kPORT_PullUp)
308
309 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
310 | PORT_PCR_PE(kPORT_PullDisable)
311
312 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
313 * configured as a digital output. */
314 | PORT_PCR_SRE(kPORT_SlowSlewRate));
315
316 /* PORTD3 (pin 60) is configured as LCD_P43 */
317 PORT_SetPinMux(BOARD_LCD_P43_PORT, BOARD_LCD_P43_PIN, kPORT_PinDisabledOrAnalog);
318
319 PORTD->PCR[3] = ((PORTD->PCR[3] &
320 /* Mask bits to zero which are setting */
321 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
322
323 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
324 * corresponding PE field is set. */
325 | PORT_PCR_PS(kPORT_PullUp)
326
327 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
328 | PORT_PCR_PE(kPORT_PullDisable)
329
330 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
331 * configured as a digital output. */
332 | PORT_PCR_SRE(kPORT_SlowSlewRate));
333
334 /* PORTD4 (pin 61) is configured as LCD_P44 */
335 PORT_SetPinMux(BOARD_LCD_P44_PORT, BOARD_LCD_P44_PIN, kPORT_PinDisabledOrAnalog);
336
337 PORTD->PCR[4] = ((PORTD->PCR[4] &
338 /* Mask bits to zero which are setting */
339 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
340
341 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
342 * corresponding PE field is set. */
343 | PORT_PCR_PS(kPORT_PullUp)
344
345 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
346 | PORT_PCR_PE(kPORT_PullDisable)
347
348 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
349 * configured as a digital output. */
350 | PORT_PCR_SRE(kPORT_SlowSlewRate));
351
352 /* PORTE20 (pin 9) is configured as LCD_P59 */
353 PORT_SetPinMux(BOARD_LCD_P59_PORT, BOARD_LCD_P59_PIN, kPORT_PinDisabledOrAnalog);
354
355 PORTE->PCR[20] = ((PORTE->PCR[20] &
356 /* Mask bits to zero which are setting */
357 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
358
359 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
360 * corresponding PE field is set. */
361 | PORT_PCR_PS(kPORT_PullUp)
362
363 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding
364 * pin. */
365 | PORT_PCR_PE(kPORT_PullDisable)
366
367 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
368 * configured as a digital output. */
369 | PORT_PCR_SRE(kPORT_SlowSlewRate));
370
371 /* PORTE21 (pin 10) is configured as LCD_P60 */
372 PORT_SetPinMux(BOARD_LCD_P60_PORT, BOARD_LCD_P60_PIN, kPORT_PinDisabledOrAnalog);
373
374 PORTE->PCR[21] = ((PORTE->PCR[21] &
375 /* Mask bits to zero which are setting */
376 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
377
378 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
379 * corresponding PE field is set. */
380 | PORT_PCR_PS(kPORT_PullUp)
381
382 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding
383 * pin. */
384 | PORT_PCR_PE(kPORT_PullDisable)
385
386 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
387 * configured as a digital output. */
388 | PORT_PCR_SRE(kPORT_SlowSlewRate));
389}
390
391/* clang-format off */
392/*
393 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
394BOARD_InitBUTTONSPins:
395- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
396- pin_list:
397 - {pin_num: '26', peripheral: GPIOA, signal: 'GPIO, 4', pin_signal: PTA4/I2C1_SDA/TPM0_CH1/NMI_b, direction: INPUT, slew_rate: fast, pull_select: up, pull_enable: enable,
398 passive_filter: disable}
399 - {pin_num: '46', peripheral: GPIOC, signal: 'GPIO, 3', pin_signal: LCD_P23/PTC3/LLWU_P7/SPI1_SCK/LPUART1_RX/TPM0_CH2/CLKOUT, direction: INPUT, slew_rate: fast,
400 pull_select: up, pull_enable: enable}
401 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
402 */
403/* clang-format on */
404
405/* FUNCTION ************************************************************************************************************
406 *
407 * Function Name : BOARD_InitBUTTONSPins
408 * Description : Configures pin routing and optionally pin electrical features.
409 *
410 * END ****************************************************************************************************************/
411void BOARD_InitBUTTONSPins(void)
412{
413 /* Port A Clock Gate Control: Clock enabled */
414 CLOCK_EnableClock(kCLOCK_PortA);
415 /* Port C Clock Gate Control: Clock enabled */
416 CLOCK_EnableClock(kCLOCK_PortC);
417
418 gpio_pin_config_t SW1_config = {
419 .pinDirection = kGPIO_DigitalInput,
420 .outputLogic = 0U
421 };
422 /* Initialize GPIO functionality on pin PTA4 (pin 26) */
423 GPIO_PinInit(BOARD_SW1_GPIO, BOARD_SW1_PIN, &SW1_config);
424
425 gpio_pin_config_t SW3_config = {
426 .pinDirection = kGPIO_DigitalInput,
427 .outputLogic = 0U
428 };
429 /* Initialize GPIO functionality on pin PTC3 (pin 46) */
430 GPIO_PinInit(BOARD_SW3_GPIO, BOARD_SW3_PIN, &SW3_config);
431
432 const port_pin_config_t SW1 = {/* Internal pull-up resistor is enabled */
433 kPORT_PullUp,
434 /* Fast slew rate is configured */
435 kPORT_FastSlewRate,
436 /* Passive filter is disabled */
437 kPORT_PassiveFilterDisable,
438 /* Low drive strength is configured */
439 kPORT_LowDriveStrength,
440 /* Pin is configured as PTA4 */
441 kPORT_MuxAsGpio};
442 /* PORTA4 (pin 26) is configured as PTA4 */
443 PORT_SetPinConfig(BOARD_SW1_PORT, BOARD_SW1_PIN, &SW1);
444
445 const port_pin_config_t SW3 = {/* Internal pull-up resistor is enabled */
446 kPORT_PullUp,
447 /* Fast slew rate is configured */
448 kPORT_FastSlewRate,
449 /* Passive filter is disabled */
450 kPORT_PassiveFilterDisable,
451 /* Low drive strength is configured */
452 kPORT_LowDriveStrength,
453 /* Pin is configured as PTC3 */
454 kPORT_MuxAsGpio};
455 /* PORTC3 (pin 46) is configured as PTC3 */
456 PORT_SetPinConfig(BOARD_SW3_PORT, BOARD_SW3_PIN, &SW3);
457}
458
459/* clang-format off */
460/*
461 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
462BOARD_InitLEDsPins:
463- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
464- pin_list:
465 - {pin_num: '19', peripheral: GPIOE, signal: 'GPIO, 31', pin_signal: PTE31/TPM0_CH4, direction: OUTPUT, gpio_init_state: 'true', slew_rate: slow, pull_select: down,
466 pull_enable: disable}
467 - {pin_num: '62', peripheral: GPIOD, signal: 'GPIO, 5', pin_signal: LCD_P45/ADC0_SE6b/PTD5/SPI1_SCK/UART2_TX/TPM0_CH5/FXIO0_D5, direction: OUTPUT, gpio_init_state: 'true',
468 slew_rate: slow, pull_select: down, pull_enable: disable}
469 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
470 */
471/* clang-format on */
472
473/* FUNCTION ************************************************************************************************************
474 *
475 * Function Name : BOARD_InitLEDsPins
476 * Description : Configures pin routing and optionally pin electrical features.
477 *
478 * END ****************************************************************************************************************/
479void BOARD_InitLEDsPins(void)
480{
481 /* Port D Clock Gate Control: Clock enabled */
482 CLOCK_EnableClock(kCLOCK_PortD);
483 /* Port E Clock Gate Control: Clock enabled */
484 CLOCK_EnableClock(kCLOCK_PortE);
485
486 gpio_pin_config_t LED1_config = {
487 .pinDirection = kGPIO_DigitalOutput,
488 .outputLogic = 1U
489 };
490 /* Initialize GPIO functionality on pin PTD5 (pin 62) */
491 GPIO_PinInit(BOARD_LED1_GPIO, BOARD_LED1_PIN, &LED1_config);
492
493 gpio_pin_config_t LED2_config = {
494 .pinDirection = kGPIO_DigitalOutput,
495 .outputLogic = 1U
496 };
497 /* Initialize GPIO functionality on pin PTE31 (pin 19) */
498 GPIO_PinInit(BOARD_LED2_GPIO, BOARD_LED2_PIN, &LED2_config);
499
500 const port_pin_config_t LED1 = {/* Internal pull-up/down resistor is disabled */
501 kPORT_PullDisable,
502 /* Slow slew rate is configured */
503 kPORT_SlowSlewRate,
504 /* Passive filter is disabled */
505 kPORT_PassiveFilterDisable,
506 /* Low drive strength is configured */
507 kPORT_LowDriveStrength,
508 /* Pin is configured as PTD5 */
509 kPORT_MuxAsGpio};
510 /* PORTD5 (pin 62) is configured as PTD5 */
511 PORT_SetPinConfig(BOARD_LED1_PORT, BOARD_LED1_PIN, &LED1);
512
513 const port_pin_config_t LED2 = {/* Internal pull-up/down resistor is disabled */
514 kPORT_PullDisable,
515 /* Slow slew rate is configured */
516 kPORT_SlowSlewRate,
517 /* Passive filter is disabled */
518 kPORT_PassiveFilterDisable,
519 /* Low drive strength is configured */
520 kPORT_LowDriveStrength,
521 /* Pin is configured as PTE31 */
522 kPORT_MuxAsGpio};
523 /* PORTE31 (pin 19) is configured as PTE31 */
524 PORT_SetPinConfig(BOARD_LED2_PORT, BOARD_LED2_PIN, &LED2);
525}
526
527/* clang-format off */
528/*
529 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
530BOARD_InitDEBUG_UARTPins:
531- options: {callFromInitBoot: 'true', prefix: BOARD_, coreID: core0, enableClock: 'true'}
532- pin_list:
533 - {pin_num: '23', peripheral: LPUART0, signal: RX, pin_signal: PTA1/LPUART0_RX/TPM2_CH0, slew_rate: fast, pull_select: down, pull_enable: disable}
534 - {pin_num: '24', peripheral: LPUART0, signal: TX, pin_signal: PTA2/LPUART0_TX/TPM2_CH1, direction: OUTPUT, slew_rate: fast, pull_select: down, pull_enable: disable}
535 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
536 */
537/* clang-format on */
538
539/* FUNCTION ************************************************************************************************************
540 *
541 * Function Name : BOARD_InitDEBUG_UARTPins
542 * Description : Configures pin routing and optionally pin electrical features.
543 *
544 * END ****************************************************************************************************************/
545void BOARD_InitDEBUG_UARTPins(void)
546{
547 /* Port A Clock Gate Control: Clock enabled */
548 CLOCK_EnableClock(kCLOCK_PortA);
549
550 const port_pin_config_t DEBUG_UART0_RX = {/* Internal pull-up/down resistor is disabled */
551 kPORT_PullDisable,
552 /* Fast slew rate is configured */
553 kPORT_FastSlewRate,
554 /* Passive filter is disabled */
555 kPORT_PassiveFilterDisable,
556 /* Low drive strength is configured */
557 kPORT_LowDriveStrength,
558 /* Pin is configured as LPUART0_RX */
559 kPORT_MuxAlt2};
560 /* PORTA1 (pin 23) is configured as LPUART0_RX */
561 PORT_SetPinConfig(BOARD_DEBUG_UART0_RX_PORT, BOARD_DEBUG_UART0_RX_PIN, &DEBUG_UART0_RX);
562
563 const port_pin_config_t DEBUG_UART0_TX = {/* Internal pull-up/down resistor is disabled */
564 kPORT_PullDisable,
565 /* Fast slew rate is configured */
566 kPORT_FastSlewRate,
567 /* Passive filter is disabled */
568 kPORT_PassiveFilterDisable,
569 /* Low drive strength is configured */
570 kPORT_LowDriveStrength,
571 /* Pin is configured as LPUART0_TX */
572 kPORT_MuxAlt2};
573 /* PORTA2 (pin 24) is configured as LPUART0_TX */
574 PORT_SetPinConfig(BOARD_DEBUG_UART0_TX_PORT, BOARD_DEBUG_UART0_TX_PIN, &DEBUG_UART0_TX);
575
576 SIM->SOPT5 = ((SIM->SOPT5 &
577 /* Mask bits to zero which are setting */
578 (~(SIM_SOPT5_LPUART0TXSRC_MASK | SIM_SOPT5_LPUART0RXSRC_MASK)))
579
580 /* LPUART0 Transmit Data Source Select: LPUART0_TX pin. */
581 | SIM_SOPT5_LPUART0TXSRC(SOPT5_LPUART0TXSRC_LPUART_TX)
582
583 /* LPUART0 Receive Data Source Select: LPUART_RX pin. */
584 | SIM_SOPT5_LPUART0RXSRC(SOPT5_LPUART0RXSRC_LPUART_RX));
585}
586
587/* clang-format off */
588/*
589 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
590BOARD_InitUSBPins:
591- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
592- pin_list:
593 - {pin_num: '5', peripheral: USB0, signal: DP, pin_signal: USB0_DP}
594 - {pin_num: '6', peripheral: USB0, signal: DM, pin_signal: USB0_DM}
595 - {pin_num: '8', peripheral: USB0, signal: VREGIN, pin_signal: VREGIN}
596 - {pin_num: '43', peripheral: USB0, signal: SOF_OUT, pin_signal: LCD_P20/ADC0_SE14/PTC0/EXTRG_IN/USB_SOF_OUT/CMP0_OUT, identifier: USB_SOF_OUT, slew_rate: fast,
597 pull_select: up, pull_enable: disable}
598 - {pin_num: '27', peripheral: USB0, signal: CLKIN, pin_signal: PTA5/USB_CLKIN/TPM0_CH2, slew_rate: fast, pull_select: up, pull_enable: disable}
599 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
600 */
601/* clang-format on */
602
603/* FUNCTION ************************************************************************************************************
604 *
605 * Function Name : BOARD_InitUSBPins
606 * Description : Configures pin routing and optionally pin electrical features.
607 *
608 * END ****************************************************************************************************************/
609void BOARD_InitUSBPins(void)
610{
611 /* Port A Clock Gate Control: Clock enabled */
612 CLOCK_EnableClock(kCLOCK_PortA);
613 /* Port C Clock Gate Control: Clock enabled */
614 CLOCK_EnableClock(kCLOCK_PortC);
615
616 /* PORTA5 (pin 27) is configured as USB_CLKIN */
617 PORT_SetPinMux(BOARD_USB0_CLKIN_PORT, BOARD_USB0_CLKIN_PIN, kPORT_MuxAlt2);
618
619 PORTA->PCR[5] = ((PORTA->PCR[5] &
620 /* Mask bits to zero which are setting */
621 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
622
623 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
624 * corresponding PE field is set. */
625 | PORT_PCR_PS(kPORT_PullUp)
626
627 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
628 | PORT_PCR_PE(kPORT_PullDisable)
629
630 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
631 * configured as a digital output. */
632 | PORT_PCR_SRE(kPORT_FastSlewRate));
633
634 /* PORTC0 (pin 43) is configured as USB_SOF_OUT */
635 PORT_SetPinMux(BOARD_USB_SOF_OUT_PORT, BOARD_USB_SOF_OUT_PIN, kPORT_MuxAlt4);
636
637 PORTC->PCR[0] = ((PORTC->PCR[0] &
638 /* Mask bits to zero which are setting */
639 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
640
641 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
642 * corresponding PE field is set. */
643 | PORT_PCR_PS(kPORT_PullUp)
644
645 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
646 | PORT_PCR_PE(kPORT_PullDisable)
647
648 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
649 * configured as a digital output. */
650 | PORT_PCR_SRE(kPORT_FastSlewRate));
651}
652
653/* clang-format off */
654/*
655 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
656BOARD_InitACCEL_I2CPins:
657- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
658- pin_list:
659 - {pin_num: '20', peripheral: I2C0, signal: SCL, pin_signal: PTE24/TPM0_CH0/I2C0_SCL, slew_rate: fast, pull_select: up, pull_enable: enable}
660 - {pin_num: '21', peripheral: I2C0, signal: SDA, pin_signal: PTE25/TPM0_CH1/I2C0_SDA, slew_rate: fast, pull_select: up, pull_enable: enable}
661 - {pin_num: '58', peripheral: GPIOD, signal: 'GPIO, 1', pin_signal: LCD_P41/ADC0_SE5b/PTD1/SPI0_SCK/TPM0_CH1/FXIO0_D1, identifier: INT2_ACCEL, direction: INPUT,
662 slew_rate: fast, pull_select: up, pull_enable: disable}
663 - {pin_num: '54', peripheral: GPIOC, signal: 'GPIO, 5', pin_signal: LCD_P25/PTC5/LLWU_P9/SPI0_SCK/LPTMR0_ALT2/CMP0_OUT, direction: INPUT, slew_rate: fast, pull_select: up,
664 pull_enable: disable}
665 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
666 */
667/* clang-format on */
668
669/* FUNCTION ************************************************************************************************************
670 *
671 * Function Name : BOARD_InitACCEL_I2CPins
672 * Description : Configures pin routing and optionally pin electrical features.
673 *
674 * END ****************************************************************************************************************/
675void BOARD_InitACCEL_I2CPins(void)
676{
677 /* Port C Clock Gate Control: Clock enabled */
678 CLOCK_EnableClock(kCLOCK_PortC);
679 /* Port D Clock Gate Control: Clock enabled */
680 CLOCK_EnableClock(kCLOCK_PortD);
681 /* Port E Clock Gate Control: Clock enabled */
682 CLOCK_EnableClock(kCLOCK_PortE);
683
684 gpio_pin_config_t INT1_ACCEL_config = {
685 .pinDirection = kGPIO_DigitalInput,
686 .outputLogic = 0U
687 };
688 /* Initialize GPIO functionality on pin PTC5 (pin 54) */
689 GPIO_PinInit(BOARD_INT1_ACCEL_GPIO, BOARD_INT1_ACCEL_PIN, &INT1_ACCEL_config);
690
691 gpio_pin_config_t INT2_ACCEL_config = {
692 .pinDirection = kGPIO_DigitalInput,
693 .outputLogic = 0U
694 };
695 /* Initialize GPIO functionality on pin PTD1 (pin 58) */
696 GPIO_PinInit(BOARD_INT2_ACCEL_GPIO, BOARD_INT2_ACCEL_PIN, &INT2_ACCEL_config);
697
698 /* PORTC5 (pin 54) is configured as PTC5 */
699 PORT_SetPinMux(BOARD_INT1_ACCEL_PORT, BOARD_INT1_ACCEL_PIN, kPORT_MuxAsGpio);
700
701 PORTC->PCR[5] = ((PORTC->PCR[5] &
702 /* Mask bits to zero which are setting */
703 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
704
705 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
706 * corresponding PE field is set. */
707 | PORT_PCR_PS(kPORT_PullUp)
708
709 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
710 | PORT_PCR_PE(kPORT_PullDisable)
711
712 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
713 * configured as a digital output. */
714 | PORT_PCR_SRE(kPORT_FastSlewRate));
715
716 /* PORTD1 (pin 58) is configured as PTD1 */
717 PORT_SetPinMux(BOARD_INT2_ACCEL_PORT, BOARD_INT2_ACCEL_PIN, kPORT_MuxAsGpio);
718
719 PORTD->PCR[1] = ((PORTD->PCR[1] &
720 /* Mask bits to zero which are setting */
721 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
722
723 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
724 * corresponding PE field is set. */
725 | PORT_PCR_PS(kPORT_PullUp)
726
727 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
728 | PORT_PCR_PE(kPORT_PullDisable)
729
730 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
731 * configured as a digital output. */
732 | PORT_PCR_SRE(kPORT_FastSlewRate));
733
734 const port_pin_config_t I2C0_SCL = {/* Internal pull-up resistor is enabled */
735 kPORT_PullUp,
736 /* Fast slew rate is configured */
737 kPORT_FastSlewRate,
738 /* Passive filter is disabled */
739 kPORT_PassiveFilterDisable,
740 /* Low drive strength is configured */
741 kPORT_LowDriveStrength,
742 /* Pin is configured as I2C0_SCL */
743 kPORT_MuxAlt5};
744 /* PORTE24 (pin 20) is configured as I2C0_SCL */
745 PORT_SetPinConfig(BOARD_I2C0_SCL_PORT, BOARD_I2C0_SCL_PIN, &I2C0_SCL);
746
747 const port_pin_config_t I2C0_SDA = {/* Internal pull-up resistor is enabled */
748 kPORT_PullUp,
749 /* Fast slew rate is configured */
750 kPORT_FastSlewRate,
751 /* Passive filter is disabled */
752 kPORT_PassiveFilterDisable,
753 /* Low drive strength is configured */
754 kPORT_LowDriveStrength,
755 /* Pin is configured as I2C0_SDA */
756 kPORT_MuxAlt5};
757 /* PORTE25 (pin 21) is configured as I2C0_SDA */
758 PORT_SetPinConfig(BOARD_I2C0_SDA_PORT, BOARD_I2C0_SDA_PIN, &I2C0_SDA);
759}
760
761/* clang-format off */
762/*
763 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
764BOARD_InitOSCPins:
765- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
766- pin_list:
767 - {pin_num: '32', peripheral: OSC0, signal: EXTAL0, pin_signal: EXTAL0/PTA18/LPUART1_RX/TPM_CLKIN0, slew_rate: no_init, pull_select: no_init, pull_enable: no_init}
768 - {pin_num: '33', peripheral: OSC0, signal: XTAL0, pin_signal: XTAL0/PTA19/LPUART1_TX/TPM_CLKIN1/LPTMR0_ALT1, slew_rate: no_init, pull_select: no_init, pull_enable: no_init}
769 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
770 */
771/* clang-format on */
772
773/* FUNCTION ************************************************************************************************************
774 *
775 * Function Name : BOARD_InitOSCPins
776 * Description : Configures pin routing and optionally pin electrical features.
777 *
778 * END ****************************************************************************************************************/
779void BOARD_InitOSCPins(void)
780{
781 /* Port A Clock Gate Control: Clock enabled */
782 CLOCK_EnableClock(kCLOCK_PortA);
783
784 /* PORTA18 (pin 32) is configured as EXTAL0 */
785 PORT_SetPinMux(BOARD_EXTAL_32KHZ_PORT, BOARD_EXTAL_32KHZ_PIN, kPORT_PinDisabledOrAnalog);
786
787 /* PORTA19 (pin 33) is configured as XTAL0 */
788 PORT_SetPinMux(BOARD_XTAL_32KHZ_PORT, BOARD_XTAL_32KHZ_PIN, kPORT_PinDisabledOrAnalog);
789}
790/***********************************************************************************************************************
791 * EOF
792 **********************************************************************************************************************/