
Chapter 10. General Programmable Interface (GPIF) Page 10-37
Figure 10-18. Initialization Code for Single-Read Transactions
void TD_Init( void )
{
BYTE xdata periph_status;
… … … … …
GpifInit(); // Configures GPIF from GPIFTool generated waveform data
// TODO: configure other endpoints, etc. here
// TODO: arm OUT buffer(s) here
// setup INT4 as internal source for GPIF interrupts
// using INT4CLR (SFR), automatically enabled
//INTSETUP |= 0x03; //Enable INT4 Autovectoring
//SYNCDELAY;
//GPIFIE = 0x03; // Enable GPIFDONE and GPIFWF interrupt(s)
//SYNCDELAY;
//EIE |= 0x04; // Enable INT4 ISR, EIE.2(EIEX4)=1
// TODO: configure GPIF interrupt(s) to meet your needs here
… … … … …
// get status of peripheral function
Peripheral_SetAddress( PERIPHCS );
Peripheral_SingleByteRead( &periph_status );
if( periph_status == AOKAY )
{ // set it and forget it
Peripheral_SetAddress( BURSTMODE );
}
else
{
Peripheral_SetAddress( TRISTATE );
Housekeeping( );
EZUSB_Discon( TRUE ); // Disconnect from the bus
for( EVER )
{ // do not xfr peripheral data
;
}
}
}
Comentarios a estos manuales