Cypress Semiconductor SL811HS Manual de usuario Pagina 36

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 43
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 35
Cypress Semiconductor Corporation
SL811HS and SL811HST: Application Notes
©2001 Cypress Semiconductor Corporation. All rights reserved. The information
and specifications contained in this document are subject to change without
notice.
Date: 07/26/01
Revision: 1.21
Page: 36
SL11Write(EP0Control,Cmd|0x20); // Enable ARM SL11Write(EP0Control,Cmd|0x20); // Enable ARM
} }
else else
SL11Write(EP0Control,Cmd SL11Write(EP0Control,Cmd); // Enable ARM ); // Enable ARM
#ifdef VER13#ifdef VER13
if (dbug && pid==PID_IN) // handle low speed via hub if (dbug && pid==PID_IN) // handle low speed via hub
SL11Write(EP1Control,1); SL11Write(EP1Control,1);
#endif#endif
} }
if (pid==PID_IN) if (pid==PID_IN)
{ {
SL11BufRead SL11BufRead((short)((D0&1)?data0+cOFFSET:data1+cOFFSET), buf, rLen);((short)((D0&1)?data0+cOFFSET:data1+cOFFSET), buf, rLen);
if (rem) // Short Packet detection if (rem) // Short Packet detection
{ {
//printf("Short packet detection %x //printf("Short packet detection %x\\n", rem);n", rem);
break;break;
} }
} }
if (len == 0) break; if (len == 0) break;
rLen = bLen; rLen = bLen;
buf += rLen; buf += rLen;
} }
if (result & 0x04) if (result & 0x04)
{ {
if (time_out > 100) if (time_out > 100)
{ {
printf("WARNNING: time printf("WARNNING: time--out, pid=%x, status %x len %xout, pid=%x, status %x len %x\\
n", pid, n", pid,
result, len); result, len);
break; break;
} }
// should be 100 time retry on time_out, check the babble detection // should be 100 time retry on time_out, check the babble detection
time_out++; time_out++;
} }
else else
time_out = 0; time_out = 0;
if (result if (result & 0x80) // STALL & 0x80) // STALL
{ {
printf("WARNNING: Stall is detected, status %x, len %x printf("WARNNING: Stall is detected, status %x, len %x\\n", result, len);n", result, len);
break; break;
} }
if (retry >= MAX_RETRY) break; if (retry >= MAX_RETRY) break;
} }
DToggle[ep] = Cmd & 0x40; DToggle[ep] = Cmd & 0x40;
if (result & 1) return len; if (result & 1) return len;
printf(" printf("Exit: PID=%x Result = %x len=%d, retry %dExit: PID=%x Result = %x len=%d, retry %d\\n",pid, result, len, retry); n",pid, result, len, retry);
return return --1;1;
}}
5.1. Control Transfer
The Control pipe includes the Token (SETUP, IN, OUT), Data (DATA0/DATA1), and
Handshake (ACK, NAK, STALL) phases. During the SETUP transaction, data is always sent to
the USB peripheral with a specific request. Following the SETUP transaction, the SL811HS
initiates one or more IN transactions, which prompts the target to return the requested data.
SL811HS completes the Control Transfer by using OUT transactions to request verification that
the device endpoint has successfully returned the contents of the descriptor. The Control Pipe
is used for USB device enumeration.
The USB defines the allowable maximum control data payload sizes for full-speed devices to
be 8, 16, 32 or 64 bytes. However, low speed devices are limited to an 8-byte maximum data
payload size.
Vista de pagina 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 42 43

Comentarios a estos manuales

Sin comentarios