1 /*
2 * Copyright 2018 NXP.
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8 /***********************************************************************************************************************
9 * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
10 * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
11 **********************************************************************************************************************/
12
13 /* clang-format off */
14 /*
15 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
16 !!GlobalInfo
17 product: Pins v4.1
18 processor: MKE04Z8xxx4
19 package_id: MKE04Z8VFK4
20 mcu_data: ksdk2_0
21 processor_version: 4.0.0
22 board: FRDM-KE04Z
23 pin_labels:
24 - {pin_num: '16', pin_signal: PTB0/KBI0_P4/UART0_RX/SPI0_PCS0/PWT_IN1/ADC0_SE4, label: 'J1[2]/UART0_RX_TGTMCU', identifier: DEBUG_UART_RX}
25 - {pin_num: '15', pin_signal: PTB1/KBI0_P5/UART0_TX/SPI0_MISO/TCLK2/ADC0_SE5, label: 'J1[4]/PTB1_IRTX/UART0_TX_TGTMCU', identifier: DEBUG_UART_TX}
26 - {pin_num: '2', pin_signal: PTC4/KBI1_P0/FTM2_CH2/PWT_IN0, label: 'J1[8]/D4[4]/PTC4_GREEN', identifier: LED_GREEN}
27 - {pin_num: '13', pin_signal: PTB3/KBI0_P7/SPI0_MOSI/FTM0_CH1/ADC0_SE7, label: 'J1[10]/J2[10]/J4[3]/D4[3]/PTB3_D12_SPI0_MOSI/PTB3_BLUE', identifier: LED_BLUE}
28 - {pin_num: '1', pin_signal: PTC5/KBI1_P1/FTM2_CH3/BUSOUT, label: 'J1[12]/D4[1]/PTC5_RED', identifier: LED_RED}
29 - {pin_num: '8', pin_signal: PTB4/KBI1_P6/FTM2_CH4/SPI0_MISO/ACMP1_IN2/NMI_b, label: 'J1[14]/J2[8]/J4[5]/PTB4_D11_SPI0_MISO'}
30 - {pin_num: '14', pin_signal: PTB2/KBI0_P6/SPI0_SCK/FTM0_CH0/ACMP0_IN0/ADC0_SE6, label: 'J2[2]/J2[12]/J4[1]//PTB2_D13_SPI0_CLK'}
31 - {pin_num: '12', pin_signal: PTC0/KBI1_P2/FTM2_CH0/ADC0_SE8, label: 'J2[4]/PTC0_ACCEL_INT1', identifier: ACCEL_INT1}
32 - {pin_num: '7', pin_signal: PTB5/KBI1_P7/FTM2_CH5/SPI0_PCS0/ACMP1_OUT, label: 'J2[6]/PTB5_TSI', identifier: PTB5_TSI}
33 - {pin_num: '20', pin_signal: PTA2/KBI0_P2/UART0_RX/I2C0_SDA, label: 'J1[11]/J2[18]/PTA2_D14_T2/PTA2_ACCEL_SDA', identifier: ACCEL_SDA}
34 - {pin_num: '19', pin_signal: PTA3/KBI0_P3/UART0_TX/I2C0_SCL, label: 'J2[20]/J4[7]/PTA3_D15_ANB0/PTA3_ACCEL_SCL', identifier: ACCEL_SCL}
35 - {pin_num: '5', pin_signal: PTB7/I2C0_SCL/EXTAL, label: 'J1[9]/PTB7_GPIO/EXTAL', identifier: EXTAL}
36 - {pin_num: '6', pin_signal: PTB6/I2C0_SDA/XTAL, label: 'J1[15]/PTB6_LED3/XTAL', identifier: XTAL}
37 - {pin_num: '21', pin_signal: PTA1/KBI0_P1/FTM0_CH1/ACMP0_IN1/ADC0_SE1, label: 'J2[15]/PTA1_ACMP0_IN1/PTA1_IRRX'}
38 - {pin_num: '11', pin_signal: PTC1/KBI1_P3/FTM2_CH1/ADC0_SE9, label: 'J2[3]/PTC1_TSI/PTC1_PWM1', identifier: PTC1_TSI}
39 - {pin_num: '4', pin_signal: VSS/VSSA/VREFL, label: GND}
40 - {pin_num: '3', pin_signal: VDD/VDDA/VREFH, label: 'J2[16]/P3V3_KE04Z'}
41 - {pin_num: '10', pin_signal: PTC2/KBI1_P4/FTM2_CH2/ADC0_SE10, label: 'J3[4]/PTC2_A1_ANB1'}
42 - {pin_num: '9', pin_signal: PTC3/KBI1_P5/FTM2_CH3/ADC0_SE11, label: 'J3[2]/PTC3_A0_ANB2'}
43 - {pin_num: '17', pin_signal: PTA7/FTM2_FLT2/SPI0_MOSI/ACMP1_IN1/ADC0_SE3, label: 'J3[10]/PTA7_A4'}
44 - {pin_num: '18', pin_signal: PTA6/FTM2_FLT1/SPI0_SCK/ACMP1_IN0/ADC0_SE2, label: 'J3[8]/PTA6_A3'}
45 - {pin_num: '23', pin_signal: PTA5/IRQ/TCLK1/RESET_b, label: 'J4[6]/J7[10]/RST_TGTMCU/SW1'}
46 - {pin_num: '24', pin_signal: PTA4/ACMP0_OUT/SWD_DIO, label: 'J7[2]/SWD_DIO_TGTMCU'}
47 - {pin_num: '22', pin_signal: PTA0/KBI0_P0/FTM0_CH0/RTCO/ACMP0_IN2/ADC0_SE0/SWD_CLK, label: 'J7[4]/PTA0_SWD_CLK/SWD_CLK_TGTMCU'}
48 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
49 */
50 /* clang-format on */
51
52 #include "fsl_common.h"
53 #include "fsl_port.h"
54 #include "fsl_gpio.h"
55 #include "pin_mux.h"
56
57 /* FUNCTION ************************************************************************************************************
58 *
59 * Function Name : BOARD_InitBootPins
60 * Description : Calls initialization functions.
61 *
62 * END ****************************************************************************************************************/
BOARD_InitBootPins(void)63 void BOARD_InitBootPins(void)
64 {
65 BOARD_InitPins();
66 BOARD_InitDEBUG_UARTPins();
67 }
68
69 /* clang-format off */
70 /*
71 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
72 BOARD_InitPins:
73 - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
74 - pin_list: []
75 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
76 */
77 /* clang-format on */
78
79 /* FUNCTION ************************************************************************************************************
80 *
81 * Function Name : BOARD_InitPins
82 * Description : Configures pin routing and optionally pin electrical features.
83 *
84 * END ****************************************************************************************************************/
BOARD_InitPins(void)85 void BOARD_InitPins(void)
86 {
87 }
88
89 /* clang-format off */
90 /*
91 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
92 BOARD_InitLEDsPins:
93 - options: {coreID: core0, enableClock: 'true'}
94 - pin_list:
95 - {pin_num: '13', peripheral: GPIOA, signal: 'GPIO, 11', pin_signal: PTB3/KBI0_P7/SPI0_MOSI/FTM0_CH1/ADC0_SE7, direction: OUTPUT, gpio_init_state: 'true'}
96 - {pin_num: '2', peripheral: GPIOA, signal: 'GPIO, 20', pin_signal: PTC4/KBI1_P0/FTM2_CH2/PWT_IN0, direction: OUTPUT, gpio_init_state: 'true'}
97 - {pin_num: '1', peripheral: GPIOA, signal: 'GPIO, 21', pin_signal: PTC5/KBI1_P1/FTM2_CH3/BUSOUT, direction: OUTPUT, gpio_init_state: 'true'}
98 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
99 */
100 /* clang-format on */
101
102 /* FUNCTION ************************************************************************************************************
103 *
104 * Function Name : BOARD_InitLEDsPins
105 * Description : Configures pin routing and optionally pin electrical features.
106 *
107 * END ****************************************************************************************************************/
BOARD_InitLEDsPins(void)108 void BOARD_InitLEDsPins(void)
109 {
110
111 gpio_pin_config_t LED_BLUE_config = {
112 .pinDirection = kGPIO_DigitalOutput,
113 .outputLogic = 1U
114 };
115 /* Initialize GPIO functionality on pin PTA11 (pin 13) */
116 GPIO_PinInit(BOARD_INITLEDSPINS_LED_BLUE_GPIO_PORT, BOARD_INITLEDSPINS_LED_BLUE_PIN, &LED_BLUE_config);
117
118 gpio_pin_config_t LED_GREEN_config = {
119 .pinDirection = kGPIO_DigitalOutput,
120 .outputLogic = 1U
121 };
122 /* Initialize GPIO functionality on pin PTA20 (pin 2) */
123 GPIO_PinInit(BOARD_INITLEDSPINS_LED_GREEN_GPIO_PORT, BOARD_INITLEDSPINS_LED_GREEN_PIN, &LED_GREEN_config);
124
125 gpio_pin_config_t LED_RED_config = {
126 .pinDirection = kGPIO_DigitalOutput,
127 .outputLogic = 1U
128 };
129 /* Initialize GPIO functionality on pin PTA21 (pin 1) */
130 GPIO_PinInit(BOARD_INITLEDSPINS_LED_RED_GPIO_PORT, BOARD_INITLEDSPINS_LED_RED_PIN, &LED_RED_config);
131 }
132
133 /* clang-format off */
134 /*
135 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
136 BOARD_InitTOUCHPins:
137 - options: {coreID: core0, enableClock: 'true'}
138 - pin_list:
139 - {pin_num: '7', peripheral: GPIOA, signal: 'GPIO, 13', pin_signal: PTB5/KBI1_P7/FTM2_CH5/SPI0_PCS0/ACMP1_OUT}
140 - {pin_num: '11', peripheral: GPIOA, signal: 'GPIO, 17', pin_signal: PTC1/KBI1_P3/FTM2_CH1/ADC0_SE9}
141 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
142 */
143 /* clang-format on */
144
145 /* FUNCTION ************************************************************************************************************
146 *
147 * Function Name : BOARD_InitTOUCHPins
148 * Description : Configures pin routing and optionally pin electrical features.
149 *
150 * END ****************************************************************************************************************/
BOARD_InitTOUCHPins(void)151 void BOARD_InitTOUCHPins(void)
152 {
153 }
154
155 /* clang-format off */
156 /*
157 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
158 BOARD_InitDEBUG_UARTPins:
159 - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
160 - pin_list:
161 - {pin_num: '16', peripheral: UART0, signal: RX, pin_signal: PTB0/KBI0_P4/UART0_RX/SPI0_PCS0/PWT_IN1/ADC0_SE4}
162 - {pin_num: '15', peripheral: UART0, signal: TX, pin_signal: PTB1/KBI0_P5/UART0_TX/SPI0_MISO/TCLK2/ADC0_SE5}
163 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
164 */
165 /* clang-format on */
166
167 /* FUNCTION ************************************************************************************************************
168 *
169 * Function Name : BOARD_InitDEBUG_UARTPins
170 * Description : Configures pin routing and optionally pin electrical features.
171 *
172 * END ****************************************************************************************************************/
BOARD_InitDEBUG_UARTPins(void)173 void BOARD_InitDEBUG_UARTPins(void)
174 {
175 /* pin 16,15 is configured as UART0_RX, UART0_TX */
176 PORT_SetPinSelect(kPORT_UART0, kPORT_UART0_RXPTB0_TXPTB1);
177 }
178
179 /* clang-format off */
180 /*
181 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
182 BOARD_InitACCELPins:
183 - options: {coreID: core0, enableClock: 'true'}
184 - pin_list:
185 - {pin_num: '19', peripheral: I2C0, signal: SCL, pin_signal: PTA3/KBI0_P3/UART0_TX/I2C0_SCL}
186 - {pin_num: '20', peripheral: I2C0, signal: SDA, pin_signal: PTA2/KBI0_P2/UART0_RX/I2C0_SDA}
187 - {pin_num: '12', peripheral: GPIOA, signal: 'GPIO, 16', pin_signal: PTC0/KBI1_P2/FTM2_CH0/ADC0_SE8}
188 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
189 */
190 /* clang-format on */
191
192 /* FUNCTION ************************************************************************************************************
193 *
194 * Function Name : BOARD_InitACCELPins
195 * Description : Configures pin routing and optionally pin electrical features.
196 *
197 * END ****************************************************************************************************************/
BOARD_InitACCELPins(void)198 void BOARD_InitACCELPins(void)
199 {
200 /* pin 20,19 is configured as I2C0_SDA, I2C0_SCL */
201 PORT_SetPinSelect(kPORT_I2C0, kPORT_I2C0_SCLPTA3_SDAPTA2);
202 }
203
204 /* clang-format off */
205 /*
206 * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
207 BOARD_InitOSCPins:
208 - options: {coreID: core0, enableClock: 'true'}
209 - pin_list:
210 - {pin_num: '5', peripheral: OSC, signal: EXTAL, pin_signal: PTB7/I2C0_SCL/EXTAL}
211 - {pin_num: '6', peripheral: OSC, signal: XTAL, pin_signal: PTB6/I2C0_SDA/XTAL}
212 * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
213 */
214 /* clang-format on */
215
216 /* FUNCTION ************************************************************************************************************
217 *
218 * Function Name : BOARD_InitOSCPins
219 * Description : Configures pin routing and optionally pin electrical features.
220 *
221 * END ****************************************************************************************************************/
BOARD_InitOSCPins(void)222 void BOARD_InitOSCPins(void)
223 {
224 }
225 /***********************************************************************************************************************
226 * EOF
227 **********************************************************************************************************************/
228