Hi,
The CTRL register of the MCXA UART contains the TXINV (28) bit which control the polarity of the UART.
However, the config tools doesn't expose this functionnality and the "LPUART_Init" function automatically unset this bit. The only solution found was to disable the RX and TX output (after the "LPUART_Init") to set the TXINV.
LPUART1_PERIPHERAL->CTRL &= ~LPUART_CTRL_TE_MASK;
LPUART1_PERIPHERAL->CTRL &= ~LPUART_CTRL_RE_MASK;
LPUART1_PERIPHERAL->CTRL |= LPUART_CTRL_TXINV_MASK;
LPUART1_PERIPHERAL->CTRL |= LPUART_CTRL_TE_MASK;
LPUART1_PERIPHERAL->CTRL |= LPUART_CTRL_RE_MASK;
This solution cause unnecessary rising edge on the UART lines.
Writing a custom UART init function is overkill and error prone.
The question is :
Is there any other "proper" way to invert the UART polarity and are the config tools scheduled to support this functionnality.
Sincerely,
Solved! Go to Solution.
Hi @rj_engineer
I'm sorry for replying to you late.
LPUART_CTRL_TXINV(1); // Enable Transmit Data Inversion
Please contact me if still have any question.
BR
Alice
Hi @rj_engineer
I'm sorry for replying to you late.
LPUART_CTRL_TXINV(1); // Enable Transmit Data Inversion
Please contact me if still have any question.
BR
Alice