/* * Copyright 2018 NXP. * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /*********************************************************************************************************************** * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file * will be overwritten if the respective MCUXpresso Config Tools is used to update this file. **********************************************************************************************************************/ /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* !!GlobalInfo product: Pins v4.1 processor: MKE04Z8xxx4 package_id: MKE04Z8VFK4 mcu_data: ksdk2_0 processor_version: 4.0.0 board: FRDM-KE04Z pin_labels: - {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} - {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} - {pin_num: '2', pin_signal: PTC4/KBI1_P0/FTM2_CH2/PWT_IN0, label: 'J1[8]/D4[4]/PTC4_GREEN', identifier: LED_GREEN} - {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} - {pin_num: '1', pin_signal: PTC5/KBI1_P1/FTM2_CH3/BUSOUT, label: 'J1[12]/D4[1]/PTC5_RED', identifier: LED_RED} - {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'} - {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'} - {pin_num: '12', pin_signal: PTC0/KBI1_P2/FTM2_CH0/ADC0_SE8, label: 'J2[4]/PTC0_ACCEL_INT1', identifier: ACCEL_INT1} - {pin_num: '7', pin_signal: PTB5/KBI1_P7/FTM2_CH5/SPI0_PCS0/ACMP1_OUT, label: 'J2[6]/PTB5_TSI', identifier: PTB5_TSI} - {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} - {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} - {pin_num: '5', pin_signal: PTB7/I2C0_SCL/EXTAL, label: 'J1[9]/PTB7_GPIO/EXTAL', identifier: EXTAL} - {pin_num: '6', pin_signal: PTB6/I2C0_SDA/XTAL, label: 'J1[15]/PTB6_LED3/XTAL', identifier: XTAL} - {pin_num: '21', pin_signal: PTA1/KBI0_P1/FTM0_CH1/ACMP0_IN1/ADC0_SE1, label: 'J2[15]/PTA1_ACMP0_IN1/PTA1_IRRX'} - {pin_num: '11', pin_signal: PTC1/KBI1_P3/FTM2_CH1/ADC0_SE9, label: 'J2[3]/PTC1_TSI/PTC1_PWM1', identifier: PTC1_TSI} - {pin_num: '4', pin_signal: VSS/VSSA/VREFL, label: GND} - {pin_num: '3', pin_signal: VDD/VDDA/VREFH, label: 'J2[16]/P3V3_KE04Z'} - {pin_num: '10', pin_signal: PTC2/KBI1_P4/FTM2_CH2/ADC0_SE10, label: 'J3[4]/PTC2_A1_ANB1'} - {pin_num: '9', pin_signal: PTC3/KBI1_P5/FTM2_CH3/ADC0_SE11, label: 'J3[2]/PTC3_A0_ANB2'} - {pin_num: '17', pin_signal: PTA7/FTM2_FLT2/SPI0_MOSI/ACMP1_IN1/ADC0_SE3, label: 'J3[10]/PTA7_A4'} - {pin_num: '18', pin_signal: PTA6/FTM2_FLT1/SPI0_SCK/ACMP1_IN0/ADC0_SE2, label: 'J3[8]/PTA6_A3'} - {pin_num: '23', pin_signal: PTA5/IRQ/TCLK1/RESET_b, label: 'J4[6]/J7[10]/RST_TGTMCU/SW1'} - {pin_num: '24', pin_signal: PTA4/ACMP0_OUT/SWD_DIO, label: 'J7[2]/SWD_DIO_TGTMCU'} - {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'} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ #include "fsl_common.h" #include "fsl_port.h" #include "fsl_gpio.h" #include "pin_mux.h" /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitBootPins * Description : Calls initialization functions. * * END ****************************************************************************************************************/ void BOARD_InitBootPins(void) { BOARD_InitPins(); BOARD_InitDEBUG_UARTPins(); } /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* BOARD_InitPins: - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'} - pin_list: [] * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitPins * Description : Configures pin routing and optionally pin electrical features. * * END ****************************************************************************************************************/ void BOARD_InitPins(void) { } /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* BOARD_InitLEDsPins: - options: {coreID: core0, enableClock: 'true'} - pin_list: - {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'} - {pin_num: '2', peripheral: GPIOA, signal: 'GPIO, 20', pin_signal: PTC4/KBI1_P0/FTM2_CH2/PWT_IN0, direction: OUTPUT, gpio_init_state: 'true'} - {pin_num: '1', peripheral: GPIOA, signal: 'GPIO, 21', pin_signal: PTC5/KBI1_P1/FTM2_CH3/BUSOUT, direction: OUTPUT, gpio_init_state: 'true'} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitLEDsPins * Description : Configures pin routing and optionally pin electrical features. * * END ****************************************************************************************************************/ void BOARD_InitLEDsPins(void) { gpio_pin_config_t LED_BLUE_config = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 1U }; /* Initialize GPIO functionality on pin PTA11 (pin 13) */ GPIO_PinInit(BOARD_INITLEDSPINS_LED_BLUE_GPIO_PORT, BOARD_INITLEDSPINS_LED_BLUE_PIN, &LED_BLUE_config); gpio_pin_config_t LED_GREEN_config = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 1U }; /* Initialize GPIO functionality on pin PTA20 (pin 2) */ GPIO_PinInit(BOARD_INITLEDSPINS_LED_GREEN_GPIO_PORT, BOARD_INITLEDSPINS_LED_GREEN_PIN, &LED_GREEN_config); gpio_pin_config_t LED_RED_config = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 1U }; /* Initialize GPIO functionality on pin PTA21 (pin 1) */ GPIO_PinInit(BOARD_INITLEDSPINS_LED_RED_GPIO_PORT, BOARD_INITLEDSPINS_LED_RED_PIN, &LED_RED_config); } /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* BOARD_InitTOUCHPins: - options: {coreID: core0, enableClock: 'true'} - pin_list: - {pin_num: '7', peripheral: GPIOA, signal: 'GPIO, 13', pin_signal: PTB5/KBI1_P7/FTM2_CH5/SPI0_PCS0/ACMP1_OUT} - {pin_num: '11', peripheral: GPIOA, signal: 'GPIO, 17', pin_signal: PTC1/KBI1_P3/FTM2_CH1/ADC0_SE9} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitTOUCHPins * Description : Configures pin routing and optionally pin electrical features. * * END ****************************************************************************************************************/ void BOARD_InitTOUCHPins(void) { } /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* BOARD_InitDEBUG_UARTPins: - options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'} - pin_list: - {pin_num: '16', peripheral: UART0, signal: RX, pin_signal: PTB0/KBI0_P4/UART0_RX/SPI0_PCS0/PWT_IN1/ADC0_SE4} - {pin_num: '15', peripheral: UART0, signal: TX, pin_signal: PTB1/KBI0_P5/UART0_TX/SPI0_MISO/TCLK2/ADC0_SE5} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitDEBUG_UARTPins * Description : Configures pin routing and optionally pin electrical features. * * END ****************************************************************************************************************/ void BOARD_InitDEBUG_UARTPins(void) { /* pin 16,15 is configured as UART0_RX, UART0_TX */ PORT_SetPinSelect(kPORT_UART0, kPORT_UART0_RXPTB0_TXPTB1); } /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* BOARD_InitACCELPins: - options: {coreID: core0, enableClock: 'true'} - pin_list: - {pin_num: '19', peripheral: I2C0, signal: SCL, pin_signal: PTA3/KBI0_P3/UART0_TX/I2C0_SCL} - {pin_num: '20', peripheral: I2C0, signal: SDA, pin_signal: PTA2/KBI0_P2/UART0_RX/I2C0_SDA} - {pin_num: '12', peripheral: GPIOA, signal: 'GPIO, 16', pin_signal: PTC0/KBI1_P2/FTM2_CH0/ADC0_SE8} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitACCELPins * Description : Configures pin routing and optionally pin electrical features. * * END ****************************************************************************************************************/ void BOARD_InitACCELPins(void) { /* pin 20,19 is configured as I2C0_SDA, I2C0_SCL */ PORT_SetPinSelect(kPORT_I2C0, kPORT_I2C0_SCLPTA3_SDAPTA2); } /* clang-format off */ /* * TEXT BELOW IS USED AS SETTING FOR TOOLS ************************************* BOARD_InitOSCPins: - options: {coreID: core0, enableClock: 'true'} - pin_list: - {pin_num: '5', peripheral: OSC, signal: EXTAL, pin_signal: PTB7/I2C0_SCL/EXTAL} - {pin_num: '6', peripheral: OSC, signal: XTAL, pin_signal: PTB6/I2C0_SDA/XTAL} * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS *********** */ /* clang-format on */ /* FUNCTION ************************************************************************************************************ * * Function Name : BOARD_InitOSCPins * Description : Configures pin routing and optionally pin electrical features. * * END ****************************************************************************************************************/ void BOARD_InitOSCPins(void) { } /*********************************************************************************************************************** * EOF **********************************************************************************************************************/