Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > CyAPI.lib XferData Interrupt

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



CyAPI.lib XferData Interrupt
Moderator:
RSKV

Post Reply
Follow this topic



CyAPI.lib XferData Interrupt

MC_OpDefense posted on 22 Feb 2012 4:56 PM PST
Member
4 Forum Posts

I have gotten the CyAPI.lib interface working for data transfers in both directions. Right now, it seems that the only way to know if data has been received from the USB peripheral is to poll the IN endpoint using XferData and then check the return value. I would like to have an interrupt or windows message to let me know when data has arrived so that the code doesn't waste time polling. Is there a way to do this?




Re: CyAPI.lib XferData Interrupt

Gayathri posted on 22 Feb 2012 09:17 PM PST
Cypress Employee
428 Forum Posts

 Hi,

 

There is no way the device can intimate the host when the data is ready. Since the USB protocol is host controlled, it is the host that has to request for data. If there is data in the buffer, device will respond by sending the data and Xferdata will return TRUE, else FALSE. So, polling is the only way out. This is so in USB2.0.

This polling feature has been improved upon in USB 3.0. In USB 3.0 device can send Asynchronous notifications to the device, instead of host polling.

 

Regards,

Gayathri



Re: CyAPI.lib XferData Interrupt

AlJumper posted on 15 Mar 2012 07:17 AM PST

1 Forum Post

Is it possible to solve this problem using INTERRUPT endpoint? Is this case the host controller in PC iself will poll the endopint without loading of user app. Does anybody have the experience of doing so? Does CYPRESS provode an example code (like BUKLOOP example) for demonstration of interrupt transfer functionality and configuring FX2, user application and CyApi to use windows messages for notification of data availiability?



Re: CyAPI.lib XferData Interrupt

Gayathri posted on 17 Mar 2012 11:58 AM PST
Cypress Employee
428 Forum Posts

 Hi,

 

Even for INTERRUPT endpoints, the application will have to poll for the data from INTERRUPT IN endpoint, if you are using some vendor ecific spdevice bound to CyUSB.sys. But if the device is something like a mouse/keyboard that is bound to the Windows HID driver, then the polling will be taken care of by that. But in the other case, the application itself has to keep calling the XferData for reading the data in fixed intervals.

 

Regards,

Gayathri



Re: CyAPI.lib XferData Interrupt

aasi posted on 17 Mar 2012 09:56 PM PST
Cypress Employee
1090 Forum Posts

Hi,

Though USB protocol defines the polling interval for interrupt endpoint the host won't poll unless it has buffer to store the received data i.e. the application or driver has to setup the buffer and then send reqeust to interrupt endpoint.

For class specific devices like HID devices the host has a native driver and knows what to do with the data so it polls by default and processes the data. In custom class devices we define how the data is being used and what it is needed so host won't poll by default. So you either have to queue up requests in the application or move the  polling to the driver by writing a custom driver if you want the polling at regular intervals.

Regards,

Anand






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20