Hi,
I've opened the uart_interrupt code in MCUXpresso and am interested in changing the code from using UART0 to usiung UART4 on MK64FN1M0VLL12.
I have modified the UART macros & port settings but am unsure what to do about the following macros:
- SIM_SOPT5_UART0TXSRC_MASK
- SIM_SOPT5_UART0TXSRC
- SOPT5_UART0TXSRC_UART_TX
in function BOARD_InitPins. What's their functiuonality exactly and how can I adjust it to apply to UART4 instead of UART0. My changed BOARD_InitPins() code looks like:
void BOARD_InitPins(void) {
CLOCK_EnableClock(kCLOCK_PortC); /* Port B Clock Gate Control: Clock enabled */
PORT_SetPinMux(PORTC, 14u, kPORT_MuxAlt3); /* PORTC14 (pin 86) is configured as UART4_RX */
PORT_SetPinMux(PORTC, 15u, kPORT_MuxAlt3); /* PORTC15 (pin 87) is configured as UART4_TX */
SIM->SOPT5 = ((SIM->SOPT5 &
(~(SIM_SOPT5_UART0TXSRC_MASK))) /* Mask bits to zero which are setting */
| SIM_SOPT5_UART0TXSRC(SOPT5_UART0TXSRC_UART_TX) /* UART 0 transmit data source select: UART0_TX pin */
);
}