Cypress Semiconductor FX2LP Informations techniques Page 221

  • 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 220
Chapter 10. General Programmable Interface (GPIF) Page 10-31
{
static BYTE g_data = 0x00;
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 Done bit
{
;
}
// using register(s) in XDATA space, dummy read
g_data = XGPIFSGLDATLX; // trigger GPIF
// ...single byte read transaction
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 Done bit
{
;
}
// using register(s) in XDATA space,
*gdata = XGPIFSGLDATLNOX; // ...GPIF reads byte from PERIPHERAL
}
// read single word from PERIPHERAL, using GPIF
void Peripheral_SingleWordRead( WORD xdata *gdata )
{
BYTE g_data = 0x00;
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 Done bit
{
;
}
// using register(s) in XDATA space, dummy read
g_data = XGPIFSGLDATLX; // trigger GPIF
// ...single word read transaction
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 Done bit
{
;
}
// using register(s) in XDATA space, GPIF reads word from PERIPHERAL
*gdata = ( ( WORD )XGPIFSGLDATH << 8 ) | ( WORD )XGPIFSGLDATLNOX;
}
#define GPIFTRIGWR 0
#define GPIFTRIGRD 4
#define GPIF_EP2 0
#define GPIF_EP4 1
#define GPIF_EP6 2
#define GPIF_EP8 3
// write byte(s)/word(s) to PERIPHERAL, using GPIF and EPxFIFO
// if EPx WORDWIDE=0 then write byte(s)
// if EPx WORDWIDE=1 then write word(s)
void Peripheral_FIFOWrite( BYTE FIFO_EpNum )
{
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 Done bit
{
Vue de la page 220
1 2 ... 216 217 218 219 220 221 222 223 224 225 226 ... 459 460

Commentaires sur ces manuels

Pas de commentaire