usbLib.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usbLib.h - USB utility functions */
  2. /* Copyright 2000 Wind River Systems, Inc. */
  3. /*
  4. Modification history
  5. --------------------
  6. 01d,26jan00,rcb  Modify usbRecurringTime() to accept <bandwidth> instead
  7.  of <bytesPerFrame>.
  8.  Add usbDescrCopy32() and usbDescrStrCopy32().
  9. 01c,17jan99,rcb  Add usbConfigDescrGet() function.
  10. 01b,23nov99,rcb  Add usbRecurringTime() function.
  11. 01a,16jul99,rcb  First.
  12. */
  13. #ifndef __INCusbLibh
  14. #define __INCusbLibh
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /* includes */
  19. #include "usb/usb.h"
  20. #include "usb/usbHid.h"
  21. #include "usb/usbdLib.h"
  22. #include "usb/usbDescrCopyLib.h"
  23. /* function prototypes */
  24. UINT32 usbTransferTime
  25.     (
  26.     UINT16 transferType, /* transfer type */
  27.     UINT16 direction, /* transfer direction */
  28.     UINT16 speed, /* speed of pipe */
  29.     UINT32 bytes, /* number of bytes for packet to be calc'd */
  30.     UINT32 hostDelay, /* host controller delay per packet */
  31.     UINT32 hostHubLsSetup /* host controller time for low-speed setup */
  32.     );
  33. UINT32 usbRecurringTime
  34.     (
  35.     UINT16 transferType, /* transfer type */
  36.     UINT16 direction, /* transfer direction */
  37.     UINT16 speed, /* speed of pipe */
  38.     UINT16 packetSize, /* max packet size for endpoint */
  39.     UINT32 bandwidth, /* number of bytes to transfer per second */
  40.     UINT32 hostDelay, /* host controller delay per packet */
  41.     UINT32 hostHubLsSetup /* host controller time for low-speed setup */
  42.     );
  43. pVOID usbDescrParseSkip
  44.     (
  45.     pUINT8 *ppBfr, /* buffer to parse */
  46.     pUINT16 pBfrLen, /* length of buffer to parse */
  47.     UINT8 descriptorType /* type of descriptor being sought */
  48.     );
  49.     
  50. pVOID usbDescrParse
  51.     (
  52.     pUINT8 pBfr, /* buffer to parse */
  53.     UINT16 bfrLen, /* length of buffer to parse */
  54.     UINT8 descriptorType /* type of descriptor being sought */
  55.     );
  56. STATUS usbConfigCountGet
  57.     (
  58.     USBD_CLIENT_HANDLE usbdClientHandle,    /* caller's USBD client handle */
  59.     USBD_NODE_ID nodeId,     /* device node ID */
  60.     pUINT16 pNumConfig     /* bfr to receive nbr of config */
  61.     );
  62. STATUS usbConfigDescrGet
  63.     (
  64.     USBD_CLIENT_HANDLE usbdClientHandle,    /* caller's USBD client handle */
  65.     USBD_NODE_ID nodeId,     /* device node ID */
  66.     UINT16 cfgNo,     /* specifies configuration nbr */
  67.     pUINT16 pBfrLen,     /* receives length of buffer */
  68.     pUINT8 *ppBfr     /* receives pointer to buffer */
  69.     );
  70. STATUS usbHidReportSet
  71.     (
  72.     USBD_CLIENT_HANDLE usbdClientHandle,    /* caller's USBD client handle */
  73.     USBD_NODE_ID nodeId,     /* desired node */
  74.     UINT16 interface,     /* desired interface */
  75.     UINT16 reportType,     /* report type */
  76.     UINT16 reportId,     /* report Id */
  77.     pUINT8 reportBfr,     /* report value */
  78.     UINT16 reportLen     /* length of report */
  79.     );
  80. STATUS usbHidIdleSet
  81.     (
  82.     USBD_CLIENT_HANDLE usbdClientHandle,    /* caller's USBD client handle */
  83.     USBD_NODE_ID nodeId,     /* desired node */
  84.     UINT16 interface,     /* desired interface */
  85.     UINT16 reportId,     /* desired report */
  86.     UINT16 duration     /* idle duration */
  87.     );
  88. STATUS usbHidProtocolSet
  89.     (
  90.     USBD_CLIENT_HANDLE usbdClientHandle,    /* caller's USBD client handle */
  91.     USBD_NODE_ID nodeId,     /* desired node */
  92.     UINT16 interface,     /* desired interface */
  93.     UINT16 protocol     /* USB_HID_PROTOCOL_xxxx */
  94.     );
  95. #ifdef __cplusplus
  96. }
  97. #endif
  98. #endif /* __INCusbLibh */
  99. /* End of file. */