diff options
Diffstat (limited to 'lib/chibios-contrib/ext/mcux-sdk/boards/frdmke02z40m/project_template/pin_mux.c')
-rw-r--r-- | lib/chibios-contrib/ext/mcux-sdk/boards/frdmke02z40m/project_template/pin_mux.c | 280 |
1 files changed, 280 insertions, 0 deletions
diff --git a/lib/chibios-contrib/ext/mcux-sdk/boards/frdmke02z40m/project_template/pin_mux.c b/lib/chibios-contrib/ext/mcux-sdk/boards/frdmke02z40m/project_template/pin_mux.c new file mode 100644 index 000000000..143fedf54 --- /dev/null +++ b/lib/chibios-contrib/ext/mcux-sdk/boards/frdmke02z40m/project_template/pin_mux.c | |||
@@ -0,0 +1,280 @@ | |||
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: MKE02Z64xxx4 | ||
19 | package_id: MKE02Z64VLH4 | ||
20 | mcu_data: ksdk2_0 | ||
21 | processor_version: 4.0.0 | ||
22 | board: FRDM-KE02Z40M | ||
23 | pin_labels: | ||
24 | - {pin_num: '5', pin_signal: PTE7/FTM2_CLK/FTM1_CH1, label: 'D4[3]/LEDRGB_BLUE', identifier: PTE7_BLUE} | ||
25 | - {pin_num: '6', pin_signal: PTH2/BUSOUT/FTM1_CH0, label: 'D4[4]/LEDRGB_GREEN', identifier: PTH2_GREEN} | ||
26 | - {pin_num: '14', pin_signal: PTH1/FTM2_CH1, label: 'D4[1]/LEDRGB_RED', identifier: PTH1_RED} | ||
27 | - {pin_num: '23', pin_signal: PTD6/KBI1_P6/UART2_RX, label: 'J1[7]/PTD6_TSI/PTD6_RXD2', identifier: PTD6_TSI} | ||
28 | - {pin_num: '22', pin_signal: PTD7/KBI1_P7/UART2_TX, label: 'J1[5]/PTD7_TSI/PTD7_TXD2', identifier: PTD7_TSI} | ||
29 | - {pin_num: '51', pin_signal: PTC7/UART1_TX, label: 'J1[1]/PTC7_TXD1', identifier: DEBUG_UART_TX} | ||
30 | - {pin_num: '52', pin_signal: PTC6/UART1_RX, label: 'J1[3]/PTC6_RXD1', identifier: DEBUG_UART_RX} | ||
31 | - {pin_num: '47', pin_signal: PTA3/KBI0_P3/UART0_TX/I2C0_SCL, label: 'J2[20]/U1[4]/PTA3_ACCEL_SCL/PTA3_D15', identifier: ACCEL_SCL} | ||
32 | - {pin_num: '48', pin_signal: PTA2/KBI0_P2/UART0_RX/I2C0_SDA, label: 'J2[18]/U1[6]/PTA2_ACCEL_SDA/PTA2_D14', identifier: ACCEL_SDA} | ||
33 | - {pin_num: '11', pin_signal: PTB7/I2C0_SCL/EXTAL, label: 'Y1[2]/EXTAL', identifier: EXTAL} | ||
34 | - {pin_num: '12', pin_signal: PTB6/I2C0_SDA/XTAL, label: 'Y1[1]/XTAL_Y', identifier: XTAL} | ||
35 | - {pin_num: '1', pin_signal: PTD1/KBI1_P1/FTM2_CH3/SPI1_MOSI, label: 'J1[12]/PTD1_D5_PWM3'} | ||
36 | - {pin_num: '2', pin_signal: PTD0/KBI1_P0/FTM2_CH2/SPI1_SCK, label: 'J1[8]/PTD0_D3_PWM2'} | ||
37 | - {pin_num: '3', pin_signal: PTH7, label: 'J10[9]/PTH7_GPIO9'} | ||
38 | - {pin_num: '4', pin_signal: PTH6, label: 'J10[11]/PTH6_GPIO10'} | ||
39 | - {pin_num: '7', pin_signal: VDD7, label: 'J3[2]/J7[1]/P3V3_KE02Z'} | ||
40 | - {pin_num: '8', pin_signal: VDDA/VREFH, label: 'J3[2]/J7[1]/P3V3_KE02Z'} | ||
41 | - {pin_num: '9', pin_signal: VREFL, label: GND} | ||
42 | - {pin_num: '10', pin_signal: VSSA/VSS, label: GND} | ||
43 | - {pin_num: '13', pin_signal: VSS13, label: GND} | ||
44 | - {pin_num: '15', pin_signal: PTH0/FTM2_CH0, label: 'J2[4]'} | ||
45 | - {pin_num: '16', pin_signal: PTE6, label: 'J1[13]'} | ||
46 | - {pin_num: '17', pin_signal: PTE5, label: 'J1[15]'} | ||
47 | - {pin_num: '18', pin_signal: PTB5/FTM2_CH5/SPI0_PCS0/ACMP1_OUT, label: 'J2[6]'} | ||
48 | - {pin_num: '19', pin_signal: PTB4/FTM2_CH4/SPI0_MISO/NMI/ACMP1_IN2, label: 'J1[14]/J2[10]'} | ||
49 | - {pin_num: '20', pin_signal: PTC3/FTM2_CH3/ADC0_SE11, label: 'J10[10]'} | ||
50 | - {pin_num: '21', pin_signal: PTC2/FTM2_CH2/ADC0_SE10, label: 'J10[8]'} | ||
51 | - {pin_num: '24', pin_signal: PTD5/KBI1_P5, label: 'J1[6]'} | ||
52 | - {pin_num: '25', pin_signal: PTC1/FTM2_CH1/ADC0_SE9, label: 'J2[3]/J10[6]/PTC1_A2_PWM1'} | ||
53 | - {pin_num: '26', pin_signal: PTC0/FTM2_CH0/ADC0_SE8, label: 'J10[4]'} | ||
54 | - {pin_num: '27', pin_signal: PTF7/ADC0_SE15, label: 'J2[9]/J10[2]/PTF7_A0_ANA0'} | ||
55 | - {pin_num: '28', pin_signal: PTF6/ADC0_SE14, label: 'J2[11]/J10[12]/PTF6_A5_ANA1'} | ||
56 | - {pin_num: '29', pin_signal: PTF5/ADC0_SE13, label: PTF5_THER} | ||
57 | - {pin_num: '30', pin_signal: PTF4/ADC0_SE12, label: PTF4_THER} | ||
58 | - {pin_num: '31', pin_signal: PTB3/KBI0_P7/SPI0_MOSI/FTM0_CH1/ADC0_SE7, label: 'J2[8]/J2[19]/PTB3_D11_ANB2'} | ||
59 | - {pin_num: '32', pin_signal: PTB2/KBI0_P6/SPI0_SCK/FTM0_CH0/ADC0_SE6, label: 'J2[1]/J2[12]'} | ||
60 | - {pin_num: '33', pin_signal: PTB1/KBI0_P5/UART0_TX/ADC0_SE5, label: 'J1[4]/PTB1_D1/PTB1_IRTX'} | ||
61 | - {pin_num: '34', pin_signal: PTB0/KBI0_P4/UART0_RX/ADC0_SE4, label: 'J1[2]'} | ||
62 | - {pin_num: '35', pin_signal: PTF3, label: 'J2[5]/PTF3_LED4'} | ||
63 | - {pin_num: '36', pin_signal: PTF2, label: 'J2[7]/PTF2_LED6'} | ||
64 | - {pin_num: '37', pin_signal: PTA7/FTM2_FLT2/ACMP1_IN1/ADC0_SE3, label: 'J1[16]/J2[17]/PTA7_D7_ANB1'} | ||
65 | - {pin_num: '38', pin_signal: PTA6/FTM2_FLT1/ACMP1_IN0/ADC0_SE2, label: 'J2[15]/PTA6_ANB0'} | ||
66 | - {pin_num: '39', pin_signal: PTE4, label: 'J1[9]'} | ||
67 | - {pin_num: '40', pin_signal: VSS40, label: GND} | ||
68 | - {pin_num: '41', pin_signal: VDD41, label: 'J3[2]/J7[1]/P3V3_KE02Z'} | ||
69 | - {pin_num: '42', pin_signal: PTF1, label: 'J9[11]'} | ||
70 | - {pin_num: '43', pin_signal: PTF0, label: 'J9[13]'} | ||
71 | - {pin_num: '44', pin_signal: PTD4/KBI1_P4, label: 'U1[11]/PTD4_ACCEL_INT1', identifier: ACCEL_INT1} | ||
72 | - {pin_num: '45', pin_signal: PTD3/KBI1_P3/SPI1_PCS0, label: 'U1[9]/PTD3_ACCEL_INT2', identifier: ACCEL_INT2} | ||
73 | - {pin_num: '46', pin_signal: PTD2/KBI1_P2/SPI1_MISO, label: 'J9[9]'} | ||
74 | - {pin_num: '49', pin_signal: PTA1/KBI0_P1/FTM0_CH1/ACMP0_IN1/ADC0_SE1, label: 'J1[10]/PTA1_D4_T1/PTA1_IRRX/PTA1_D4_T1'} | ||
75 | - {pin_num: '50', pin_signal: PTA0/KBI0_P0/FTM0_CH0/ACMP0_IN0/ADC0_SE0, label: 'J2[2]'} | ||
76 | - {pin_num: '53', pin_signal: PTE3/SPI0_PCS0, label: 'J9[7]'} | ||
77 | - {pin_num: '54', pin_signal: PTE2/SPI0_MISO, label: 'J9[5]'} | ||
78 | - {pin_num: '55', pin_signal: PTG3, label: 'J9[15]'} | ||
79 | - {pin_num: '56', pin_signal: PTG2, label: 'J10[3]'} | ||
80 | - {pin_num: '57', pin_signal: PTG1, label: 'J10[1]'} | ||
81 | - {pin_num: '58', pin_signal: PTG0, label: 'J10[5]'} | ||
82 | - {pin_num: '59', pin_signal: PTE1/SPI0_MOSI, label: 'J9[3]'} | ||
83 | - {pin_num: '60', pin_signal: PTE0/SPI0_SCK/FTM1_CLK, label: 'J9[1]'} | ||
84 | - {pin_num: '61', pin_signal: PTC5/FTM1_CH1/RTCO, label: 'J1[11]'} | ||
85 | - {pin_num: '62', pin_signal: PTC4/RTCO/FTM1_CH0/ACMP0_IN2/SWD_CLK, label: 'J10[7]'} | ||
86 | - {pin_num: '63', pin_signal: PTA5/IRQ/FTM0_CLK/RESET, label: 'J5[1]/J7[10]/J9[6]/RST_GTGMCU/SW1'} | ||
87 | - {pin_num: '64', pin_signal: PTA4/ACMP0_OUT/SWD_DIO, label: 'J7[2]/SWD_DIO_TGTMCU'} | ||
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 ****************************************************************************************************************/ | ||
103 | void 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 ************************************* | ||
112 | BOARD_InitPins: | ||
113 | - options: {callFromInitBoot: 'true', 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 ****************************************************************************************************************/ | ||
125 | void BOARD_InitPins(void) | ||
126 | { | ||
127 | } | ||
128 | |||
129 | /* clang-format off */ | ||
130 | /* | ||
131 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
132 | BOARD_InitLEDsPins: | ||
133 | - options: {coreID: core0, enableClock: 'true'} | ||
134 | - pin_list: | ||
135 | - {pin_num: '5', peripheral: GPIOB, signal: 'GPIO, 7', pin_signal: PTE7/FTM2_CLK/FTM1_CH1, direction: OUTPUT, gpio_init_state: 'true'} | ||
136 | - {pin_num: '6', peripheral: GPIOB, signal: 'GPIO, 26', pin_signal: PTH2/BUSOUT/FTM1_CH0, direction: OUTPUT, gpio_init_state: 'true'} | ||
137 | - {pin_num: '14', peripheral: GPIOB, signal: 'GPIO, 25', pin_signal: PTH1/FTM2_CH1, direction: OUTPUT, gpio_init_state: 'true'} | ||
138 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
139 | */ | ||
140 | /* clang-format on */ | ||
141 | |||
142 | /* FUNCTION ************************************************************************************************************ | ||
143 | * | ||
144 | * Function Name : BOARD_InitLEDsPins | ||
145 | * Description : Configures pin routing and optionally pin electrical features. | ||
146 | * | ||
147 | * END ****************************************************************************************************************/ | ||
148 | void BOARD_InitLEDsPins(void) | ||
149 | { | ||
150 | |||
151 | gpio_pin_config_t PTE7_BLUE_config = { | ||
152 | .pinDirection = kGPIO_DigitalOutput, | ||
153 | .outputLogic = 1U | ||
154 | }; | ||
155 | /* Initialize GPIO functionality on pin PTB7 (pin 5) */ | ||
156 | GPIO_PinInit(BOARD_INITLEDSPINS_PTE7_BLUE_GPIO_PORT, BOARD_INITLEDSPINS_PTE7_BLUE_PIN, &PTE7_BLUE_config); | ||
157 | |||
158 | gpio_pin_config_t PTH1_RED_config = { | ||
159 | .pinDirection = kGPIO_DigitalOutput, | ||
160 | .outputLogic = 1U | ||
161 | }; | ||
162 | /* Initialize GPIO functionality on pin PTB25 (pin 14) */ | ||
163 | GPIO_PinInit(BOARD_INITLEDSPINS_PTH1_RED_GPIO_PORT, BOARD_INITLEDSPINS_PTH1_RED_PIN, &PTH1_RED_config); | ||
164 | |||
165 | gpio_pin_config_t PTH2_GREEN_config = { | ||
166 | .pinDirection = kGPIO_DigitalOutput, | ||
167 | .outputLogic = 1U | ||
168 | }; | ||
169 | /* Initialize GPIO functionality on pin PTB26 (pin 6) */ | ||
170 | GPIO_PinInit(BOARD_INITLEDSPINS_PTH2_GREEN_GPIO_PORT, BOARD_INITLEDSPINS_PTH2_GREEN_PIN, &PTH2_GREEN_config); | ||
171 | } | ||
172 | |||
173 | /* clang-format off */ | ||
174 | /* | ||
175 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
176 | BOARD_InitTOUCHPins: | ||
177 | - options: {coreID: core0, enableClock: 'true'} | ||
178 | - pin_list: | ||
179 | - {pin_num: '23', peripheral: GPIOA, signal: 'GPIO, 30', pin_signal: PTD6/KBI1_P6/UART2_RX, direction: INPUT} | ||
180 | - {pin_num: '22', peripheral: GPIOA, signal: 'GPIO, 31', pin_signal: PTD7/KBI1_P7/UART2_TX, direction: INPUT} | ||
181 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
182 | */ | ||
183 | /* clang-format on */ | ||
184 | |||
185 | /* FUNCTION ************************************************************************************************************ | ||
186 | * | ||
187 | * Function Name : BOARD_InitTOUCHPins | ||
188 | * Description : Configures pin routing and optionally pin electrical features. | ||
189 | * | ||
190 | * END ****************************************************************************************************************/ | ||
191 | void BOARD_InitTOUCHPins(void) | ||
192 | { | ||
193 | |||
194 | gpio_pin_config_t PTD6_TSI_config = { | ||
195 | .pinDirection = kGPIO_DigitalInput, | ||
196 | .outputLogic = 0U | ||
197 | }; | ||
198 | /* Initialize GPIO functionality on pin PTA30 (pin 23) */ | ||
199 | GPIO_PinInit(BOARD_INITTOUCHPINS_PTD6_TSI_GPIO_PORT, BOARD_INITTOUCHPINS_PTD6_TSI_PIN, &PTD6_TSI_config); | ||
200 | |||
201 | gpio_pin_config_t PTD7_TSI_config = { | ||
202 | .pinDirection = kGPIO_DigitalInput, | ||
203 | .outputLogic = 0U | ||
204 | }; | ||
205 | /* Initialize GPIO functionality on pin PTA31 (pin 22) */ | ||
206 | GPIO_PinInit(BOARD_INITTOUCHPINS_PTD7_TSI_GPIO_PORT, BOARD_INITTOUCHPINS_PTD7_TSI_PIN, &PTD7_TSI_config); | ||
207 | } | ||
208 | |||
209 | /* clang-format off */ | ||
210 | /* | ||
211 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
212 | BOARD_InitDEBUG_UARTPins: | ||
213 | - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'} | ||
214 | - pin_list: | ||
215 | - {pin_num: '52', peripheral: UART1, signal: RX, pin_signal: PTC6/UART1_RX} | ||
216 | - {pin_num: '51', peripheral: UART1, signal: TX, pin_signal: PTC7/UART1_TX} | ||
217 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
218 | */ | ||
219 | /* clang-format on */ | ||
220 | |||
221 | /* FUNCTION ************************************************************************************************************ | ||
222 | * | ||
223 | * Function Name : BOARD_InitDEBUG_UARTPins | ||
224 | * Description : Configures pin routing and optionally pin electrical features. | ||
225 | * | ||
226 | * END ****************************************************************************************************************/ | ||
227 | void BOARD_InitDEBUG_UARTPins(void) | ||
228 | { | ||
229 | } | ||
230 | |||
231 | /* clang-format off */ | ||
232 | /* | ||
233 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
234 | BOARD_InitACCELPins: | ||
235 | - options: {coreID: core0, enableClock: 'true'} | ||
236 | - pin_list: | ||
237 | - {pin_num: '47', peripheral: I2C0, signal: SCL, pin_signal: PTA3/KBI0_P3/UART0_TX/I2C0_SCL} | ||
238 | - {pin_num: '48', peripheral: I2C0, signal: SDA, pin_signal: PTA2/KBI0_P2/UART0_RX/I2C0_SDA} | ||
239 | - {pin_num: '44', peripheral: GPIOA, signal: 'GPIO, 28', pin_signal: PTD4/KBI1_P4} | ||
240 | - {pin_num: '45', peripheral: GPIOA, signal: 'GPIO, 27', pin_signal: PTD3/KBI1_P3/SPI1_PCS0} | ||
241 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
242 | */ | ||
243 | /* clang-format on */ | ||
244 | |||
245 | /* FUNCTION ************************************************************************************************************ | ||
246 | * | ||
247 | * Function Name : BOARD_InitACCELPins | ||
248 | * Description : Configures pin routing and optionally pin electrical features. | ||
249 | * | ||
250 | * END ****************************************************************************************************************/ | ||
251 | void BOARD_InitACCELPins(void) | ||
252 | { | ||
253 | /* pin 47,48 is configured as I2C0_SCL, I2C0_SDA */ | ||
254 | PORT_SetPinSelect(kPORT_I2C0, kPORT_I2C0_SCLPTA3_SDAPTA2); | ||
255 | } | ||
256 | |||
257 | /* clang-format off */ | ||
258 | /* | ||
259 | * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* | ||
260 | BOARD_InitOSCPins: | ||
261 | - options: {coreID: core0, enableClock: 'true'} | ||
262 | - pin_list: | ||
263 | - {pin_num: '11', peripheral: OSC, signal: EXTAL, pin_signal: PTB7/I2C0_SCL/EXTAL} | ||
264 | - {pin_num: '12', peripheral: OSC, signal: XTAL, pin_signal: PTB6/I2C0_SDA/XTAL} | ||
265 | * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** | ||
266 | */ | ||
267 | /* clang-format on */ | ||
268 | |||
269 | /* FUNCTION ************************************************************************************************************ | ||
270 | * | ||
271 | * Function Name : BOARD_InitOSCPins | ||
272 | * Description : Configures pin routing and optionally pin electrical features. | ||
273 | * | ||
274 | * END ****************************************************************************************************************/ | ||
275 | void BOARD_InitOSCPins(void) | ||
276 | { | ||
277 | } | ||
278 | /*********************************************************************************************************************** | ||
279 | * EOF | ||
280 | **********************************************************************************************************************/ | ||