📄 rtidrv.h
字号:
/*****************************************************************************
*** RTIDRV.H -- header file (Analog Devices - RTI-815 DACA board) ***
******************************************************************************
**** ****
**** Header file containing I/O register mapping and other info ****
**** defining both digital and analog I/O. ****
**** ****
**** Statistics: ****
**** Adapter has 16 contiguous one-byte registers through ****
**** which all access to RTI is made. Only registers ****
**** 0 - 13 are used.
**** contiguous memory, the RTI board only needs the base ****
**** address and than is accessed by pointer increment. Each ****
**** bit in the address number represents one-byte registers ****
**** in the memory area. ****
**** ****
**** Last revision date: 1/4/99 ****
**** Programmer: Dan Block ****
**** ****
*****************************************************************************/
#define TRUE 1
#define FALSE 0
/*************************************
*** I/O Register Map ***
*************************************/
/* base is default value on board */
#define RTIBASE ((PUCHAR)0x300) /* each register is one byte */
#define REG_0 ((PUCHAR)0x300) /* status/control register RW */
#define REG_1 ((PUCHAR)0x301) /* mux/gain RW */
#define REG_2 ((PUCHAR)0x302) /* software convert cmd -W */
#define REG_3 ((PUCHAR)0x303) /* ADC low R- */
#define REG_4 ((PUCHAR)0x304) /* ADC high R- */
#define REG_5 ((PUCHAR)0x305) /* DAC0 low -W */
#define REG_6 ((PUCHAR)0x306) /* DAC0 high -W */
#define REG_7 ((PUCHAR)0x307) /* DAC1 low -W */
#define REG_8 ((PUCHAR)0x308) /* DAC1 high -W */
#define REG_9 ((PUCHAR)0x309) /* flags clear -W */
#define REG_A ((PUCHAR)0x30A) /* dig input R- */
#define REG_B ((PUCHAR)0x30B) /* dig out RW */
#define REG_C ((PUCHAR)0x30C) /* 9513A data RW */
#define REG_D ((PUCHAR)0x30D) /* 9513A control/status RW */
/* _E and _F not used */
/*************************************
*** Binary I/O Device (parallel) ***
*************************************/
/* 8-bit in and 8-bit out ports */
#define BIN_INPUT REG_A /* read: input data reg */
#define BIN_OUTPUT REG_B /* read/write: output data reg */
#define STATUS REG_0
#define MUX_GAIN REG_1
#define CONVERT REG_2
#define ADC_LOW REG_3
#define ADC_HIGH REG_4
#define DAC0_LOW REG_5
#define DAC0_HIGH REG_6
#define DAC1_LOW REG_7
#define DAC1_HIGH REG_8
#define FLAGS_CLEAR REG_9
#define CH0_GAIN1 0
#define CH1_GAIN1 1
#define ADC_DONE 0x40
void _stdcall init_rti(void);
void _stdcall dig_init(void);
int _stdcall dig_in(void);
void _stdcall dig_out(int);
int _stdcall adc(int);
void _stdcall dac(int,int);
float _stdcall volt_in(int);
void _stdcall volt_out(int,float);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -