X
RSS YouTube LinkedIn Twitter Facebook

Search




Post new topic Reply to topic   [ 2 posts ] 
Author Message
113
PostPosted: Mon May 28, 2012 2:00 am 
User avatar
Member++
Joined: Wed Dec 28, 2011 4:15 pm
Posts: 29
I've looked around a little in xmos uart modules and I couldn't find an equivalent to Arduino's Serial.available() function. Does someone know an equivalent function?


Top
Offline Profile View all posts by this user  
 
1325
PostPosted: Mon May 28, 2012 6:29 am 
User avatar
Respected Member
Joined: Tue May 18, 2010 12:25 am
Posts: 377
When you use the UART component, you have to pass a reference to a state variable:

Code:
uart_rx_client_state rxState;


This gives you how many bytes has been received:

Code:
rxState.received_bytes


However, i don't believe that this resets to zero after you read the bytes from the buffer.

I just briefly looked into the code, but you may also want to look in the source files (especially uart_rx_impl) about how the struct buffer_state is used.


Top
Offline Profile View all posts by this user  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic   [ 2 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest



Search for:
Jump to: