LPUART (UART0) Rx and Tx polarity select with MKL16Z, KDS and PE

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPUART (UART0) Rx and Tx polarity select with MKL16Z, KDS and PE

1,443 次查看
waldes
Contributor I

Hi,

 

I use MCU MKL16Z64 with KDS IDE, KSDK drivers and PE for peripheral setup. I have a problem with a polarity select for LPUART (UART0). This feature is supported by the peripheral and also the Kinetis SDK API Reference Manual. pdf contains the HAL function LPUART_HAL_SetTxRxInversionCmd, which is intended for this purpose I think. The problem is that this function is missing in the HAL files. Do you know where is the problem or how can I solve it?

 

Thank you, Lukas.

标签 (1)
0 项奖励
回复
2 回复数

1,134 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Lukas Valda:

Can you clarify what version of KSDK you have and also the SDK API manual version?

I searched in KSDV v1.2 and indeed the HAL APIs for the TX/RX inversion bits are not present, but the APIs are not mentioned in the manual either. I am not sure if these APIs were removed or omitted by mistake, but I will ask the KSDK developers.

In the meantime if you need that functionality you can implement the APIs and rebuild the KSDK platform library. The code below should work for KSDK v1.2:

static inline void UART_HAL_SetTxInversionCmd(UART_Type * base, bool enable)

{

    UART_BWR_C3_TXINV(base, enable);

}

static inline void UART_HAL_SetRxInversionCmd(UART_Type * base, bool enable)

{

    UART_BWR_S2_RXINV(base, enable);

}


Regards!,
Jorge Gonzalez

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,134 次查看
waldes
Contributor I

Hello Jorge Gonzalez,

I have compared what has been changed between v 1.0 and 2.0 in Kinetis SDK API Reference Manuals. I have used this function with v1.0, but not with v1.1. Now I have got a problem and I never would  have supposed that this function will be missing in newer version. I am interested if it is just a mistake or an intention.

Thank you for your APIs code. I have solved it in a similar way.

Best regards, Lukas.

0 项奖励
回复