⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 visa.h

📁 这是一个手机校准程序
💻 H
📖 第 1 页 / 共 3 页
字号:
#define VI_LOAD_CONFIG              (4)

#define VI_NO_SEC_ADDR              (0xFFFF)

#define VI_ASRL_PAR_NONE            (0)
#define VI_ASRL_PAR_ODD             (1)
#define VI_ASRL_PAR_EVEN            (2)
#define VI_ASRL_PAR_MARK            (3)
#define VI_ASRL_PAR_SPACE           (4)

#define VI_ASRL_STOP_ONE            (10)
#define VI_ASRL_STOP_ONE5           (15)
#define VI_ASRL_STOP_TWO            (20)

#define VI_ASRL_FLOW_NONE           (0)
#define VI_ASRL_FLOW_XON_XOFF       (1)
#define VI_ASRL_FLOW_RTS_CTS        (2)
#define VI_ASRL_FLOW_DTR_DSR        (4)

#define VI_ASRL_END_NONE            (0)
#define VI_ASRL_END_LAST_BIT        (1)
#define VI_ASRL_END_TERMCHAR        (2)
#define VI_ASRL_END_BREAK           (3)

#define VI_STATE_ASSERTED           (1)
#define VI_STATE_UNASSERTED         (0)
#define VI_STATE_UNKNOWN            (-1)

#define VI_BIG_ENDIAN               (0)
#define VI_LITTLE_ENDIAN            (1)

#define VI_DATA_PRIV                (0)
#define VI_DATA_NPRIV               (1)
#define VI_PROG_PRIV                (2)
#define VI_PROG_NPRIV               (3)
#define VI_BLCK_PRIV                (4)
#define VI_BLCK_NPRIV               (5)
#define VI_D64_PRIV                 (6)
#define VI_D64_NPRIV                (7)

#define VI_WIDTH_8                  (1)
#define VI_WIDTH_16                 (2)
#define VI_WIDTH_32                 (4)

#define VI_GPIB_REN_DEASSERT        (0)
#define VI_GPIB_REN_ASSERT          (1)
#define VI_GPIB_REN_DEASSERT_GTL    (2)
#define VI_GPIB_REN_ASSERT_ADDRESS  (3)
#define VI_GPIB_REN_ASSERT_LLO      (4)
#define VI_GPIB_REN_ASSERT_ADDRESS_LLO (5)
#define VI_GPIB_REN_ADDRESS_GTL     (6)

#define VI_VXI_CMD16                (0x0200)
#define VI_VXI_CMD16_RESP16         (0x0202)
#define VI_VXI_RESP16               (0x0002)
#define VI_VXI_CMD32                (0x0400)
#define VI_VXI_CMD32_RESP16         (0x0402)
#define VI_VXI_CMD32_RESP32         (0x0404)
#define VI_VXI_RESP32               (0x0004)

/*- National Instruments Peek/Poke Extensions -------------------------------*/

#if defined(NIVISA_PEEKPOKE)

#if defined(NIVISA_PEEKPOKE_SUPP)
#undef NIVISA_PEEKPOKE_SUPP
#endif

#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_)
/* This macro is supported for all Win32 compilers, including CVI. */
#define NIVISA_PEEKPOKE_SUPP
#elif (defined(_WINDOWS) || defined(_Windows)) && !defined(_CVI_) && !defined(_NI_mswin16_)
/* This macro is supported for Borland and Microsoft compilers on Win16, but not CVI. */
#define NIVISA_PEEKPOKE_SUPP
#elif defined(_CVI_) && defined(_NI_sparc_)
/* This macro is supported for Solaris 1 and 2, from CVI only. */
#define NIVISA_PEEKPOKE_SUPP
#else
/* This macro is not supported on other platforms. */
#endif

#if defined(NIVISA_PEEKPOKE_SUPP)

extern ViBoolean NI_viImplVISA1;
ViStatus _VI_FUNC NI_viOpenDefaultRM (ViPSession vi);
#define viOpenDefaultRM(vi) NI_viOpenDefaultRM(vi)

#define viPeek8(vi,addr,val)                                                \
   {                                                                        \
      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
      {                                                                     \
         do (*((ViPUInt8)(val)) = *((volatile ViUInt8 _VI_PTR)(addr)));     \
         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
      }                                                                     \
      else                                                                  \
      {                                                                     \
         (viPeek8)((vi),(addr),(val));                                      \
      }                                                                     \
   }

#define viPoke8(vi,addr,val)                                                \
   {                                                                        \
      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
      {                                                                     \
         do (*((volatile ViUInt8 _VI_PTR)(addr)) = ((ViUInt8)(val)));       \
         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
      }                                                                     \
      else                                                                  \
      {                                                                     \
         (viPoke8)((vi),(addr),(val));                                      \
      }                                                                     \
   }

#define viPeek16(vi,addr,val)                                               \
   {                                                                        \
      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
      {                                                                     \
         do (*((ViPUInt16)(val)) = *((volatile ViUInt16 _VI_PTR)(addr)));   \
         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
      }                                                                     \
      else                                                                  \
      {                                                                     \
         (viPeek16)((vi),(addr),(val));                                     \
      }                                                                     \
   }

#define viPoke16(vi,addr,val)                                               \
   {                                                                        \
      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
      {                                                                     \
         do (*((volatile ViUInt16 _VI_PTR)(addr)) = ((ViUInt16)(val)));     \
         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
      }                                                                     \
      else                                                                  \
      {                                                                     \
         (viPoke16)((vi),(addr),(val));                                     \
      }                                                                     \
   }

#define viPeek32(vi,addr,val)                                               \
   {                                                                        \
      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
      {                                                                     \
         do (*((ViPUInt32)(val)) = *((volatile ViUInt32 _VI_PTR)(addr)));   \
         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
      }                                                                     \
      else                                                                  \
      {                                                                     \
         (viPeek32)((vi),(addr),(val));                                     \
      }                                                                     \
   }

#define viPoke32(vi,addr,val)                                               \
   {                                                                        \
      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
      {                                                                     \
         do (*((volatile ViUInt32 _VI_PTR)(addr)) = ((ViUInt32)(val)));     \
         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
      }                                                                     \
      else                                                                  \
      {                                                                     \
         (viPoke32)((vi),(addr),(val));                                     \
      }                                                                     \
   }

#endif

#endif

/*- National Instruments PXI Extensions -------------------------------------*/

#if defined(NIVISA_PXI)

/* This macro is supported for all Win32 compilers, including CVI. */
/* This macro is not supported on other platforms. */

#define VI_ATTR_PXI_DEV_NUM         (0x3FFF0201UL)
#define VI_ATTR_PXI_FUNC_NUM        (0x3FFF0202UL)
#define VI_ATTR_PXI_SUB_MANF_ID     (0x3FFF0203UL)
#define VI_ATTR_PXI_SUB_MODEL_CODE  (0x3FFF0204UL)

#define VI_ATTR_PXI_MEM_TYPE_BAR0   (0x3FFF0211UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR1   (0x3FFF0212UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR2   (0x3FFF0213UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR3   (0x3FFF0214UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR4   (0x3FFF0215UL)
#define VI_ATTR_PXI_MEM_TYPE_BAR5   (0x3FFF0216UL)

#define VI_ATTR_PXI_MEM_BASE_BAR0   (0x3FFF0221UL)
#define VI_ATTR_PXI_MEM_BASE_BAR1   (0x3FFF0222UL)
#define VI_ATTR_PXI_MEM_BASE_BAR2   (0x3FFF0223UL)
#define VI_ATTR_PXI_MEM_BASE_BAR3   (0x3FFF0224UL)
#define VI_ATTR_PXI_MEM_BASE_BAR4   (0x3FFF0225UL)
#define VI_ATTR_PXI_MEM_BASE_BAR5   (0x3FFF0226UL)

#define VI_ATTR_PXI_MEM_SIZE_BAR0   (0x3FFF0231UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR1   (0x3FFF0232UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR2   (0x3FFF0233UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR3   (0x3FFF0234UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR4   (0x3FFF0235UL)
#define VI_ATTR_PXI_MEM_SIZE_BAR5   (0x3FFF0236UL)

#define VI_EVENT_PXI_INTR           (0x3FFF2022UL)

#define VI_INTF_PXI                 (5)

#define VI_PXI_CFG_SPACE            (10)
#define VI_PXI_BAR0_SPACE           (11)
#define VI_PXI_BAR1_SPACE           (12)
#define VI_PXI_BAR2_SPACE           (13)
#define VI_PXI_BAR3_SPACE           (14)
#define VI_PXI_BAR4_SPACE           (15)
#define VI_PXI_BAR5_SPACE           (16)

#define VI_PXI_ADDR_NONE            (0)
#define VI_PXI_ADDR_MEM             (1)
#define VI_PXI_ADDR_IO              (2)
#define VI_PXI_ADDR_CFG             (3)

#endif

#if defined(__cplusplus) || defined(__cplusplus__)
   }
#endif

#endif

/*- The End -----------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -