Cypress Semiconductor SL811HS Manual do Utilizador Página 31

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 43
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 30
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: 31
// Generate SOF, setup 48Mhz, suspend disable // Generate SOF, setup 48Mhz, suspend disable
SL11Write(CtrlReg, 0x01); SL11Write(CtrlReg, 0x01);
... ...
4.1.16 Specific Command Transfer
This subroutine is similar to the DeviceIoControl in the Window Driver Model. See the USB
specification v1.1, chapter 9 for more details.
Program Sample 15: Vendor Command
The VendorCmd () setup specific request parameters to the USB devices.
Program Sample 16: Vendor Command
////----------------------------------------------------------------------------------------------------------------------------------------
// Control endpoint// Control endpoint
// return:// return:
// // --1 on failure, 0 on success > 0 if remainder1 on failure, 0 on success > 0 if remainder
////------------------------------------------------------------------------------------------------------------------------------------------
int VendorCmd(BYTE bReq, BYTE bCmd, WORD wValue, WORD wIndex,int VendorCmd(BYTE bReq, BYTE bCmd, WORD wValue, WORD wIndex,
WORD wLen,BYTE* pData) WORD wLen,BYTE* pData)
{ {
SetupPKG setup; SetupPKG setup;
setup.bmRequest = bReq; setup.bmRequest = bReq;
setup.bRequest = bCmd; setup.bRequest = bCmd;
setup.wValue = wValue; setup.wValue = wValue;
setup.wIndex setup.wIndex = wIndex; = wIndex;
setup.wLength = wLen; setup.wLength = wLen;
return ep0Xfer(uDev.wEPxCRC[0], uDev.wPayLoad[0], &setup, pData); return ep0Xfer(uDev.wEPxCRC[0], uDev.wPayLoad[0], &setup, pData);
}}
4.1.17 USB Transfer (Bulk/ISO/Control/Interrupt)
The following subroutines simulate the Micro USBD stack function on the top level.
Program Sample 17: USB Control Transfer
////------------------------------------------------------------------------------------------------------------------------------------------
// ep0Xfer// ep0Xfer
// Dev contains the CRC of EP | Address// Dev contains the CRC of EP | Address
// Return:// Return:
// // -- Fail Fail --11
// // -- Sucess Sucess 0 0
// // -- non non--zero remainder (0 < wLen < setupzero remainder (0 < wLen < setup-->wLength)>wLength)
// //
////------------------------------------------------------------------------------------------------------------------------------------------
int ep0Xfer(WORD Dev, WORD payload, PSetupPKG setup, BYTE *pData)int ep0Xfer(WORD Dev, WORD payload, PSetupPKG setup, BYTE *pData)
{{
BYTE pid=PID_IN; BYTE pid=PID_IN;
WORD wLen = setup WORD wLen = setup-->>wLength;wLength;
Vista de página 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 42 43

Comentários a estes Manuais

Sem comentários