Cypress FX2LP, AN6077 manual AUTOOUT=1, WORDWIDE=0, AUTOIN=1, ZEROLENIN=1, WORDWIDE=0

Page 19

AN6077

EP2FIFOCFG = 0x10;

//

AUTOOUT=1, WORDWIDE=0

SYNCDELAY;

 

 

EP6FIFOCFG = 0x0C;

//

AUTOIN=1, ZEROLENIN=1, WORDWIDE=0

SYNCDELAY;

 

 

}

void TD_Poll( void )

{// Called repeatedly while the device is idle

//nothing to do;slave fifo's are in AUTO mode

}

BOOL TD_Suspend( void )

{// Called before the device goes into suspend mode return( TRUE );

}

BOOL TD_Resume( void )

{ // Called after the device resumes return( TRUE );

}

//-----------------------------------------------------------------------------

//Device Request hooks

//The following hooks are called by the end point 0 device request parser.

//-----------------------------------------------------------------------------

BOOL DR_GetDescriptor( void )

{

return( TRUE );

}

BOOL DR_SetConfiguration( void )

{// Called when a Set Configuration command is received if( EZUSB_HIGHSPEED( ) )

{// FX2LP in high speed mode EP6AUTOINLENH = 0x02;

SYNCDELAY;

// set core AUTO commit len = 512 bytes

SYNCDELAY; EP6AUTOINLENL = 0x00;

SYNCDELAY;

}

else

{ // FX2LP in full speed mode EP6AUTOINLENH = 0x00;

SYNCDELAY;

// set core AUTO commit len = 64 bytes

SYNCDELAY; EP6AUTOINLENL = 0x40;

SYNCDELAY;

}

 

 

Configuration = SETUPDAT[ 2 ];

 

return( TRUE );

// Handled by user code

 

}

 

 

BOOL DR_GetConfiguration( void )

 

{ // Called when a Get Configuration command is received

 

February 19, 2008

Document No. 001-15342 Rev. **

19

Image 19
Contents Introduction Application Note AbstractSlave Fifo Pin Descriptions Gpif Master Pin DescriptionsCreating Gpif Waveforms Fifowr Firmware Architecture Firmware Programming MasterPsuedocode for Master Psuedocode for Master OUTExpanded Master OUT Code Expanded Master in Code Syncdelay Gpiftrig = Gpiftrigwr GPIFEP2Gpiftrig = Gpiftrigrd GPIFEP6 SyncdelayFirmware for the Slave SummaryCode Listing for Master Side EP4 and EP8 are not used in this implementation Gpiftrig Trigger Fifo write transactions, using SFR Syncdelay Gpiftrig = Gpiftrigrd GPIFEP6 Setupdat Ezusbirqclear = TrueUsbirq Clear Ures IRQ + Feedback Code Listing for the Slave Side AUTOOUT=0, WORDWIDE=0 Syncdelay AUTOIN=1, ZEROLENIN=1, WORDWIDE=0 AUTOOUT=1, WORDWIDE=0EP0BCH EP0BCL Clear Ures IRQ + Feedback + Feedback