- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How could we know if UART tx buffer is empty or not?
If wiced_hal_puart_write() is issued and soon baudrate is changed with wiced_hal_puart_configuration(), baudrate will be chaged in the middle of transmitting data.
Especially, we should consider baudrate change during UART flow control.
So we'd like to wait until all buffered data output to UART.
Regard,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
That's because baudrate configuration overrides data transfer because they are controlled by different units that cannot detect each other. You have to develop your mechanism to avoid this kind of confliction.
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It seems the APIs don't cover your needs exactly. But I suggest you may try the following function:
void wiced_hal_puart_synchronous_write ( UINT8 * buffer, UINT32 length)
It is a blocking function and it makes sure your data will go into FIFO before returning from it. So I think It can help you with what you need.
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your suggestion.
I tried wiced_hal_puart_synchronous_write().
But unfortunately I find that this function is not blocked.
If I change baudrate by using wiced_hal_puart_configuration() after issuing wiced_hal_puart_synchronous_write(), baudrate is changed during data transmitting.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
That's because baudrate configuration overrides data transfer because they are controlled by different units that cannot detect each other. You have to develop your mechanism to avoid this kind of confliction.
Best regards