home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 September / CHIP_CD_1997_09_PL.iso / software / testsoft / labwind / demo.6 / main / include / vxiint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-02  |  5.9 KB  |  153 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*             National Instruments NI-VXI Software Interface             */
  4. /*                   (C) 1996,  National Instruments                      */
  5. /*                                                                        */
  6. /*                VXI Interrupt and Signal Include File                   */
  7. /*                                                                        */
  8. /**************************************************************************/
  9. /*                       DO NOT MODIFY THIS FILE                          */
  10. /**************************************************************************/
  11. /* The following file contains all of the necessary typedef information
  12.  * for use of the National Instruments NI-VXI Software Interface
  13.  * functions.
  14.  */
  15.  
  16. #if !defined(vxiint_h)
  17. #define vxiint_h
  18.  
  19. /*****************************************************************************
  20.  *   The following are parameter values and useful defines for VXI interrupt
  21.  * and VXI signal functions.
  22.  */
  23.  
  24. /* "mask" for Message-Based device in RouteSignal, SignalDeq, and
  25.  * WaitForSignal functions (other bits are reserved)
  26.  */
  27.  
  28. /* Event Signals */
  29. #define UDE_SIGNAL               (1U<<14)
  30. #define VRE_SIGNAL               (1U<<13)
  31. #define SME_SIGNAL               (1U<<12)
  32. #define URC_SIGNAL               (1U<<11) /* MUST ALWAYS ROUTE TO HANDLER */
  33. #define REQF_SIGNAL              (1U<<10)
  34. #define REQT_SIGNAL              (1U<<9)
  35. #define NCG_SIGNAL               (1U<<8)
  36.  
  37. /* Response signals */
  38. #define NOT_USED                 (1U<<7)
  39. #define B14_SIGNAL               (1U<<6)
  40. #define DOR_SIGNAL               (1U<<5)
  41. #define DIR_SIGNAL               (1U<<4)
  42. #define ERR_SIGNAL               (1U<<3)
  43. #define RR_SIGNAL                (1U<<2)
  44. #define WR_SIGNAL                (1U<<1)
  45. #define FHS_SIGNAL               (1U<<0)
  46.  
  47. /* define's for use in Signal interrupt handler to case signal values */
  48.  
  49. /* bit 15=0 signifies a Response signal */
  50. #define Response_B14             (1U<<14)
  51. #define Response_DOR             (1U<<13)
  52. #define Response_DIR             (1U<<12)
  53. #define Response_ERR             (1U<<11)
  54. #define Response_RR              (1U<<10)
  55. #define Response_WR              (1U<<9)
  56. #define Response_FHS             (1U<<8)
  57.  
  58. /* bit 15=1 signifies an Event signal */
  59. #define SIG_REQT                 0xFD00
  60. #define SIG_REQF                 0xFC00
  61. #define SIG_UNSUP_CMD            0xEE00
  62. #define SIG_NO_CAUSE             0xFF00
  63. #define SIG_RES_EVENT            (1U<<14)       /* bit 14 = 1 */
  64. #define SIG_USER_EVENT           (1U<<14)       /* bit 14 = 0 */
  65.  
  66. #define SIG_UNREC_CMD            SIG_UNSUP_CMD  /* backwards compatability */
  67.  
  68. /*****************************************************************************
  69.  *   The following are return codes for all of the VXI interrupt and
  70.  * VXI signal functions.
  71.  */
  72.  
  73. /* General defines for all VXI interrupt and signal functions */
  74. #define INT_SRC_NOT_SUPPORTED    NO_HARDWARE_SUPPORT
  75. #define ENABLE_OK_QUEUE_FULL     ( 1)
  76. #define INVALID_LA               (-1)
  77. #define INVALID_LEVEL            (-3)
  78.  
  79. /* EnableSignalInt, DisableSignalInt */
  80. #define SIGINT_ENA_OK            NIVXI_OK       /* zero */
  81. #define SIGINT_DIS_OK            NIVXI_OK       /* zero */
  82. #define SIGINT_ENA_QUEUE_FULL    ENABLE_OK_QUEUE_FULL
  83.  
  84. /* GetSignalHandler LA parameter */
  85. #define SIGH_GET_UNKNOWN         -2             /* Get unknown LA handler */
  86.  
  87. /* GetSignalHandler "func" return codes */
  88. #define SIGH_GET_INVLA           0L
  89.  
  90. /* SetSignalHandler LA parameter */
  91. #define SIGH_SET_UNKNOWN         -2             /* Set unknown LA handler */
  92.  
  93. /* SetSignalHandler return codes */
  94. #define SIGH_SET_OK              NIVXI_OK
  95. #define SIGH_SET_INVLA           INVALID_LA
  96.  
  97. /* RouteSignal */
  98. #define ROUTES_OK                NIVXI_OK       /* zero */
  99. #define ROUTES_INVLA             INVALID_LA
  100.  
  101. /* SignalDeq, SignalEnq, SignalJam */
  102. #define SIGQ_OK                  NIVXI_OK       /* zero */
  103. #define SIGQ_EMPTY               (-1)
  104. #define SIGQ_FULL                (-1)
  105. #define SIGQ_NOMATCH             (-1)
  106.  
  107. /* WaitForSignal */
  108. #define WAITS_OK                 NIVXI_OK       /* zero */
  109. #define WAITS_INVLA              INVALID_LA
  110. #define WAITS_TIMEOUT            (-2)
  111.  
  112. /* AcknowledgeVXIint */
  113. #define ACKINT_OK                NIVXI_OK       /* zero */
  114. #define ACKINT_UNSUP             INT_SRC_NOT_SUPPORTED
  115. #define ACKINT_INVCONT           INVALID_CONTROLLER
  116. #define ACKINT_INVLEV            INVALID_LEVEL
  117. #define ACKINT_BERR              (-4)
  118.  
  119. /* AssertVXIint, DeAssertVXIint */
  120. #define VXIINT_OK                NIVXI_OK       /* zero */
  121. #define VXIINT_UNSUP             INT_SRC_NOT_SUPPORTED
  122. #define VXIINT_INVCONT           INVALID_CONTROLLER
  123. #define VXIINT_INVLEV            INVALID_LEVEL
  124. #define VXIINT_PENDING           (-5)
  125.  
  126. /* EnableVXIint, DisableVXIint, EnableVXItoSignalInt, DisableVXItoSignalInt */
  127. #define VXIINT_ENA_OK            NIVXI_OK       /* zero */
  128. #define VXIINT_ENA_UNSUP         INT_SRC_NOT_SUPPORTED
  129. #define VXIINT_ENA_INVCONT       INVALID_CONTROLLER
  130. #define VXIINT_DIS_OK            NIVXI_OK       /* zero */
  131. #define VXIINT_DIS_UNSUP         INT_SRC_NOT_SUPPORTED
  132. #define VXIINT_DIS_INVCONT       INVALID_CONTROLLER
  133. #define VXIINT_ENA_QUEUE_FULL    ENABLE_OK_QUEUE_FULL
  134.  
  135. /* GetVXIintHandler "func" return codes */
  136. #define VXIINT_GET_INVLEV        0L
  137.  
  138. /* SetVXIintHandler */
  139. #define VXIINT_SET_OK            NIVXI_OK       /* zero */
  140.  
  141. /* RouteVXIint */
  142. #define ROUTEI_OK                NIVXI_OK       /* zero */
  143. #define ROUTEI_UNSUP             INT_SRC_NOT_SUPPORTED
  144. #define ROUTEI_INVCONT           INVALID_CONTROLLER
  145.  
  146. /* VXIintAcknowledgeMode */
  147. #define ACKMODE_OK               NIVXI_OK      /* zero */
  148. #define ACKMODE_UNSUP            INT_SRC_NOT_SUPPORTED
  149. #define ACKMODE_INVCONT          INVALID_CONTROLLER
  150.  
  151. #endif
  152.  
  153.