Page 1 of 1

change rate uart

Posted: Thu Jun 15, 2017 6:01 pm
by Archie
Hello,
I have multiplexed the serial link on 2 components that have different rate. My 2 tests programs work very well.

But, on the other hand, I can not reset the serial link with a different rate in the same program.

What is the procedure for doing this?

Re: change rate uart

Posted: Fri Jun 16, 2017 8:51 am
by dandavid3000
Archie wrote:Hello,
I have multiplexed the serial link on 2 components that have different rate. My 2 tests programs work very well.

But, on the other hand, I can not reset the serial link with a different rate in the same program.

What is the procedure for doing this?


Hi,

You can configure the braud rate like this

Code: Select all
TD_UART_Options_t options = {LEUART_DEVICE, LEUART_LOCATION, 9600, 8, 'N',
                  1, false};

TD_UART_Open(&options, TD_STREAM_RDWR);



If you don't use the braudrate 9600, you can close it create another one and open it.
or you can use this function

Code: Select all
void TD_UART_SetBaudrate(TD_STREAM_t *stream,uint32_t baudrate);


PS: You can find this piece of code in some TD examples.