EasyManua.ls Logo

Cypress CY3684 - Page 84

Cypress CY3684
117 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
84 EZ-USB Development Kit User Guide, Doc. # 001-66390 Rev. *D
EZ-USB Development Kit Firmware Examples
SYNCDELAY; //
EP2BCL = 0x80;
}
Endpoint EP6 is re-armed with an 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 from the EP4 OUT endpoint are copied to a temporary buffer, myBuffer[], and
re-armed.
// 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 an
AUTO pointer and finally copied to the EP8 IN buffer as shown in the following code.
// 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;
}

Table of Contents

Related product manuals