what am i do for read in slave fifo mode?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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 ? 

0 Likes
8 Replies
Anonymous
Not applicable

 You must set the length in bytes.

0 Likes
Anonymous
Not applicable

 What you mean bytes? 

   

Could you please let me know more detail?

0 Likes
Anonymous
Not applicable

it looks like:

   

UCHAR buf[512];

   

 length = sizeof(buf); 

   

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

 

0 Likes
Anonymous
Not applicable

 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 ?

0 Likes
Anonymous
Not applicable

 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.

0 Likes
Anonymous
Not applicable

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);

0 Likes
Anonymous
Not applicable

I'm not sure. 

   

Please let me know my question. 

   

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

0 Likes
Anonymous
Not applicable

 Oh i see thanks a lot

0 Likes