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

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*             National Instruments NI-VXI Software Interface             */
  4. /*                   (C) 1996,  National Instruments                      */
  5. /*                                                                        */
  6. /*                   Device Information Include File                      */
  7. /*                                                                        */
  8. /**************************************************************************/
  9. /*                       DO NOT MODIFY THIS FILE                          */
  10. /**************************************************************************/
  11. /* The following file contains all of the necessary include file 
  12.  * information for use of the National Instruments NI-VXI Device Access 
  13.  * functions. 
  14.  */
  15.  
  16. #if !defined(devinfo_h)
  17. #define devinfo_h
  18.  
  19. #include "datasize.h"
  20.  
  21. /*************************************************************************
  22.  * The following is the structure definition for the structure
  23.  * returned from GetDevInfo.  Following the structure is definitions
  24.  * of fields which are bit encoded.
  25.  */
  26.  
  27. typedef struct UserLAEntry {
  28.     INT16   la;            /* Logical Address of this entry        */
  29.     INT8    DevName[14];   /* Device Name (assigned by RM)         */
  30.     INT16   Cmdr;          /* Logical Address of commander         */
  31.     INT16   Mainframe;     /* MainFrame number (extended or CPU)   */
  32.     INT16   Slot;          /* physical slot in which it resides    */
  33.     UINT16  ManId;         /* manufacturer identification number   */
  34.     INT8    ManName[14];   /* manufacturer name (from mfnameid.tbl)*/
  35.     UINT16  ModelCode;     /* manufacturer model number            */
  36.     INT8    ModelName[14]; /* model name (from model.tbl)          */
  37.     UINT16  DevClass;      /* Device Class 0=MEM,1=EXT,2=MBD,3=RBD */
  38.     UINT16  SubClass;      /* Subclass for Extended Class devices  */
  39.     UINT16  MemSpace;      /* Address Space: 0=A24, 1=A32, 3=A16   */
  40.     UINT32  MemBase;       /* address of A24 or A32 address space  */
  41.     UINT32  MemSize;       /* address space size in actual bytes   */
  42.     UINT16  MemType;       /* memory type (attributes)             */
  43.     UINT16  IrqLevel;      /* VXI interrupter levels assigned      */
  44.     UINT16  IrqHandle;     /* VXI interrupt handler levels assigned*/
  45.     UINT16  ExtInfo;       /* Controller/extender information      */
  46.     UINT16  AsyncMode;     /* Asynchronous Mode Control Response   */
  47.     UINT16  RespEnable;    /* Response Interrupts Enabled          */
  48.     UINT16  Prot;          /* protcols supported (from Read Prot)  */
  49.     UINT16  Flags;         /* various flags                        */
  50.     UINT16  StatusState;   /* 0=failed,1=extended,2=diag,3=passed  */
  51. } UserLAEntry;
  52.  
  53. /* UserLAEntry.DevClass definitions */
  54. #define DevClass_MEM        0    /* Memory Class device                    */
  55. #define DevClass_EXT        1    /* Extended Class device (see .SubClass   */
  56. #define DevClass_MBD        2    /* Message-Based device                   */
  57. #define DevClass_RBD        3    /* Register Based device                  */
  58.  
  59. /* UserLAEntry.ExtInfo definitions */
  60. #define EXT_REMOTE      (1U<<13) /* 1=Remote Controller */
  61. #define EXT_CHILD       (1U<<12) /* 1=Child side extender, 0=Parent side   */
  62. #define EXT_FRAME_EXT   (1U<<11) /* 1=device is a mainframe extender       */
  63. #define EXT_EXTENDED    (1U<<10) /* 1=device is an Extended controller     */
  64. #define EXT_EMBEDDED    (1U<<9)  /* 1=device is an Embedded controller     */
  65. #define EXT_EXTERNAL    (1U<<8)  /* 1=device is an External controller     */
  66. #define EXT_TOWARD_ROOT 0x00FF   /* mask: LA of extender toward root frame */
  67.  
  68. /* UserLAEntry.flags definitions */
  69. #define LA_ALIVE        (1U<<0)  /* 1=was alive at one time, 0=never alive */
  70. #define LA_DEAD         (1U<<1)  /* 1=was forced offline,0=currently alive */
  71. #define LA_READ_STB     (1U<<2)  /* 1=Device can respond to WS Read STB    */
  72. #define LA_MultiplePH   (1U<<3)  /* 1=device was mult. programable handler */
  73. #define LA_DC_Device    (1U<<4)  /* 1=device was Dynamically config device */
  74.  
  75. /* UserLAEntry.StatusState definitions (copy of PASSED,READY bits)*/
  76. #define LA_PASSED           3    /* VXI Specification 1.2 definitions      */
  77. #define LA_EXTEND           1
  78. #define LA_FAILED           0
  79. #define LA_DIAG             2
  80. #define LA_PASSED_READY     3    /* VXI Specification 1.3 definitions      */
  81. #define LA_PASSED_NREADY    1
  82. #define LA_NPASSED_NREADY   0
  83. #define LA_CONFIG_REG_INIT  2
  84.  
  85. /*************************************************************************
  86.  * The following are #define's for use with the GetDevInfo, 
  87.  * GetDevInfoStr, GetDevInfoShort, and GetDevInfoLong functions.  The 
  88.  * defines specify the value of the 'field' parameter.  These #define's
  89.  * may also be used with the SetDevInfo functions.  Great care should be
  90.  * used when using the SetDevInfo functions.  Changing values of these
  91.  * fields has a direct effect on the execution of the NI-VXI software.
  92.  */
  93.  
  94. #define DI_DIENTRY          0    /* get/set entire UserLAEntry structure    */
  95. #define DI_DEVNAME          1    /* get/set UserLAEntry.DevName     INT8[14]*/
  96. #define DI_CMDR             2    /* get/set UserLAEntry.Cmdr        INT16   */
  97. #define DI_FRAME            3    /* get/set UserLAEntry.Mainframe   INT16   */
  98. #define DI_SLOT             4    /* get/set UserLAEntry.Slot        INT16   */
  99. #define DI_MANID            5    /* get/set UserLAEntry.ManId       UINT16  */
  100. #define DI_MANNAME          6    /* get/set UserLAEntry.ManName     INT8[14]*/
  101. #define DI_MODELCODE        7    /* get/set UserLAEntry.ModelCode   UINT16  */
  102. #define DI_MODELNAME        8    /* get/set UserLAEntry.ModelName   INT8[14]*/
  103. #define DI_DEVCLASS         9    /* get/set UserLAEntry.DevClass    UINT16  */
  104. #define DI_SUBCLASS         10   /* get/set UserLAEntry.SubClass    UINT16  */
  105. #define DI_MEMSPACE         11   /* get/set UserLAEntry.MemSpace    UINT16  */
  106. #define DI_MEMBASE          12   /* get/set UserLAEntry.MemBase     UINT32  */
  107. #define DI_MEMSIZE          13   /* get/set UserLAEntry.MemSize     UINT32  */
  108. #define DI_MEMTYPE          14   /* get/set UserLAEntry.MemType     UINT16  */
  109. #define DI_IRQLEVEL         15   /* get/set UserLAEntry.IrqLevel    UINT16  */
  110. #define DI_IRQHANDLE        16   /* get/set UserLAEntry.IrqHandle   UINT16  */
  111. #define DI_EXTINFO          17   /* get/set UserLAEntry.ExtInfo     UINT16  */
  112. #define DI_ASYNCMODE        18   /* get/set UserLAEntry.AsyncMode   UINT16  */
  113. #define DI_RESPENA          19   /* get/set UserLAEntry.RespEnable  UINT16  */
  114. #define DI_PROT             20   /* get/set UserLAEntry.Prot        UINT16  */
  115. #define DI_FLAGS            21   /* get/set UserLAEntry.Flags       UINT16  */
  116. #define DI_STATUSSTATE      22   /* get/set UserLAEntry.StatusState UINT16  */
  117.  
  118. #define DI_MYNORMALOPERATION     (0x8000)
  119. #define DI_MYRESMANTMO           (0x8001)
  120. #define DI_MYSTATUSBYTE          (0x8002)
  121. #define DI_MYSERVAREA            (0x8003)
  122. #define DI_MYPROTREG             (0x8004)
  123. #define DI_MYREADPROTRESP        (0x8005)
  124. #define DI_MYNUMHANDLERS         (0x8010)
  125. #define DI_MYHANDLERTOVME1       (0x8011)
  126. #define DI_MYHANDLERTOVME2       (0x8012)
  127. #define DI_MYHANDLERTOVME3       (0x8013)
  128. #define DI_MYHANDLERTOVME4       (0x8014)
  129. #define DI_MYHANDLERTOVME5       (0x8015)
  130. #define DI_MYHANDLERTOVME6       (0x8016)
  131. #define DI_MYHANDLERTOVME7       (0x8017)
  132. #define DI_MYNUMINTERRUPTERS     (0x8018)
  133. #define DI_MYINTERRUPTERTOVME1   (0x8019)
  134. #define DI_MYINTERRUPTERTOVME2   (0x801a)
  135. #define DI_MYINTERRUPTERTOVME3   (0x801b)
  136. #define DI_MYINTERRUPTERTOVME4   (0x801c)
  137. #define DI_MYINTERRUPTERTOVME5   (0x801d)
  138. #define DI_MYINTERRUPTERTOVME6   (0x801e)
  139. #define DI_MYINTERRUPTERTOVME7   (0x801f)
  140. #define DI_MYEVENTS00_1F         (0x8020)
  141. #define DI_MYEVENTS20_3F         (0x8021)
  142. #define DI_MYEVENTS40_5F         (0x8022)
  143. #define DI_MYEVENTS60_7F         (0x8023)
  144. #define DI_WSSTRGRECV            (0x8030)
  145. #define DI_WSSWRTDONE            (0x8031)
  146. #define DI_WSSWRTDONESTATUS      (0x8032)
  147. #define DI_WSSWRTDONECOUNT       (0x8033)
  148. #define DI_WSSRDDONE             (0x8034)
  149. #define DI_WSSRDDONESTATUS       (0x8035)
  150. #define DI_WSSRDDONECOUNT        (0x8036)
  151. #define DI_VXIINTCONTROLLER      (0x8040)
  152. #define DI_VXIINTLEVEL           (0x8041)
  153. #define DI_VXIINTSTATUSID        (0x8042)
  154. #define DI_CLOCKRECV             (0x8050)
  155. #define DI_SOFTRESETRECV         (0x8051)
  156. #define DI_SYSFAILRECV           (0x8052)
  157. #define DI_ACFAILRECV            (0x8053)
  158. #define DI_BUSERRORRECV          (0x8054)
  159. #define DI_NIVXI_SWREV           (0x8100)
  160. #define DI_NIVXI_HWREV           (0x8101)
  161. #define DI_NIVXI_DEVNAME         (0x8102)
  162. #define DI_NIVXI_RETRY           (0x8103)
  163. #define DI_NIVXI_MITESWRETRY     (0x8104)
  164. #define DI_NIVXI_DEVLOCATION     (0x8105)
  165. #define DI_NIVXI_VXIMOVE_SUPPORT (0x8106)
  166.  
  167. /*************************************************************************
  168.  * The following are return codes for all of the System Configuration
  169.  * functions.
  170.  */
  171.  
  172. /* InitVXIlibrary */
  173. #define INIT_RET_OK              NIVXI_OK    /* zero */
  174. #define INIT_RET_OK_REPEATED     ( 1)
  175. #define INIT_RET_ERROR           (-1)
  176.  
  177. /* CloseVXIlibrary */
  178. #define CLOSE_RET_OK             NIVXI_OK    /* zero */
  179. #define CLOSE_RET_OK_STILL_OPEN  ( 1)
  180. #define CLOSE_RET_ERROR          (-1)
  181.  
  182. /* FindDevLA, GetDevInfo, GetDevInfoStr, GetDevInfoShort, GetDevInfoLong,
  183.  * SetDevInfo, SetDevinfoStr, SetDevInfoShort, and SetDevInfoLong
  184.  */
  185. #define DI_RET_OK                NIVXI_OK    /* zero */
  186. #define DI_RET_DEVNF             (-1)
  187. #define DI_RET_INVFLD            (-2)
  188.  
  189. /* CreateDevInfo */
  190. #define DI_CREATE_OK             NIVXI_OK    /* zero */
  191. #define DI_CREATE_DEVEXISTS      (-1)
  192. #define DI_CREATE_LARANGE        (-2)
  193. #define DI_CREATE_ALLOCFAIL      (-3)
  194.  
  195. #endif
  196.  
  197.