Cypress Semiconductor CY7C1399B Bedienungsanleitung Seite 14

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 16
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 13
AN57322
November 4, 2009 Document No. 001-57322 Rev. ** 14
GPIFADRH = SETUPDAT[3];
// set GPIFADR[8:0] to address passed down
in wValue
GPIFADRL = SETUPDAT[2];
len = ( (SETUPDAT[5] << 8) +
SETUPDAT[4] ); // get transfer length from
wIndex field
while (len)
// while the transfer length is non-zero,
{
if( GPIFTRIG & 0x80 )
// if GPIF interface IDLE
{
if( !( EP68FIFOFLGS &
0x01 ) ) // if EP6 FIFO is not
full
{
if(enum_high_speed)
// if the FX2 enumerated at high-speed
{
if ( len >
0x0200 ) // if the transfer length
is greater than 512 bytes,
{
GPIFTCB1 = 0x02; // set GPIF transaction
count to 512, since
//
GPIFADR can only access 512
SYNCDELAY; // locations at a time
GPIFTCB0
= 0x00;
SYNCDELAY;
Tcount =
0x0200;
}
else
{
GPIFTCB1 = MSB(len);
SYNCDELAY;
GPIFTCB0
= LSB(len);
SYNCDELAY;
Tcount =
len;
}
}
else
// if the FX2 enumerated at full-speed
{
if ( len > 0x0040 )
// if the transfer length is greater than
64 bytes,
{
GPIFTCB1 = 0x00; // set GPIF
transaction count to 64
SYNCDELAY;
GPIFTCB0
= 0x40;
SYNCDELAY;
Tcount =
0x0040;
}
else
{
GPIFTCB1 = MSB(len);
SYNCDELAY;
GPIFTCB0
= LSB(len);
SYNCDELAY;
Tcount =
len;
}
}
GPIFTRIG = GPIFTRIGRD |
GPIF_EP6; // launch GPIF FIFO READ
Transaction to EP6IN
SYNCDELAY;
while( !( GPIFTRIG &
0x80 ) ) // poll GPIFTRIG.7 GPIF Done bit
{
;
}
SYNCDELAY;
xFIFOBC_IN = ( ( EP6FIFOBCH
<< 8 ) + EP6FIFOBCL ); // get EP6FIFOBCH/L
value
if( ( xFIFOBC_IN > 0) && (
xFIFOBC_IN < 0x0200 ) ) // if pkt is short,
{
INPKTEND = 0x06;
// force a commit to the host
}
len = len - Tcount;
// decrement transfer length by Tcount
if(!(len % 0x0200))
// if the transfer length is not a modulus
of 512, no need to
{
// reset GPIFADR[8:0] to access next bank
of 512 bytes,
GPIFADRH = 0x00;
// handles full-speed case and high-speed
case
GPIFADRL = 0x00;
// reset GPIFADR[8:0] to access the next
bank at offset 0
[+] Feedback
Seitenansicht 13
1 2 ... 9 10 11 12 13 14 15 16

Kommentare zu diesen Handbüchern

Keine Kommentare