Questions and discussions about the software that runs on the TD RF module itself.
Archie
 
Posts: 23
Joined: Sun Feb 28, 2016 8:29 am

change rate uart

by Archie Thu Jun 15, 2017 6:01 pm

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?
dandavid3000
 
Posts: 22
Joined: Fri Oct 28, 2016 12:30 pm

Re: change rate uart

by dandavid3000 Fri Jun 16, 2017 8:51 am

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.
Return to Firmware

Who is online

Users browsing this forum: No registered users and 2 guests