Cypress Semiconductor FX2LP Informações Técnicas Página 185

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 460
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 184
Chapter 9. Slave FIFOs Page 9-29
Figure 9-40. TD_Poll Example: Sourcing an IN Packet
TD_Poll():
… … … … …
if( source_pkt_event )
{ // 100-msec background timer fired
if( holdoff_master( ) )
{ // signaled “busy” to master successful
while( !( EP68FIFOFLGS & 0x20 ) )
{ // EP8EF=0, when buffer not empty
; // wait ‘til host takes entire FIFO data
}
FIFORESET = 0x80; // initiate the “source packet” sequence
SYNCDELAY;
FIFORESET = 0x06;
SYNCDELAY;
FIFORESET = 0x00;
EP8FIFOBUF[ 0 ] = 0x02; // <STX>, packet start of text msg
EP8FIFOBUF[ 1 ] = 0x06; // <ACK>
EP8FIFOBUF[ 2 ] = 0x07; // <HEARTBEAT>
EP8FIFOBUF[ 3 ] = 0x03; // <ETX>, packet end of text msg
SYNCDELAY;
EP8BCH = 0x00;
SYNCDELAY;
EP8BCL = 0x04; // pass newly-sourced buffer on to host
}
else
{
history_record( EP8, BAD_MASTER );
}
}
… … … … …
Vista de página 184
1 2 ... 180 181 182 183 184 185 186 187 188 189 190 ... 459 460

Comentários a estes Manuais

Sem comentários