Receive byte from UART

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

[WICED-SDK-2.2.1]

Hi,

I try to communicate 943362WCD4 with other devices through UART.

Ive seen uart.c application  wiced_uart_receive_bytes(...) function is used for receiving data via UART. Its used in a while loop. Does WICED have a structure that generates interrupt if data received by UART ?

Or should I use wiced_uart_receive_bytes(...) as a thread in a while loop ? If you have another suggestion, please inform me.

Best Regards,

Erol

0 Likes
3 Replies
Anonymous
Not applicable
Please look at the Apps/snip/uart application.

This provides an example of how to interface with the UART
0 Likes
Anonymous
Not applicable
I had investigated uart app before i opened this thread. It seems OK, I can use the same structure for UART communication. But we are trying to integrate BCM943362 to our devices and our devices already have a communication structure. In this structure interrupt makes our process easier.

All my concern is that if there is a structure generates interrupt according to received data via UART.

Thanks for support.
0 Likes
Anonymous
Not applicable
wiced_uart_receive_bytes() does not poll. if you set up the UART using ring buffer just like how its done in snip/uart.c, the API waits on a semaphore until the specified number of bytes have been received; otherwise, a timeout occurs. The DMA is responsible for pushing/ pulling data in/out of the UART registers.

If you dont want your main application thread to block on wiced_uart_receive_bytes(), you can create a daemon with small stack size to wait on wiced_uart_receive_bytes(). Once the specified number of bytes have been received, you can notify your application thread using a semaphore or a queue message.
0 Likes