fsl_uart rs485 support?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fsl_uart rs485 support?

902 Views
billnd
Contributor IV

After close to a day of struggling, I've finally managed to bully the fsl_uart driver to work with my RS485 direction control line. I've used the following...

 

UART_Type * base = g_uartBase[ FSL_UARTCOM3 ];
UART_HAL_SetTransmitterRtsCmd( base, true );
UART_HAL_SetTransmitterRtsPolarityMode( base, true );

 

to force the K10 hardware to use the RTS line as RS485 direction control. This is standard practice as far as I can tell, and just replicates IO_SERIAL_HW_485_FLOW_CONTROL in the old MQX drivers.

 

Couple of questions...

 

1. Does the fsl_uart driver not support this concept in any way?

2. Assuming the answer to 1 is no, then is this the most elegant way of achieving the end goal with KSDK? I'm a noob to KSDK, having been using raw MQX/drivers up to now. It seems like an incredibly clunky way to do things.

 

Cheers in advance,

NDBill

Labels (1)
0 Kudos
1 Reply

362 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello billnd,

Regarding your questions:

1) Unfortunately the KSDK UART driver does not support flow control feature. You are right in referencing to the MQX code, this is just as suggested by colleague Radek in this discussion: example code for RTS/CTS flow control (FRDMK64F120)

2) Your approach seems correct. When any particular feature or use case is not supported, or if you want to customize the driver then you can use the HAL layer to have things working. Just rebuild the library if you make changes to any of its source files.

Regards!

Jorge Gonzalez

0 Kudos