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

VxWorks

开发平台:

C/C++

  1. /* usbMouseLib.h - USB mouse SIO driver definitions */
  2. /* Copyright 2000 Wind River Systems, Inc. */
  3. /*
  4. Modification history
  5. --------------------
  6. 01e,18sep01,wef  merge from wrs.tor2_0.usb1_1-f for veloce
  7. 01d,07may01,wef changed module number to be (module num << 8) | M_usbHostLib
  8. 01c,02may01,wef  changed module number to be M_<module> + M_usbHostLib
  9. 01b,05dec00,wef  moved Module number defs to vwModNum.h - add this
  10.                  to #includes
  11. 01a,07oct99,rcb  First.
  12. */
  13. #ifndef __INCusbMouseLibh
  14. #define __INCusbMouseLibh
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /* includes */
  19. #include "sioLib.h"
  20. #include "usb/usbPlatform.h"
  21. #include "usb/usbHid.h"
  22. #include "vwModNum.h"           /* USB Module Number Def's */
  23. /* defines */
  24. /* usbMouseLib error values */
  25. /* 
  26.  * USB errnos are defined as being part of the USB host Module, as are all
  27.  * vxWorks module numbers, but the USB Module number is further divided into 
  28.  * sub-modules.  Each sub-module has upto 255 values for its own error codes
  29.  */
  30.  
  31. #define USB_MOUSE_SUB_MODULE 8 
  32. #define M_usbMouseLib  ( (USB_MOUSE_SUB_MODULE << 8) | M_usbHostLib )
  33. #define usbMseErr(x) (M_usbMouseLib | (x))
  34. #define S_usbMouseLib_NOT_INITIALIZED usbMseErr (1)
  35. #define S_usbMouseLib_BAD_PARAM  usbMseErr (2)
  36. #define S_usbMouseLib_OUT_OF_MEMORY usbMseErr (3)
  37. #define S_usbMouseLib_OUT_OF_RESOURCES usbMseErr (4)
  38. #define S_usbMouseLib_GENERAL_FAULT usbMseErr (5)
  39. #define S_usbMouseLib_QUEUE_FULL usbMseErr (6)
  40. #define S_usbMouseLib_QUEUE_EMPTY usbMseErr (7)
  41. #define S_usbMouseLib_NOT_IMPLEMENTED usbMseErr (8)
  42. #define S_usbMouseLib_USBD_FAULT usbMseErr (9)
  43. #define S_usbMouseLib_NOT_REGISTERED usbMseErr (10)
  44. #define S_usbMouseLib_NOT_LOCKED usbMseErr (11)
  45. /* Additional callback types for "callbackInstall" function */
  46. #define SIO_CALLBACK_PUT_MOUSE_REPORT 128
  47. /* USB_MSE_xxxx define "attach codes" used by USB_MSE_ATTACH_CALLBACK. */
  48. #define USB_MSE_ATTACH 0     /* new mouse attached */
  49. #define USB_MSE_REMOVE 1     /* mouse has been removed */
  50.     /* SIO_CHAN no longer valid */
  51. /* typedefs */
  52. /* USB_MSE_ATTACH_CALLBACK defines a callback routine which will be
  53.  * invoked by usbMouseLib.c when the attachment or removal of a mouse
  54.  * is detected.  When the callback is invoked with an attach code of
  55.  * USB_MSE_ATTACH, the pSioChan points to a newly created SIO_CHAN.  When
  56.  * the attach code is USB_MSE_REMOVE, the pSioChan points to a pSioChan
  57.  * for a mouse which is no longer attached.
  58.  */
  59. typedef VOID (*USB_MSE_ATTACH_CALLBACK) 
  60.     (
  61.     pVOID arg,     /* caller-defined argument */
  62.     SIO_CHAN *pChan,     /* pointer to affected SIO_CHAN */
  63.     UINT16 attachCode     /* defined as USB_MSE_xxxx */
  64.     );
  65. /* function prototypes */
  66. STATUS usbMouseDevInit (void);
  67. STATUS usbMouseDevShutdown (void);
  68. STATUS usbMouseDynamicAttachRegister
  69.     (
  70.     USB_MSE_ATTACH_CALLBACK callback, /* new callback to be registered */
  71.     pVOID arg /* user-defined arg to callback */
  72.     );
  73. STATUS usbMouseDynamicAttachUnRegister
  74.     (
  75.     USB_MSE_ATTACH_CALLBACK callback, /* callback to be unregistered */
  76.     pVOID arg /* user-defined arg to callback */
  77.     );
  78. STATUS usbMouseSioChanLock
  79.     (
  80.     SIO_CHAN *pChan     /* SIO_CHAN to be marked as in use */
  81.     );
  82. STATUS usbMouseSioChanUnlock
  83.     (
  84.     SIO_CHAN *pChan     /* SIO_CHAN to be marked as unused */
  85.     );
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #endif /* __INCusbMouseLibh */
  90. /* End of file. */