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

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*             National Instruments NI-VXI Software Interface             */
  4. /*                   (C) 1996,  National Instruments                      */
  5. /*                                                                        */
  6. /*                        Trigger Include File                            */
  7. /*                                                                        */
  8. /**************************************************************************/
  9. /*                       DO NOT MODIFY THIS FILE                          */
  10. /**************************************************************************/
  11. /* The following file contains all the necessary trigger information
  12.  * for use of the National Instruments NI-VXI Software Interface functions.
  13.  */
  14.  
  15. #if !defined(trig_h)
  16. #define trig_h
  17.  
  18. /*****************************************************************************
  19.  *   The following are parameter values for the NI-VXI Trigger functions.
  20.  */
  21.  
  22. /* "line" parameter for all functions as applicable */
  23. #define TRIG_LINE_TTL_BASE         (0)
  24. #define TRIG_LINE_ECL_BASE         (8)
  25.  
  26. #define TRIG_LINE_STARX_BASE       (14)   /* currently unavailable */
  27. #define TRIG_LINE_STARY_BASE       (27)   /* currently unavailable */
  28.  
  29. #define TRIG_LINE_GPIO_BASE        (40)
  30. #define TRIG_LINE_GPIO(g)          (TRIG_LINE_GPIO_BASE+g)
  31. #define TRIG_LINE_FPIN             (40)
  32. #define TRIG_LINE_FPOUT            (41)
  33.  
  34. #define TRIG_LINE_TCNTR            (50)   /* TIC counter output    */
  35. #define TRIG_LINE_GCNTR            (51)   /* TIC finished output   */
  36. #define TRIG_LINE_TICK1            (60)   /* tick timer 1 output   */
  37. #define TRIG_LINE_TICK2            (61)   /* tick timer 2 output   */
  38. #define TRIG_LINE_CLK10            (70)   /* 10 MHz clock          */
  39. #define TRIG_LINE_EXTCLK           (71)   /* current EXTCLK in TIC */
  40.  
  41. /* "line" for CNTR and TICK for SetTrigHandler */
  42. #define TABLE_ENTRY_CNTR           (14)
  43. #define TABLE_ENTRY_TICK           (15)
  44.  
  45. /* "prot" in SrcTrig, EnableTrigSense */
  46. #define TRIG_PROT_ON               (0)
  47. #define TRIG_PROT_OFF              (1)
  48. #define TRIG_PROT_START            (2)
  49. #define TRIG_PROT_STOP             (3)
  50. #define TRIG_PROT_SYNC             (4)
  51. #define TRIG_PROT_SEMISYNC         (5)
  52. #define TRIG_PROT_ASYNC            (6)
  53. #define TRIG_PROT_SEMISYNC_ACK     (7)
  54. #define TRIG_PROT_ASYNC_ACK        (8)
  55. #define TRIG_PROT_ABORT_ACK        (0xFFFF)
  56.  
  57. /* additional "prot" in EnableTrigSense */
  58. #define TRIG_PROT_PSOVERRUN        (0x8000)
  59.  
  60. /* "srcTrig", "destTrig" in MapTrigToTrig and UnMapTrigToTrig */
  61. #define TRIG_MAP_TTLBASE           (0)
  62. #define TRIG_MAP_ECLBASE           (8)
  63. #define TRIG_MAP_STARXBASE         (14)
  64. #define TRIG_MAP_STARYBASE         (27)
  65. #define TRIG_MAP_EXTBASE           (40)
  66. #define TRIG_MAP_FPIN              (40)
  67. #define TRIG_MAP_FPOUT             (41)
  68.  
  69. /* "mode" in MapTrigToTrig */
  70. #define MAP_MODE_SYNC              (1U<<0)
  71. #define MAP_MODE_INVERT            (1U<<1)
  72. #define MAP_MODE_1CLK              (1U<<2)
  73. #define MAP_MODE_EXTCLK            (1U<<3)
  74.  
  75. /* "TrigType" definitions for TrigHandler, DefaultTrigHandler */
  76. #define TRIG_TYPE_SENSED           (1U<<0)
  77. #define TRIG_TYPE_ACK_RECV         (0)    /* opposite of SENSED: !(1U<<0) */
  78. #define TRIG_TYPE_ERROR            (1U<<15)
  79. #define TRIG_TYPE_ASSERT_OVERRUN   (TRIG_TYPE_ERROR | (1U<<2))
  80. #define TRIG_TYPE_UNASSERT_OVERRUN (TRIG_TYPE_ERROR | (1U<<3))
  81. #define TRIG_TYPE_PSTRECTH_OVERRUN (TRIG_TYPE_ERROR | (1U<<4))
  82.  
  83. /* "mode" in TrigAssertConfig (general: line = -1) */
  84. #define ASSERT_MODE_CLK10_FALLING   (1U<<0)
  85. #define ASSERT_MODE_CLK10_RISING    (0)
  86.  
  87. /* "mode" in TrigAssertConfig (specific line number) */
  88. #define ASSERT_MODE_CLK10_NOSYNC    (1U<<0)
  89. #define ASSERT_MODE_CLK10_SYNC      (0)
  90. #define ASSERT_MODE_EXTSSARM        (1U<<1)
  91.  
  92. /* "mode" in TrigExtConfig */
  93. #define EXT_MODE_NOFEEDBACK         (0)
  94. #define EXT_MODE_FEEDBACK           (1U<<0)
  95. #define EXT_MODE_TRISTATE           (0)
  96. #define EXT_MODE_ASSERT             (1U<<1)
  97. #define EXT_MODE_ASSERT_LOW         (1U<<2)
  98. #define EXT_MODE_ASSERT_HIGH        (0)
  99. #define EXT_MODE_INVERT_INP         (1U<<3)
  100.  
  101. /* "mode" in TrigCntrConfig */
  102. #define CNTR_MODE_INIT              (0)
  103. #define CNTR_MODE_RELOAD            (2)
  104. #define CNTR_MODE_DISABLE           (3)
  105.  
  106. /* "mode" in TrigTickConfig */
  107. #define TICK_MODE_INIT_ROLL         (0)
  108. #define TICK_MODE_INIT_NOROLL       (1)
  109. #define TICK_MODE_RELOAD            (2)
  110. #define TICK_MODE_DISABLE           (3)
  111.  
  112. /*****************************************************************************
  113.  *   The following are return codes for all of the NI-VXI Trigger functions
  114.  */
  115.  
  116. /* General defines for all NI-VXI Trigger functions */
  117. #define NIVXI_OK_NO_NEED_TO_CALL    ( 1)
  118. #define NIVXI_OK                    (0)
  119. #define TRIGS_NOT_SUPPORTED         NO_HARDWARE_SUPPORT
  120. #define INVALID_CONTROLLER          (-2)
  121. #define INVALID_LINE_OR_PROT        (-3)
  122. #define LINE_NOT_SUPPORTED          (-4)
  123. #define PROT_NOT_SUPPORTED          (-5)
  124. #define TRIG_WAIT_TIMEOUT           (-6)
  125. #define LINE_ALREADY_CONFIGURED     (-7)
  126. #define UNSUPPORTED_SOURCE_LINE     (-8)
  127. #define UNSUPPORTED_DEST_LINE       (-9)
  128. #define INVALID_CONFIG_MODE         (-10)
  129. #define LINE_ALREADY_MAPPED         (-11)
  130. #define LINE_NOT_CONFIGURED         (-12)
  131. #define INVALID_COUNT               (-13)
  132. #define INVALID_MAP_MODE            (-14)
  133. #define OPERATION_PENDING           (-15)
  134. #define ACKNOWLEDGE_PENDING         (-16)
  135. #define NO_TRIGGER_SENSED           (-17)
  136.  
  137. /* AcknowledgeTrig */
  138. #define TRIG_ACK_OK_NO_NEED         NIVXI_OK_NO_NEED_TO_CALL
  139. #define TRIG_ACK_OK                 NIVXI_OK       /* zero */
  140. #define TRIG_ACK_UNSUP              TRIGS_NOT_SUPPORTED
  141. #define TRIG_ACK_INVCONT            INVALID_CONTROLLER
  142. #define TRIG_ACK_INVLINE            INVALID_LINE_OR_PROT
  143. #define TRIG_ACK_UNSUP_LINE         LINE_NOT_SUPPORTED
  144. #define TRIG_ACK_NOT_CONFIGURED     LINE_NOT_CONFIGURED
  145. #define TRIG_ACK_NOT_SENSED         NO_TRIGGER_SENSED
  146. #define TRIG_ACK_NOT_EXT_SEMISYNC   (-18)
  147.  
  148. /* EnableTrigSense, DisableTrigSense */
  149. #define TRIG_SENSE_OK               NIVXI_OK       /* zero */
  150. #define TRIG_SENSE_UNSUP            TRIGS_NOT_SUPPORTED
  151. #define TRIG_SENSE_INVCONT          INVALID_CONTROLLER
  152. #define TRIG_SENSE_INVLINE          INVALID_LINE_OR_PROT
  153. #define TRIG_SENSE_UNSUP_LINE       LINE_NOT_SUPPORTED
  154. #define TRIG_SENSE_NOT_CONFIGURED   LINE_NOT_CONFIGURED
  155.  
  156. /* additional for EnableTrigSense */
  157. #define TRIG_SENSE_UNSUP_PROT       PROT_NOT_SUPPORTED
  158. #define TRIG_SENSE_PREV_CONF        LINE_ALREADY_CONFIGURED
  159. #define TRIG_SENSE_CNTR_PEND        OPERATION_PENDING
  160.  
  161. /* GetTrigHandler "func" return codes */
  162. #define TRIG_GET_INVLINE            (0)
  163.  
  164. /* SetTrigHandler */
  165. #define TRIG_SET_OK                 NIVXI_OK       /* zero */
  166. #define TRIG_SET_UNSUP              TRIGS_NOT_SUPPORTED
  167.  
  168. /* MapTrigToTrig, UnMapTrigToTrig */
  169. #define TRIG_MAP_OK                 NIVXI_OK       /* zero */
  170. #define TRIG_MAP_UNSUP              TRIGS_NOT_SUPPORTED
  171. #define TRIG_MAP_INVCONT            INVALID_CONTROLLER
  172. #define TRIG_MAP_UNSUP_SRC          UNSUPPORTED_SOURCE_LINE
  173. #define TRIG_MAP_UNSUP_DEST         UNSUPPORTED_DEST_LINE
  174. #define TRIG_MAP_UNSUP_MODE         INVALID_CONFIG_MODE
  175. #define TRIG_MAP_PREV_MAP           LINE_ALREADY_MAPPED
  176. #define TRIG_MAP_NPREV_MAP          LINE_NOT_CONFIGURED
  177.  
  178. /* SrcTrig */
  179. #define TRIG_SRC_OK                 NIVXI_OK       /* zero */
  180. #define TRIG_SRC_UNSUP              TRIGS_NOT_SUPPORTED
  181. #define TRIG_SRC_INVCONT            INVALID_CONTROLLER
  182. #define TRIG_SRC_INVLINE            INVALID_LINE_OR_PROT
  183. #define TRIG_SRC_INVPROT            INVALID_LINE_OR_PROT
  184. #define TRIG_SRC_UNSUP_LINE         LINE_NOT_SUPPORTED
  185. #define TRIG_SRC_UNSUP_PROT         PROT_NOT_SUPPORTED
  186. #define TRIG_SRC_TIMEOUT_ACK        WAIT_TIMEOUT
  187. #define TRIG_SRC_PREV_CONF          LINE_ALREADY_CONFIGURED
  188. #define TRIG_SRC_ACK_PEND           ACKNOWLEDGE_PENDING
  189. #define TRIG_SRC_CNTR_PEND          OPERATION_PENDING
  190. #define TRIG_SRC_NOT_CONFIGURED     LINE_NOT_CONFIGURED
  191.  
  192. /* TrigAssertConfig, TrigExtConfig, TrigCntrConfig, TrigTickConfig */
  193. #define TRIG_CONFIG_OK_DISABLE      (3)  
  194. #define TRIG_CONFIG_OK_RELOAD       (2)
  195. #define TRIG_CONFIG_OK_INIT_NOROLL  (1)
  196. #define TRIG_CONFIG_OK_INIT         NIVXI_OK       /* zero */
  197. #define TRIG_CONFIG_UNSUP           TRIGS_NOT_SUPPORTED
  198. #define TRIG_CONFIG_INVCONT         INVALID_CONTROLLER
  199. #define TRIG_CONFIG_INVMODE         INVALID_CONFIG_MODE
  200. #define TRIG_CONFIG_INVLINE         INVALID_LINE_OR_PROT
  201. #define TRIG_CONFIG_NOT_CONFIGURED  LINE_NOT_CONFIGURED
  202. #define TRIG_CONFIG_CNTR_PEND       OPERATION_PENDING
  203. #define TRIG_CONFIG_UNSUP_SOURCE    UNSUPPORTED_SOURCE_LINE
  204.  
  205. /* WaitForTrig */
  206. #define TRIG_WAIT_OK                NIVXI_OK       /* zero */
  207. #define TRIG_WAIT_UNSUP             TRIGS_NOT_SUPPORTED
  208. #define TRIG_WAIT_INVCONT           INVALID_CONTROLLER
  209. #define TRIG_WAIT_INVLINE           INVALID_LINE_OR_PROT
  210. #define TRIG_WAIT_TIMEOUT_ACK       WAIT_TIMEOUT 
  211. #define TRIG_WAIT_NOT_CONFIGURED    LINE_NOT_CONFIGURED
  212.  
  213. #endif
  214.  
  215.