Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bsp/nxp/mcx/mcxa/frdm-mcxa156/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ int main(void)
rt_kprintf("using gcc, version: %d.%d\n", __GNUC__, __GNUC_MINOR__);
#endif

rt_kprintf("MCXA156 HelloWorld\r\n");
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); /* Set GPIO as Output */

while (1)
{
rt_thread_mdelay(1000); /* Delay 1S */
rt_kprintf("MCXA156 HelloWorld\r\n");
rt_pin_write(LED_PIN, PIN_HIGH); /* Set GPIO output 1 */
rt_thread_mdelay(500); /* Delay 500mS */
rt_pin_write(LED_PIN, PIN_LOW); /* Set GPIO output 0 */
rt_thread_mdelay(500); /* Delay 500mS */
}
}

Expand Down
52 changes: 48 additions & 4 deletions bsp/nxp/mcx/mcxa/frdm-mcxa156/board/MCUX_Config/board/pin_mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,31 @@ void BOARD_InitBootPins(void)
* END ****************************************************************************************************************/
void BOARD_InitPins(void)
{
/* PORT0: Peripheral clock is enabled */
/* Enable all PORT clocks */
CLOCK_EnableClock(kCLOCK_GatePORT0);
/* LPUART0 peripheral is released from reset */
RESET_ReleasePeripheralReset(kLPUART0_RST_SHIFT_RSTn);
/* PORT0 peripheral is released from reset */
CLOCK_EnableClock(kCLOCK_GatePORT1);
CLOCK_EnableClock(kCLOCK_GatePORT2);
CLOCK_EnableClock(kCLOCK_GatePORT3);

/* Enable all GPIO clocks */
CLOCK_EnableClock(kCLOCK_GateGPIO0);
CLOCK_EnableClock(kCLOCK_GateGPIO1);
CLOCK_EnableClock(kCLOCK_GateGPIO2);
CLOCK_EnableClock(kCLOCK_GateGPIO3);

/* Release all PORT resets */
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
RESET_ReleasePeripheralReset(kPORT1_RST_SHIFT_RSTn);
RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn);
RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn);

RESET_ReleasePeripheralReset(kGPIO0_RST_SHIFT_RSTn);
RESET_ReleasePeripheralReset(kGPIO1_RST_SHIFT_RSTn);
RESET_ReleasePeripheralReset(kGPIO2_RST_SHIFT_RSTn);
RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn);

/* Release LPUART0 resets */
RESET_ReleasePeripheralReset(kLPUART0_RST_SHIFT_RSTn);

const port_pin_config_t port0_2_pin78_config = {/* Internal pull-up resistor is enabled */
kPORT_PullUp,
Expand Down Expand Up @@ -115,6 +134,31 @@ void BOARD_InitPins(void)
kPORT_UnlockRegister};
/* PORT0_3 (pin 79) is configured as LPUART0_TXD */
PORT_SetPinConfig(PORT0, 3U, &port0_3_pin79_config);

const port_pin_config_t port3_12_pin63_config = {/* Internal pull-up resistor is enabled */
kPORT_PullDisable,
/* Low internal pull resistor value is selected. */
kPORT_LowPullResistor,
/* Fast slew rate is configured */
kPORT_FastSlewRate,
/* Passive input filter is disabled */
kPORT_PassiveFilterDisable,
/* Open drain output is disabled */
kPORT_OpenDrainEnable,
/* Low drive strength is configured */
kPORT_LowDriveStrength,
/* Normal drive strength is configured */
kPORT_NormalDriveStrength,
/* Pin is configured as LPUART0_TXD */
kPORT_MuxAsGpio,
/* Digital input enabled */
kPORT_InputBufferEnable,
/* Digital input is not inverted */
kPORT_InputNormal,
/* Pin Control Register fields [15:0] are not locked */
kPORT_UnlockRegister};
/* PORT3_12 (pin 63) is configured as LED_RED */
PORT_SetPinConfig(PORT3, 12U, &port3_12_pin63_config);
}
/***********************************************************************************************************************
* EOF
Expand Down