Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > what am i do for read in slave fifo mode?

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



what am i do for read in slave fifo mode?
Moderator:
RSKV

Post Reply
Follow this topic



what am i do for read in slave fifo mode?

dv2 posted on 23 Dec 2012 7:44 AM PST
Top Contributor
113 Forum Posts

 hi 

if i use wordwide =1 in slavefifo mode,  what am i do for read in windwos application program?

i usually use like below  in wordwide=0,

if (USBDevice->BulkInEndPt)

USBDevice->BulkInEndPt->XferData(buf, length); 

buf have [512] array and length is 512.

 

but, if i use wordwide =1, what am i  setting value for buf array count and length value ? 

 

 




Re: what am i do for read in slave fifo mode?

akop posted on 23 Dec 2012 09:07 AM PST
Member
10 Forum Posts

 You must set the length in bytes.



Re: what am i do for read in slave fifo mode?

dv2 posted on 23 Dec 2012 08:31 PM PST
Top Contributor
113 Forum Posts

 What you mean bytes? 

Could you please let me know more detail?



Re: what am i do for read in slave fifo mode?

akop posted on 24 Dec 2012 11:30 PM PST
Member
10 Forum Posts

it looks like:

UCHAR buf[512];

 length = sizeof(buf); 

USBDevice->BulkInEndPt->XferData(buf, length);

 



Re: what am i do for read in slave fifo mode?

dv2 posted on 24 Dec 2012 12:01 AM PST
Top Contributor
113 Forum Posts

 You mean that i shoud use same value length and buf[]. Right?

Then if i use 16bitmode , how to out data from xferdata()?

If original data is 0x1618, buf arrary data have like this ? buf[0]=0x16 buf[1]=0x18?

Or buf[0]= 0x1618 ?



Re: what am i do for read in slave fifo mode?

akop posted on 24 Dec 2012 01:39 AM PST
Member
10 Forum Posts

 in my opinion the 16 mode is only important in the development of hardware and firmware (program inside chip). not important in the development of software.



Re: what am i do for read in slave fifo mode?

akop posted on 24 Dec 2012 01:43 AM PST
Member
10 Forum Posts

one more example:

union{

 UCHAR buf[512];

short int bufshort[256];
};

bufshort[0] = 0x1234;// you can write short int directly to buf

.....


length = sizeof(buf);

USBDevice->BulkInEndPt->XferData(buf, length);



Re: what am i do for read in slave fifo mode?

dv2 posted on 24 Dec 2012 02:01 AM PST
Top Contributor
113 Forum Posts

I'm not sure. 

Please let me know my question. 

Which one ? buf[0]= 0x1234  or buf[0]=0x12 and  buf[1]=0x34 ?

 



Re: what am i do for read in slave fifo mode?

dv2 posted on 24 Dec 2012 04:35 AM PST
Top Contributor
113 Forum Posts

 Oh i see thanks a lot






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