User guide
78 CY3687 MoBL-USB FX2LP18 Development Kit User Guide, Doc. # 001-68582 Rev. *B
MoBL-USB Development Kit Firmware Examples
SYNCDELAY; //
EP2BCL = 0x80;
}
Endpoint EP6 is armed again with incremental pattern of data starting with 0x2.
// if EP6 IN is available, re-arm it
If(!(EP2468STAT & bmEP6FULL))
{
SYNCDELAY;
EP6BCH = 0x02;
SYNCDELAY;
EP6BCL = 0x00;
}
The contents received EP4 OUT endpoint are copied to a temporary buffer myBuffer[] and re-armed
again.
// if there is new data in EP4FIFOBUF, then copy it to a temporary buffer
if(!(EP2468STAT & bmEP4EMPTY))
{
APTR1H = MSB( &EP4FIFOBUF );
APTR1L = LSB( &EP4FIFOBUF );
AUTOPTRH2 = MSB( &myBuffer );
AUTOPTRL2 = LSB( &myBuffer );
myBufferCount = (EP4BCH << 8) + EP4BCL;
for( i = 0x0000; i < myBufferCount; i++ )
{
EXTAUTODAT2 = EXTAUTODAT1;
}
SYNCDELAY; //
EP4BCL = 0x80; // re(arm) EP4OUT
}
If the EP8 Bulk IN endpoint is empty then the contents of temporary buffer are transferred to a AUTO
pointer and finally copied to EP8 IN buffer as shown below.
// if there is room in EP8IN, then copy the contents of the temporary buf-
fer to it
if(!(EP2468STAT & bmEP8FULL) && myBufferCount)
{
APTR1H = MSB( &myBuffer );
APTR1L = LSB( &myBuffer );
AUTOPTRH2 = MSB( &EP8FIFOBUF );
AUTOPTRL2 = LSB( &EP8FIFOBUF );
for( i = 0x0000; i < myBufferCount; i++ )
{
// setup to transfer EP4OUT buffer to EP8IN buffer using AUTO-
POINTER(s) in SFR space
EXTAUTODAT2 = EXTAUTODAT1;
}