Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > determining buffer level of IN endpoint

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



determining buffer level of IN endpoint
Moderator:
RSKV

Post Reply
Follow this topic



determining buffer level of IN endpoint

dsula posted on 22 Jul 2010 1:53 PM PST
Member
8 Forum Posts

Hi,

Is it possible to find out how many bytes are available for pick-up from an IN endpoint using XferData() ?

Thank you




Re: determining buffer level of IN endpoint

dsula posted on 23 Jul 2010 06:01 AM PST
Member
8 Forum Posts

I would like to add that I have a device which is sending an unknown amount of data to the host. The device is also using PKTEND (in SlaveFIFO mode) to send partial packets. It might also send partial packets intermixed with full packets.

How can the host determine how much data needs to be read from the endpoint?

 



Re: determining buffer level of IN endpoint

dsula posted on 23 Jul 2010 07:10 AM PST
Member
8 Forum Posts

 The more I think about it the less I understand how USB and CyUSB.NET works. (I'm brand new to USB, so please go easy).

I'm trying to have a device use BULK transfer to the PC. I imagine this is what's happening:

1. The device sends full or partial packets across the USB to the PC

2. On the PC side some FIFO buffer (call it PCbuf) gets slowly filled with the data.

3. XferData() is used to grab the data from PCbuf and transfer it to the application.

Is that what's happening? If so I have a question. How big is this PC side buffer PCbuf? And how does one know if it overflows? And how does the USB device know it can't send more data because the PCbuf is full?

Or do I have that all wrong? Is there in fact no PC side buffer at all. And whenever I execute XferData() a USB request is direclty dispatched to the device asking for a specific amount of data? That would actually make more sense I guess, because it would explain why there is no function to tell me how much data is availabe for pick-up. Because the PC simply doesn't know.

So the other question then becomes. Is it possible to tell XferData() to just give me all the data available in the buffer without any timout. Something like this:

XferLen = 512;

bResult = inEndpoint.XferData(ref inData, ref xferLen);


But I don't want to wait for timeout, just give me what you got available, but give it to me now.

Thank you for any helpful insight.
 

 

 

 



Re: determining buffer level of IN endpoint

dsula posted on 30 Jul 2010 10:23 AM PST
Member
8 Forum Posts

Bumping the thread.

Anybody?

Is there some architectural documentation of the CyUSB drivers available? What do I have to read to actually understand how to use this driver efficiently?

 



Re: determining buffer level of IN endpoint

dsula posted on 03 Sep 2010 04:59 PM PST
Member
8 Forum Posts

bump






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: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20