aboutsummaryrefslogtreecommitdiff
path: root/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk32l2b/project_template/pin_mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/frdmk32l2b/project_template/pin_mux.c')
-rw-r--r--lib/chibios-contrib/ext/mcux-sdk/boards/frdmk32l2b/project_template/pin_mux.c797
1 files changed, 797 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk32l2b/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk32l2b/project_template/pin_mux.c
new file mode 100644
index 000000000..a1be83696
--- /dev/null
+++ b/lib/chibios-contrib/ext/mcux-sdk/boards/frdmk32l2b/project_template/pin_mux.c
@@ -0,0 +1,797 @@
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] =
230 ((PORTC->PCR[4] &
231 /* Mask bits to zero which are setting */
232 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_DSE_MASK | PORT_PCR_ISF_MASK)))
233
234 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the corresponding PE
235 * field is set. */
236 | PORT_PCR_PS(kPORT_PullUp)
237
238 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
239 | PORT_PCR_PE(kPORT_PullDisable)
240
241 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is configured as
242 * a digital output. */
243 | PORT_PCR_SRE(kPORT_SlowSlewRate)
244
245 /* Drive Strength Enable: Low drive strength is configured on the corresponding pin, if pin is
246 * configured as a digital output. */
247 | PORT_PCR_DSE(kPORT_LowDriveStrength));
248
249 /* PORTC6 (pin 55) is configured as LCD_P26 */
250 PORT_SetPinMux(BOARD_LCD_P26_PORT, BOARD_LCD_P26_PIN, kPORT_PinDisabledOrAnalog);
251
252 PORTC->PCR[6] = ((PORTC->PCR[6] &
253 /* Mask bits to zero which are setting */
254 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
255
256 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
257 * corresponding PE field is set. */
258 | PORT_PCR_PS(kPORT_PullUp)
259
260 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
261 | PORT_PCR_PE(kPORT_PullDisable)
262
263 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
264 * configured as a digital output. */
265 | PORT_PCR_SRE(kPORT_SlowSlewRate));
266
267 /* PORTC7 (pin 56) is configured as LCD_P27 */
268 PORT_SetPinMux(BOARD_LCD_P27_PORT, BOARD_LCD_P27_PIN, kPORT_PinDisabledOrAnalog);
269
270 PORTC->PCR[7] = ((PORTC->PCR[7] &
271 /* Mask bits to zero which are setting */
272 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
273
274 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
275 * corresponding PE field is set. */
276 | PORT_PCR_PS(kPORT_PullUp)
277
278 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
279 | PORT_PCR_PE(kPORT_PullDisable)
280
281 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
282 * configured as a digital output. */
283 | PORT_PCR_SRE(kPORT_SlowSlewRate));
284
285 /* PORTD0 (pin 57) is configured as LCD_P40 */
286 PORT_SetPinMux(BOARD_LCD_P40_PORT, BOARD_LCD_P40_PIN, kPORT_PinDisabledOrAnalog);
287
288 PORTD->PCR[0] = ((PORTD->PCR[0] &
289 /* Mask bits to zero which are setting */
290 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
291
292 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
293 * corresponding PE field is set. */
294 | PORT_PCR_PS(kPORT_PullUp)
295
296 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
297 | PORT_PCR_PE(kPORT_PullDisable)
298
299 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
300 * configured as a digital output. */
301 | PORT_PCR_SRE(kPORT_SlowSlewRate));
302
303 /* PORTD2 (pin 59) is configured as LCD_P42 */
304 PORT_SetPinMux(BOARD_LCD_P42_PORT, BOARD_LCD_P42_PIN, kPORT_PinDisabledOrAnalog);
305
306 PORTD->PCR[2] = ((PORTD->PCR[2] &
307 /* Mask bits to zero which are setting */
308 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
309
310 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
311 * corresponding PE field is set. */
312 | PORT_PCR_PS(kPORT_PullUp)
313
314 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
315 | PORT_PCR_PE(kPORT_PullDisable)
316
317 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
318 * configured as a digital output. */
319 | PORT_PCR_SRE(kPORT_SlowSlewRate));
320
321 /* PORTD3 (pin 60) is configured as LCD_P43 */
322 PORT_SetPinMux(BOARD_LCD_P43_PORT, BOARD_LCD_P43_PIN, kPORT_PinDisabledOrAnalog);
323
324 PORTD->PCR[3] = ((PORTD->PCR[3] &
325 /* Mask bits to zero which are setting */
326 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
327
328 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
329 * corresponding PE field is set. */
330 | PORT_PCR_PS(kPORT_PullUp)
331
332 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
333 | PORT_PCR_PE(kPORT_PullDisable)
334
335 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
336 * configured as a digital output. */
337 | PORT_PCR_SRE(kPORT_SlowSlewRate));
338
339 /* PORTD4 (pin 61) is configured as LCD_P44 */
340 PORT_SetPinMux(BOARD_LCD_P44_PORT, BOARD_LCD_P44_PIN, kPORT_PinDisabledOrAnalog);
341
342 PORTD->PCR[4] = ((PORTD->PCR[4] &
343 /* Mask bits to zero which are setting */
344 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
345
346 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
347 * corresponding PE field is set. */
348 | PORT_PCR_PS(kPORT_PullUp)
349
350 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
351 | PORT_PCR_PE(kPORT_PullDisable)
352
353 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
354 * configured as a digital output. */
355 | PORT_PCR_SRE(kPORT_SlowSlewRate));
356
357 /* PORTE20 (pin 9) is configured as LCD_P59 */
358 PORT_SetPinMux(BOARD_LCD_P59_PORT, BOARD_LCD_P59_PIN, kPORT_PinDisabledOrAnalog);
359
360 PORTE->PCR[20] = ((PORTE->PCR[20] &
361 /* Mask bits to zero which are setting */
362 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
363
364 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
365 * corresponding PE field is set. */
366 | PORT_PCR_PS(kPORT_PullUp)
367
368 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding
369 * pin. */
370 | PORT_PCR_PE(kPORT_PullDisable)
371
372 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
373 * configured as a digital output. */
374 | PORT_PCR_SRE(kPORT_SlowSlewRate));
375
376 /* PORTE21 (pin 10) is configured as LCD_P60 */
377 PORT_SetPinMux(BOARD_LCD_P60_PORT, BOARD_LCD_P60_PIN, kPORT_PinDisabledOrAnalog);
378
379 PORTE->PCR[21] = ((PORTE->PCR[21] &
380 /* Mask bits to zero which are setting */
381 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
382
383 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
384 * corresponding PE field is set. */
385 | PORT_PCR_PS(kPORT_PullUp)
386
387 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding
388 * pin. */
389 | PORT_PCR_PE(kPORT_PullDisable)
390
391 /* Slew Rate Enable: Slow slew rate is configured on the corresponding pin, if the pin is
392 * configured as a digital output. */
393 | PORT_PCR_SRE(kPORT_SlowSlewRate));
394}
395
396/* clang-format off */
397/*
398 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
399BOARD_InitBUTTONSPins:
400- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
401- pin_list:
402 - {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,
403 passive_filter: disable}
404 - {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,
405 pull_select: up, pull_enable: enable}
406 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
407 */
408/* clang-format on */
409
410/* FUNCTION ************************************************************************************************************
411 *
412 * Function Name : BOARD_InitBUTTONSPins
413 * Description : Configures pin routing and optionally pin electrical features.
414 *
415 * END ****************************************************************************************************************/
416void BOARD_InitBUTTONSPins(void)
417{
418 /* Port A Clock Gate Control: Clock enabled */
419 CLOCK_EnableClock(kCLOCK_PortA);
420 /* Port C Clock Gate Control: Clock enabled */
421 CLOCK_EnableClock(kCLOCK_PortC);
422
423 gpio_pin_config_t SW1_config = {
424 .pinDirection = kGPIO_DigitalInput,
425 .outputLogic = 0U
426 };
427 /* Initialize GPIO functionality on pin PTA4 (pin 26) */
428 GPIO_PinInit(BOARD_SW1_GPIO, BOARD_SW1_PIN, &SW1_config);
429
430 gpio_pin_config_t SW3_config = {
431 .pinDirection = kGPIO_DigitalInput,
432 .outputLogic = 0U
433 };
434 /* Initialize GPIO functionality on pin PTC3 (pin 46) */
435 GPIO_PinInit(BOARD_SW3_GPIO, BOARD_SW3_PIN, &SW3_config);
436
437 const port_pin_config_t SW1 = {/* Internal pull-up resistor is enabled */
438 kPORT_PullUp,
439 /* Fast slew rate is configured */
440 kPORT_FastSlewRate,
441 /* Passive filter is disabled */
442 kPORT_PassiveFilterDisable,
443 /* Low drive strength is configured */
444 kPORT_LowDriveStrength,
445 /* Pin is configured as PTA4 */
446 kPORT_MuxAsGpio};
447 /* PORTA4 (pin 26) is configured as PTA4 */
448 PORT_SetPinConfig(BOARD_SW1_PORT, BOARD_SW1_PIN, &SW1);
449
450 const port_pin_config_t SW3 = {/* Internal pull-up resistor is enabled */
451 kPORT_PullUp,
452 /* Fast slew rate is configured */
453 kPORT_FastSlewRate,
454 /* Passive filter is disabled */
455 kPORT_PassiveFilterDisable,
456 /* Low drive strength is configured */
457 kPORT_LowDriveStrength,
458 /* Pin is configured as PTC3 */
459 kPORT_MuxAsGpio};
460 /* PORTC3 (pin 46) is configured as PTC3 */
461 PORT_SetPinConfig(BOARD_SW3_PORT, BOARD_SW3_PIN, &SW3);
462}
463
464/* clang-format off */
465/*
466 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
467BOARD_InitLEDsPins:
468- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
469- pin_list:
470 - {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,
471 pull_enable: disable}
472 - {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',
473 slew_rate: slow, pull_select: down, pull_enable: disable}
474 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
475 */
476/* clang-format on */
477
478/* FUNCTION ************************************************************************************************************
479 *
480 * Function Name : BOARD_InitLEDsPins
481 * Description : Configures pin routing and optionally pin electrical features.
482 *
483 * END ****************************************************************************************************************/
484void BOARD_InitLEDsPins(void)
485{
486 /* Port D Clock Gate Control: Clock enabled */
487 CLOCK_EnableClock(kCLOCK_PortD);
488 /* Port E Clock Gate Control: Clock enabled */
489 CLOCK_EnableClock(kCLOCK_PortE);
490
491 gpio_pin_config_t LED1_config = {
492 .pinDirection = kGPIO_DigitalOutput,
493 .outputLogic = 1U
494 };
495 /* Initialize GPIO functionality on pin PTD5 (pin 62) */
496 GPIO_PinInit(BOARD_LED1_GPIO, BOARD_LED1_PIN, &LED1_config);
497
498 gpio_pin_config_t LED2_config = {
499 .pinDirection = kGPIO_DigitalOutput,
500 .outputLogic = 1U
501 };
502 /* Initialize GPIO functionality on pin PTE31 (pin 19) */
503 GPIO_PinInit(BOARD_LED2_GPIO, BOARD_LED2_PIN, &LED2_config);
504
505 const port_pin_config_t LED1 = {/* Internal pull-up/down resistor is disabled */
506 kPORT_PullDisable,
507 /* Slow slew rate is configured */
508 kPORT_SlowSlewRate,
509 /* Passive filter is disabled */
510 kPORT_PassiveFilterDisable,
511 /* Low drive strength is configured */
512 kPORT_LowDriveStrength,
513 /* Pin is configured as PTD5 */
514 kPORT_MuxAsGpio};
515 /* PORTD5 (pin 62) is configured as PTD5 */
516 PORT_SetPinConfig(BOARD_LED1_PORT, BOARD_LED1_PIN, &LED1);
517
518 const port_pin_config_t LED2 = {/* Internal pull-up/down resistor is disabled */
519 kPORT_PullDisable,
520 /* Slow slew rate is configured */
521 kPORT_SlowSlewRate,
522 /* Passive filter is disabled */
523 kPORT_PassiveFilterDisable,
524 /* Low drive strength is configured */
525 kPORT_LowDriveStrength,
526 /* Pin is configured as PTE31 */
527 kPORT_MuxAsGpio};
528 /* PORTE31 (pin 19) is configured as PTE31 */
529 PORT_SetPinConfig(BOARD_LED2_PORT, BOARD_LED2_PIN, &LED2);
530}
531
532/* clang-format off */
533/*
534 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
535BOARD_InitDEBUG_UARTPins:
536- options: {callFromInitBoot: 'true', prefix: BOARD_, coreID: core0, enableClock: 'true'}
537- pin_list:
538 - {pin_num: '23', peripheral: LPUART0, signal: RX, pin_signal: PTA1/LPUART0_RX/TPM2_CH0, slew_rate: fast, pull_select: down, pull_enable: disable}
539 - {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}
540 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
541 */
542/* clang-format on */
543
544/* FUNCTION ************************************************************************************************************
545 *
546 * Function Name : BOARD_InitDEBUG_UARTPins
547 * Description : Configures pin routing and optionally pin electrical features.
548 *
549 * END ****************************************************************************************************************/
550void BOARD_InitDEBUG_UARTPins(void)
551{
552 /* Port A Clock Gate Control: Clock enabled */
553 CLOCK_EnableClock(kCLOCK_PortA);
554
555 const port_pin_config_t DEBUG_UART0_RX = {/* Internal pull-up/down resistor is disabled */
556 kPORT_PullDisable,
557 /* Fast slew rate is configured */
558 kPORT_FastSlewRate,
559 /* Passive filter is disabled */
560 kPORT_PassiveFilterDisable,
561 /* Low drive strength is configured */
562 kPORT_LowDriveStrength,
563 /* Pin is configured as LPUART0_RX */
564 kPORT_MuxAlt2};
565 /* PORTA1 (pin 23) is configured as LPUART0_RX */
566 PORT_SetPinConfig(BOARD_DEBUG_UART0_RX_PORT, BOARD_DEBUG_UART0_RX_PIN, &DEBUG_UART0_RX);
567
568 const port_pin_config_t DEBUG_UART0_TX = {/* Internal pull-up/down resistor is disabled */
569 kPORT_PullDisable,
570 /* Fast slew rate is configured */
571 kPORT_FastSlewRate,
572 /* Passive filter is disabled */
573 kPORT_PassiveFilterDisable,
574 /* Low drive strength is configured */
575 kPORT_LowDriveStrength,
576 /* Pin is configured as LPUART0_TX */
577 kPORT_MuxAlt2};
578 /* PORTA2 (pin 24) is configured as LPUART0_TX */
579 PORT_SetPinConfig(BOARD_DEBUG_UART0_TX_PORT, BOARD_DEBUG_UART0_TX_PIN, &DEBUG_UART0_TX);
580
581 SIM->SOPT5 = ((SIM->SOPT5 &
582 /* Mask bits to zero which are setting */
583 (~(SIM_SOPT5_LPUART0TXSRC_MASK | SIM_SOPT5_LPUART0RXSRC_MASK)))
584
585 /* LPUART0 Transmit Data Source Select: LPUART0_TX pin. */
586 | SIM_SOPT5_LPUART0TXSRC(SOPT5_LPUART0TXSRC_LPUART_TX)
587
588 /* LPUART0 Receive Data Source Select: LPUART_RX pin. */
589 | SIM_SOPT5_LPUART0RXSRC(SOPT5_LPUART0RXSRC_LPUART_RX));
590}
591
592/* clang-format off */
593/*
594 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
595BOARD_InitUSBPins:
596- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
597- pin_list:
598 - {pin_num: '5', peripheral: USB0, signal: DP, pin_signal: USB0_DP}
599 - {pin_num: '6', peripheral: USB0, signal: DM, pin_signal: USB0_DM}
600 - {pin_num: '8', peripheral: USB0, signal: VREGIN, pin_signal: VREGIN}
601 - {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,
602 pull_select: up, pull_enable: disable}
603 - {pin_num: '27', peripheral: USB0, signal: CLKIN, pin_signal: PTA5/USB_CLKIN/TPM0_CH2, slew_rate: fast, pull_select: up, pull_enable: disable}
604 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
605 */
606/* clang-format on */
607
608/* FUNCTION ************************************************************************************************************
609 *
610 * Function Name : BOARD_InitUSBPins
611 * Description : Configures pin routing and optionally pin electrical features.
612 *
613 * END ****************************************************************************************************************/
614void BOARD_InitUSBPins(void)
615{
616 /* Port A Clock Gate Control: Clock enabled */
617 CLOCK_EnableClock(kCLOCK_PortA);
618 /* Port C Clock Gate Control: Clock enabled */
619 CLOCK_EnableClock(kCLOCK_PortC);
620
621 /* PORTA5 (pin 27) is configured as USB_CLKIN */
622 PORT_SetPinMux(BOARD_USB0_CLKIN_PORT, BOARD_USB0_CLKIN_PIN, kPORT_MuxAlt2);
623
624 PORTA->PCR[5] = ((PORTA->PCR[5] &
625 /* Mask bits to zero which are setting */
626 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
627
628 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
629 * corresponding PE field is set. */
630 | PORT_PCR_PS(kPORT_PullUp)
631
632 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
633 | PORT_PCR_PE(kPORT_PullDisable)
634
635 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
636 * configured as a digital output. */
637 | PORT_PCR_SRE(kPORT_FastSlewRate));
638
639 /* PORTC0 (pin 43) is configured as USB_SOF_OUT */
640 PORT_SetPinMux(BOARD_USB_SOF_OUT_PORT, BOARD_USB_SOF_OUT_PIN, kPORT_MuxAlt4);
641
642 PORTC->PCR[0] = ((PORTC->PCR[0] &
643 /* Mask bits to zero which are setting */
644 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
645
646 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
647 * corresponding PE field is set. */
648 | PORT_PCR_PS(kPORT_PullUp)
649
650 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
651 | PORT_PCR_PE(kPORT_PullDisable)
652
653 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
654 * configured as a digital output. */
655 | PORT_PCR_SRE(kPORT_FastSlewRate));
656}
657
658/* clang-format off */
659/*
660 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
661BOARD_InitACCEL_I2CPins:
662- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
663- pin_list:
664 - {pin_num: '20', peripheral: I2C0, signal: SCL, pin_signal: PTE24/TPM0_CH0/I2C0_SCL, slew_rate: fast, pull_select: up, pull_enable: enable}
665 - {pin_num: '21', peripheral: I2C0, signal: SDA, pin_signal: PTE25/TPM0_CH1/I2C0_SDA, slew_rate: fast, pull_select: up, pull_enable: enable}
666 - {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,
667 slew_rate: fast, pull_select: up, pull_enable: disable}
668 - {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,
669 pull_enable: disable}
670 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
671 */
672/* clang-format on */
673
674/* FUNCTION ************************************************************************************************************
675 *
676 * Function Name : BOARD_InitACCEL_I2CPins
677 * Description : Configures pin routing and optionally pin electrical features.
678 *
679 * END ****************************************************************************************************************/
680void BOARD_InitACCEL_I2CPins(void)
681{
682 /* Port C Clock Gate Control: Clock enabled */
683 CLOCK_EnableClock(kCLOCK_PortC);
684 /* Port D Clock Gate Control: Clock enabled */
685 CLOCK_EnableClock(kCLOCK_PortD);
686 /* Port E Clock Gate Control: Clock enabled */
687 CLOCK_EnableClock(kCLOCK_PortE);
688
689 gpio_pin_config_t INT1_ACCEL_config = {
690 .pinDirection = kGPIO_DigitalInput,
691 .outputLogic = 0U
692 };
693 /* Initialize GPIO functionality on pin PTC5 (pin 54) */
694 GPIO_PinInit(BOARD_INT1_ACCEL_GPIO, BOARD_INT1_ACCEL_PIN, &INT1_ACCEL_config);
695
696 gpio_pin_config_t INT2_ACCEL_config = {
697 .pinDirection = kGPIO_DigitalInput,
698 .outputLogic = 0U
699 };
700 /* Initialize GPIO functionality on pin PTD1 (pin 58) */
701 GPIO_PinInit(BOARD_INT2_ACCEL_GPIO, BOARD_INT2_ACCEL_PIN, &INT2_ACCEL_config);
702
703 /* PORTC5 (pin 54) is configured as PTC5 */
704 PORT_SetPinMux(BOARD_INT1_ACCEL_PORT, BOARD_INT1_ACCEL_PIN, kPORT_MuxAsGpio);
705
706 PORTC->PCR[5] = ((PORTC->PCR[5] &
707 /* Mask bits to zero which are setting */
708 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
709
710 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
711 * corresponding PE field is set. */
712 | PORT_PCR_PS(kPORT_PullUp)
713
714 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
715 | PORT_PCR_PE(kPORT_PullDisable)
716
717 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
718 * configured as a digital output. */
719 | PORT_PCR_SRE(kPORT_FastSlewRate));
720
721 /* PORTD1 (pin 58) is configured as PTD1 */
722 PORT_SetPinMux(BOARD_INT2_ACCEL_PORT, BOARD_INT2_ACCEL_PIN, kPORT_MuxAsGpio);
723
724 PORTD->PCR[1] = ((PORTD->PCR[1] &
725 /* Mask bits to zero which are setting */
726 (~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_SRE_MASK | PORT_PCR_ISF_MASK)))
727
728 /* Pull Select: Internal pullup resistor is enabled on the corresponding pin, if the
729 * corresponding PE field is set. */
730 | PORT_PCR_PS(kPORT_PullUp)
731
732 /* Pull Enable: Internal pullup or pulldown resistor is not enabled on the corresponding pin. */
733 | PORT_PCR_PE(kPORT_PullDisable)
734
735 /* Slew Rate Enable: Fast slew rate is configured on the corresponding pin, if the pin is
736 * configured as a digital output. */
737 | PORT_PCR_SRE(kPORT_FastSlewRate));
738
739 const port_pin_config_t I2C0_SCL = {/* Internal pull-up resistor is enabled */
740 kPORT_PullUp,
741 /* Fast slew rate is configured */
742 kPORT_FastSlewRate,
743 /* Passive filter is disabled */
744 kPORT_PassiveFilterDisable,
745 /* Low drive strength is configured */
746 kPORT_LowDriveStrength,
747 /* Pin is configured as I2C0_SCL */
748 kPORT_MuxAlt5};
749 /* PORTE24 (pin 20) is configured as I2C0_SCL */
750 PORT_SetPinConfig(BOARD_I2C0_SCL_PORT, BOARD_I2C0_SCL_PIN, &I2C0_SCL);
751
752 const port_pin_config_t I2C0_SDA = {/* Internal pull-up resistor is enabled */
753 kPORT_PullUp,
754 /* Fast slew rate is configured */
755 kPORT_FastSlewRate,
756 /* Passive filter is disabled */
757 kPORT_PassiveFilterDisable,
758 /* Low drive strength is configured */
759 kPORT_LowDriveStrength,
760 /* Pin is configured as I2C0_SDA */
761 kPORT_MuxAlt5};
762 /* PORTE25 (pin 21) is configured as I2C0_SDA */
763 PORT_SetPinConfig(BOARD_I2C0_SDA_PORT, BOARD_I2C0_SDA_PIN, &I2C0_SDA);
764}
765
766/* clang-format off */
767/*
768 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
769BOARD_InitOSCPins:
770- options: {prefix: BOARD_, coreID: core0, enableClock: 'true'}
771- pin_list:
772 - {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}
773 - {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}
774 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
775 */
776/* clang-format on */
777
778/* FUNCTION ************************************************************************************************************
779 *
780 * Function Name : BOARD_InitOSCPins
781 * Description : Configures pin routing and optionally pin electrical features.
782 *
783 * END ****************************************************************************************************************/
784void BOARD_InitOSCPins(void)
785{
786 /* Port A Clock Gate Control: Clock enabled */
787 CLOCK_EnableClock(kCLOCK_PortA);
788
789 /* PORTA18 (pin 32) is configured as EXTAL0 */
790 PORT_SetPinMux(BOARD_EXTAL_32KHZ_PORT, BOARD_EXTAL_32KHZ_PIN, kPORT_PinDisabledOrAnalog);
791
792 /* PORTA19 (pin 33) is configured as XTAL0 */
793 PORT_SetPinMux(BOARD_XTAL_32KHZ_PORT, BOARD_XTAL_32KHZ_PIN, kPORT_PinDisabledOrAnalog);
794}
795/***********************************************************************************************************************
796 * EOF
797 **********************************************************************************************************************/