Hello,
I'm Trying to use LPUART to receive information from other device so I tried to use the LPUART interrupt example but i do not receive anything and I also tried to receive the data via LPUART 3.
Can Anyone told me if that example needs other thing to make tha example work with the LPUART3 pins.
已解决! 转到解答。
The LPUART instance is 1 and UART pin is GPIO_AD_B0_12/13 in SDK example.
Which board and UART pin are you using?
If you want to switch to other LPUART instance, you just need to modify below code in example
// in lpuart_interrupt.c
#define DEMO_LPUART LPUART1
#define DEMO_LPUART_CLK_FREQ BOARD_DebugConsoleSrcFreq()
#define DEMO_LPUART_IRQn LPUART1_IRQn
#define DEMO_LPUART_IRQHandler LPUART1_IRQHandler
// in pin_mux.c
void BOARD_InitPins(void) {
CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_12_LPUART1_TXD, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_13_LPUART1_RXD, 0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_12_LPUART1_TXD, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_13_LPUART1_RXD, 0x10B0U);
}
The LPUART instance is 1 and UART pin is GPIO_AD_B0_12/13 in SDK example.
Which board and UART pin are you using?
If you want to switch to other LPUART instance, you just need to modify below code in example
// in lpuart_interrupt.c
#define DEMO_LPUART LPUART1
#define DEMO_LPUART_CLK_FREQ BOARD_DebugConsoleSrcFreq()
#define DEMO_LPUART_IRQn LPUART1_IRQn
#define DEMO_LPUART_IRQHandler LPUART1_IRQHandler
// in pin_mux.c
void BOARD_InitPins(void) {
CLOCK_EnableClock(kCLOCK_Iomuxc);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_12_LPUART1_TXD, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_13_LPUART1_RXD, 0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_12_LPUART1_TXD, 0x10B0U);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_13_LPUART1_RXD, 0x10B0U);
}