155 lines
6.2 KiB
C
155 lines
6.2 KiB
C
/***********************************************************************************************************************
|
|
* 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 v15.0
|
|
processor: MCXA153
|
|
package_id: MCXA153VLH
|
|
mcu_data: ksdk2_0
|
|
processor_version: 15.0.0
|
|
pin_labels:
|
|
- {pin_num: '38', pin_signal: P3_12/LPUART2_RTS_B/CT1_MAT2/PWM0_X0, label: LED_R, identifier: LED_R}
|
|
* 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_InitLEDPins();
|
|
BOARD_InitDbgUARTPins();
|
|
}
|
|
|
|
/* clang-format off */
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
BOARD_InitPins:
|
|
- options: {callFromInitBoot: 'true', coreID: cm33_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_InitLEDPins:
|
|
- options: {callFromInitBoot: 'true', coreID: cm33_core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '38', peripheral: GPIO3, signal: 'GPIO, 12', pin_signal: P3_12/LPUART2_RTS_B/CT1_MAT2/PWM0_X0, direction: OUTPUT, gpio_init_state: 'true'}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
/* clang-format on */
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : BOARD_InitLEDPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void BOARD_InitLEDPins(void)
|
|
{
|
|
/* Write to GPIO3: Peripheral clock is enabled */
|
|
CLOCK_EnableClock(kCLOCK_GateGPIO3);
|
|
/* Write to PORT3: Peripheral clock is enabled */
|
|
CLOCK_EnableClock(kCLOCK_GatePORT3);
|
|
/* GPIO3 peripheral is released from reset */
|
|
RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn);
|
|
/* PORT3 peripheral is released from reset */
|
|
RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn);
|
|
|
|
gpio_pin_config_t LED_R_config = {
|
|
.pinDirection = kGPIO_DigitalOutput,
|
|
.outputLogic = 1U
|
|
};
|
|
/* Initialize GPIO functionality on pin PIO3_12 (pin 38) */
|
|
GPIO_PinInit(BOARD_INITLEDPINS_LED_R_GPIO, BOARD_INITLEDPINS_LED_R_PIN, &LED_R_config);
|
|
|
|
/* PORT3_12 (pin 38) is configured as P3_12 */
|
|
PORT_SetPinMux(BOARD_INITLEDPINS_LED_R_PORT, BOARD_INITLEDPINS_LED_R_PIN, kPORT_MuxAlt0);
|
|
|
|
PORT3->PCR[12] = ((PORT3->PCR[12] &
|
|
/* Mask bits to zero which are setting */
|
|
(~(PORT_PCR_IBE_MASK)))
|
|
|
|
/* Input Buffer Enable: Enables. */
|
|
| PORT_PCR_IBE(PCR_IBE_ibe1));
|
|
}
|
|
|
|
/* clang-format off */
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
BOARD_InitDbgUARTPins:
|
|
- options: {callFromInitBoot: 'true', coreID: cm33_core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '51', peripheral: LPUART0, signal: RX, pin_signal: P0_2/TDO/SWO/LPUART0_RXD/LPSPI0_SCK/CT0_MAT0/UTICK_CAP0/I3C0_PUR}
|
|
- {pin_num: '52', peripheral: LPUART0, signal: TX, pin_signal: P0_3/TDI/LPUART0_TXD/LPSPI0_SDO/CT0_MAT1/UTICK_CAP1/CMP0_OUT/CMP1_IN1}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
/* clang-format on */
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : BOARD_InitDbgUARTPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void BOARD_InitDbgUARTPins(void)
|
|
{
|
|
/* Write to PORT0: Peripheral clock is enabled */
|
|
CLOCK_EnableClock(kCLOCK_GatePORT0);
|
|
/* LPUART0 peripheral is released from reset */
|
|
RESET_ReleasePeripheralReset(kLPUART0_RST_SHIFT_RSTn);
|
|
/* PORT0 peripheral is released from reset */
|
|
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
|
|
|
|
/* PORT0_2 (pin 51) is configured as LPUART0_RXD */
|
|
PORT_SetPinMux(PORT0, 2U, kPORT_MuxAlt2);
|
|
|
|
PORT0->PCR[2] = ((PORT0->PCR[2] &
|
|
/* Mask bits to zero which are setting */
|
|
(~(PORT_PCR_IBE_MASK)))
|
|
|
|
/* Input Buffer Enable: Enables. */
|
|
| PORT_PCR_IBE(PCR_IBE_ibe1));
|
|
|
|
/* PORT0_3 (pin 52) is configured as LPUART0_TXD */
|
|
PORT_SetPinMux(PORT0, 3U, kPORT_MuxAlt2);
|
|
|
|
PORT0->PCR[3] = ((PORT0->PCR[3] &
|
|
/* Mask bits to zero which are setting */
|
|
(~(PORT_PCR_IBE_MASK)))
|
|
|
|
/* Input Buffer Enable: Enables. */
|
|
| PORT_PCR_IBE(PCR_IBE_ibe1));
|
|
}
|
|
/***********************************************************************************************************************
|
|
* EOF
|
|
**********************************************************************************************************************/
|