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

VxWorks

开发平台:

C/C++

  1. /* wdbVisionDrvIF.h - Interface definitions/declations for vision DRIVER */
  2. /* Copyright 1986-2002 Wind River Systems Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01c,01dec01,g_h  Cleaning for T2.2
  7. 01b,05may01,g_h  rename to wdbVisionDrvIF.h
  8. 01a,09apr01,rnr  written.
  9. */
  10. #ifndef __INCwdbVisionDrvIFh
  11. #define __INCwdbVisionDrvIFh
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /* defines */
  16. #define VDR_SUCCESS                    0 /* Indicates success of requested operation   */
  17. #define VDR_FAILURE                    1 /* Indicates failure of requested operation   */
  18.                                          /*                                            */
  19. #define VDR_WRITE_COMPLETE             0 /* Previously requested WRITE is     done     */
  20. #define VDR_WRITE_PENDING              1 /* Previously requested WRITE is not done     */
  21.                                          /*                                            */
  22. #define VDR_DATA_FOUND                 0 /* Data is     pending on the receive channel */
  23. #define VDR_DATA_NONE                  1 /* Data is NOT pending on the receive channel */
  24. /* typedefs */
  25. typedef unsigned char                  VDR_UCHAR; /* Host independent unsigned 1-byte unit */
  26. typedef unsigned long                  VDR_ULONG; /* Host independent unsigned 4-byte unit */
  27. typedef void *                         VDR_PDATA; /* Host independent void     4-byte unit */
  28. #if defined(__STDC__)
  29. /* Open/Close prototypes */
  30.  
  31. typedef VDR_ULONG (*VDR_OPEN_PTR)      (VDR_PDATA priv);
  32. typedef VDR_ULONG (*VDR_CLOSE_PTR)     (VDR_PDATA priv);
  33. /* Read/Write prototypes */
  34. typedef VDR_ULONG (*VDR_READ_STATUS_PTR)  (VDR_PDATA priv, VDR_ULONG * status);
  35. typedef VDR_ULONG (*VDR_WRITE_STATUS_PTR) (VDR_PDATA priv, VDR_ULONG * status);
  36. /* ReadStatus/WriteStatus prototypes */
  37. typedef VDR_ULONG (*VDR_READ_PTR)      (VDR_PDATA priv,    VDR_UCHAR * pData, 
  38.                                         VDR_ULONG maxSize, VDR_ULONG * rcvBytes);
  39. typedef VDR_ULONG (*VDR_WRITE_PTR)     (VDR_PDATA priv, VDR_UCHAR * pData, VDR_ULONG size);
  40. #else   /* __STDC__ */
  41. /* Open/Close prototypes */
  42.  
  43. typedef VDR_ULONG (*VDR_OPEN_PTR)();
  44. typedef VDR_ULONG (*VDR_CLOSE_PTR)();
  45. /* Read/Write prototypes */
  46. typedef VDR_ULONG (*VDR_READ_STATUS_PTR )();
  47. typedef VDR_ULONG (*VDR_WRITE_STATUS_PTR)();
  48. /* ReadStatus/WriteStatus prototypes */
  49. typedef VDR_ULONG  (*VDR_READ_PTR)();
  50. typedef VDR_ULONG  (*VDR_WRITE_PTR)();
  51. #endif  /* __STDC__ */
  52. /*
  53.  *   This data structure represent the interface exchange between
  54.  *   the High-Level Vision driver ( wdbVisioDrv ) and the Low-Level I/O
  55.  *   subsystem driver.  vDriver code will make  an initialization
  56.  *   call into the Low-Level code.  The Low-Level code will setup
  57.  *   the  function pointer fields with  the addresses of routines 
  58.  *   that perform  that particular operation.  Also the Low-Level
  59.  *   I/O will fill in the PrivateData field with a value which is
  60.  *   of meaining to the Low-Level driver. This data will be given
  61.  *   back to the Low-Level driver on every request.
  62.  */
  63. typedef struct vDriverInterface
  64.     {
  65.     VDR_OPEN_PTR         openFunc;        /* Addr of OPEN             routine */
  66.     VDR_CLOSE_PTR        closeFunc;       /* Addr of CLOSE            routine */
  67.     VDR_READ_PTR         readFunc;        /* Addr of the READ         routine */
  68.     VDR_WRITE_PTR        writeFunc;       /* Addr of the WRITE        routine */
  69.     VDR_READ_STATUS_PTR  readStatusFunc;  /* Addr of the READ STATUS  routine */
  70.     VDR_WRITE_STATUS_PTR writeStatusFunc; /* Addr of the WRITE STATUS routine */
  71.     VDR_PDATA            privateData;     /* Private data space               */
  72.     } V_DRIVER_INTERFACE;
  73. /* function prototypes */
  74. /* Prototype for the Initialization call */
  75. #if defined(__STDC__)
  76. typedef VDR_ULONG (*VDR_INIT_PTR) (V_DRIVER_INTERFACE * interfaceData);
  77. #else   /* __STDC__ */
  78. typedef VDR_ULONG (*VDR_INIT_PTR)();
  79. #endif  /* __STDC__ */
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif /* __INCwdbVisionDrvIFh */