UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
8,486 Views
Registered: ‎09-19-2014

xusbps transfers in polled mode (not interrupt-driven)

Reading the header documentation of xusbps.h for a Xilinx standalone software project on Zynq PS, it seems to suggest that reading incoming data from the USB port is mainly done by an asynchronously triggered interrupt.

https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/usbps/src/xusbps.h

 

Is there a way to use the xusbps driver in a polled style for reading? That style would suit my (and probably most) projects better than asynchronous reads. E.g.:

 

while (true)
{
  bool result = xusbps_is_data_readable(instance);
  if (result) xusbps_read_data(instance, buffer, size);
// do something }

Handling asynchronous reads requires extra layers of code to make it work nicely.

0 Kudos