Cypress Semiconductor FX2LP Informations techniques Page 227

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 460
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 226
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
;
}
}
}
Vue de la page 226
1 2 ... 222 223 224 225 226 227 228 229 230 231 232 ... 459 460

Commentaires sur ces manuels

Pas de commentaire