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

VxWorks

开发平台:

C/C++

  1. /* usbTcdLib.h - TCD functional API */
  2. /* Copyright 2000 Wind River Systems, Inc. */
  3. /*
  4. Modification history
  5. --------------------
  6. 01a,09aug99,rcb  First.
  7. */
  8. /*
  9. DESCRIPTION
  10. This file defines a functional interface to the TCD.
  11. */
  12. #ifndef __INCusbTcdLibh
  13. #define __INCusbTcdLibh
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* includes */
  18. #include "drv/usb/target/usbTcd.h"
  19. /* defines */
  20. /* typedefs */
  21. /*
  22.  * TCD_NEXUS
  23.  *
  24.  * TCD_NEXUS contains the entry point and TCD_CLIENT_HANDLE needed by a
  25.  * TCD caller to invoke a TCD.
  26.  */
  27. typedef struct tcd_nexus
  28.     {
  29.     USB_TCD_EXEC_FUNC tcdExecFunc;  /* TCD primary entry point */
  30.     TCD_HANDLE handle;     /* client's handle with TCD */
  31.     } TCD_NEXUS, *pTCD_NEXUS;
  32. /* functions */
  33. STATUS usbTcdAttach
  34.     (
  35.     USB_TCD_EXEC_FUNC tcdExecFunc,  /* TCD's primary entry point */
  36.     pVOID tcdParam,     /* TCD-specific param */
  37.     pTCD_NEXUS pNexus,     /* nexus will be initialized on return */
  38.     USB_TCD_MNGMT_CALLBACK mngmtCallback, /* caller's management callback */
  39.     pVOID mngmtCallbackParam,     /* caller-defined mngmt callback param */
  40.     pUINT16 pSpeed,     /* bfr to receive target's speed */
  41.     pUINT16 pNumEndpoints,     /* bfr to receive nbr of endpoints */
  42.     pUSB_TARG_ENDPOINT_INFO *ppEndpoints /* bfr to receive ptr to endpt tbl */
  43.     );
  44. STATUS usbTcdDetach
  45.     (
  46.     pTCD_NEXUS pNexus     /* client's nexus */
  47.     );
  48. STATUS usbTcdEnable
  49.     (
  50.     pTCD_NEXUS pNexus     /* client's nexus */
  51.     );
  52. STATUS usbTcdDisable
  53.     (
  54.     pTCD_NEXUS pNexus     /* client's nexus */
  55.     );
  56. STATUS usbTcdAddressSet
  57.     (
  58.     pTCD_NEXUS pNexus,     /* client's nexus */
  59.     UINT16 deviceAddress     /* new address for target */
  60.     );
  61. STATUS usbTcdSignalResume
  62.     (
  63.     pTCD_NEXUS pNexus     /* client's nexus */
  64.     );
  65. STATUS usbTcdEndpointAssign
  66.     (
  67.     pTCD_NEXUS pNexus,     /* client's nexus */
  68.     UINT16 endpointId,     /* TCD-assigned endpoint ID */
  69.     UINT16 endpointNum,      /* endpoint number to be assigned */
  70.     UINT16 configuration,     /* configuration associated with endpoint */
  71.     UINT16 interface,     /* interface associated with endpoint */
  72.     UINT16 transferType,     /* transfer type for endpoint */
  73.     UINT16 direction     /* direction for endpoint */
  74.     );
  75. STATUS usbTcdEndpointRelease
  76.     (
  77.     pTCD_NEXUS pNexus,     /* client's nexus */
  78.     UINT16 endpointId     /* endpointId to release */
  79.     );
  80. STATUS usbTcdEndpointStateSet
  81.     (
  82.     pTCD_NEXUS pNexus,     /* client's nexus */
  83.     UINT16 endpointId,     /* endpointId */
  84.     UINT16 state     /* TCD_ENDPOINT_STALL/UNSTALL */
  85.     );
  86. STATUS usbTcdCurrentFrameGet
  87.     (
  88.     pTCD_NEXUS pNexus,     /* client's nexus */
  89.     pUINT16 pFrameNo     /* current frame number */
  90.     );
  91. STATUS usbTcdErpSubmit
  92.     (
  93.     pTCD_NEXUS pNexus,     /* client's nexus */
  94.     pUSB_ERP pErp     /* ERP to be executed */
  95.     );
  96. STATUS usbTcdErpCancel
  97.     (
  98.     pTCD_NEXUS pNexus,     /* client's nexus */
  99.     pUSB_ERP pErp     /* ERP to be canceled */
  100.     );
  101. #ifdef __cplusplus
  102. }
  103. #endif
  104. #endif /* __INCusbTcdLibh */
  105. /* End of file. */