Cypress Semiconductor FX2LP Technické informace Strana 230

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 460
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 229
EZ-USB FX2 Technical Reference Manual
Page 10-40 EZ-USB FX2 Technical Reference Manual v2.1
ter to start a Single-Write transaction.
In 8-bit mode, simply write the data to the XGPIFSGLDATLX register to start a Single-Write
transaction.
3. Wait for the GPIF to indicate that the transaction is complete. When the transaction is com-
plete, the DONE bit (GPIFIDLECS.7 or GPIFTRIG.7) will be set to 1. If enabled, a GPIFDONE
interrupt will also be generated.
The following C program fragments (Figures 10-22 and 10-23) illustrate how to perform a Sin-
gle-Write transaction in 8-bit mode (WORDWIDE=0):
Figure 10-22. Single-Write Transaction Functions
#define PERIPHCS 0x00AB
#define P_HSMODE 0x01
// prototypes
void GpifInit( void );
// Set Address GPIFADR[8:0] to PERIPHERAL
void Peripheral_SetAddress( WORD gaddr )
{
GPIFADRH = gaddr >> 8;
SYNCDELAY;
GPIFADRL = ( BYTE )gaddr; // setup GPIF address
}
// write single byte to PERIPHERAL, using GPIF
void Peripheral_SingleByteWrite( BYTE gdata )
{
while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 Done bit
{
;
}
XGPIFSGLDATLX = gdata; // trigger GPIF single byte write transaction
}
Zobrazit stránku 229
1 2 ... 225 226 227 228 229 230 231 232 233 234 235 ... 459 460

Komentáře k této Příručce

Žádné komentáře