![]() |
RTXI 1.3
|
00001 00025 // Card Specific information 00026 #define APCI3200_BOARD_VENDOR_ID 0x15B8 00027 //#define APCI3200_ADDRESS_RANGE 264 00028 00029 int MODULE_NO; 00030 struct { 00031 INT i_Gain; 00032 INT i_Polarity; 00033 INT i_OffsetRange; 00034 INT i_Coupling; 00035 INT i_SingleDiff; 00036 INT i_AutoCalibration; 00037 UINT ui_ReloadValue; 00038 UINT ui_TimeUnitReloadVal; 00039 INT i_Interrupt; 00040 INT i_ModuleSelection; 00041 } Config_Parameters_Module1, Config_Parameters_Module2, 00042 Config_Parameters_Module3, Config_Parameters_Module4; 00043 00044 //ANALOG INPUT RANGE 00045 static const comedi_lrange range_apci3200_ai = { 8, { 00046 BIP_RANGE(10), 00047 BIP_RANGE(5), 00048 BIP_RANGE(2), 00049 BIP_RANGE(1), 00050 UNI_RANGE(10), 00051 UNI_RANGE(5), 00052 UNI_RANGE(2), 00053 UNI_RANGE(1) 00054 } 00055 }; 00056 00057 static const comedi_lrange range_apci3300_ai = { 4, { 00058 UNI_RANGE(10), 00059 UNI_RANGE(5), 00060 UNI_RANGE(2), 00061 UNI_RANGE(1) 00062 } 00063 }; 00064 00065 //Analog Input related Defines 00066 #define APCI3200_AI_OFFSET_GAIN 0 00067 #define APCI3200_AI_SC_TEST 4 00068 #define APCI3200_AI_IRQ 8 00069 #define APCI3200_AI_AUTOCAL 12 00070 #define APCI3200_RELOAD_CONV_TIME_VAL 32 00071 #define APCI3200_CONV_TIME_TIME_BASE 36 00072 #define APCI3200_RELOAD_DELAY_TIME_VAL 40 00073 #define APCI3200_DELAY_TIME_TIME_BASE 44 00074 #define APCI3200_AI_MODULE1 0 00075 #define APCI3200_AI_MODULE2 64 00076 #define APCI3200_AI_MODULE3 128 00077 #define APCI3200_AI_MODULE4 192 00078 #define TRUE 1 00079 #define FALSE 0 00080 #define APCI3200_AI_EOSIRQ 16 00081 #define APCI3200_AI_EOS 20 00082 #define APCI3200_AI_CHAN_ID 24 00083 #define APCI3200_AI_CHAN_VAL 28 00084 #define ANALOG_INPUT 0 00085 #define TEMPERATURE 1 00086 #define RESISTANCE 2 00087 00088 #define ENABLE_EXT_TRIG 1 00089 #define ENABLE_EXT_GATE 2 00090 #define ENABLE_EXT_TRIG_GATE 3 00091 00092 #define APCI3200_MAXVOLT 2.5 00093 #define ADDIDATA_GREATER_THAN_TEST 0 00094 #define ADDIDATA_LESS_THAN_TEST 1 00095 00096 #define ADDIDATA_UNIPOLAR 1 00097 #define ADDIDATA_BIPOLAR 2 00098 00099 //BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values 00100 #define MAX_MODULE 4 00101 //END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values 00102 00103 typedef struct { 00104 ULONG ul_NumberOfValue; 00105 ULONG *pul_ResistanceValue; 00106 ULONG *pul_TemperatureValue; 00107 } str_ADDIDATA_RTDStruct, *pstr_ADDIDATA_RTDStruct; 00108 00109 //BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values 00110 typedef struct { 00111 // Begin JK 05/08/2003 change for Linux 00112 unsigned long ul_CurrentSourceCJC; 00113 unsigned long ul_CurrentSource[5]; 00114 // End JK 05/08/2003 change for Linux 00115 00116 // Begin CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 00117 unsigned long ul_GainFactor[8]; // Gain Factor 00118 unsigned int w_GainValue[10]; 00119 // End CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 00120 } str_Module; 00121 //END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values 00122 00123 //BEGIN JK 06.07.04: Management of sevrals boards 00124 typedef struct { 00125 INT i_CJCAvailable; 00126 INT i_CJCPolarity; 00127 INT i_CJCGain; 00128 INT i_InterruptFlag; 00129 INT i_ADDIDATAPolarity; 00130 INT i_ADDIDATAGain; 00131 INT i_AutoCalibration; 00132 INT i_ADDIDATAConversionTime; 00133 INT i_ADDIDATAConversionTimeUnit; 00134 INT i_ADDIDATAType; 00135 INT i_ChannelNo; 00136 INT i_ChannelCount; 00137 INT i_ScanType; 00138 INT i_FirstChannel; 00139 INT i_LastChannel; 00140 INT i_Sum; 00141 INT i_Offset; 00142 UINT ui_Channel_num; 00143 INT i_Count; 00144 INT i_Initialised; 00145 //UINT ui_InterruptChannelValue[96]; //Buffer 00146 UINT ui_InterruptChannelValue[144]; //Buffer 00147 BYTE b_StructInitialized; 00148 //Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 00149 lsampl_t ui_ScanValueArray[7 + 12]; // 7 is the maximal number of channels 00150 //End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 00151 00152 //Begin JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values 00153 INT i_ConnectionType; 00154 INT i_NbrOfModule; 00155 str_Module s_Module[MAX_MODULE]; 00156 //End JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values 00157 } str_BoardInfos; 00158 //END JK 06.07.04: Management of sevrals boards 00159 00160 // Hardware Layer functions for Apci3200 00161 00162 //AI 00163 00164 INT i_APCI3200_ConfigAnalogInput(comedi_device * dev, comedi_subdevice * s, 00165 comedi_insn * insn, lsampl_t * data); 00166 INT i_APCI3200_ReadAnalogInput(comedi_device * dev, comedi_subdevice * s, 00167 comedi_insn * insn, lsampl_t * data); 00168 INT i_APCI3200_InsnWriteReleaseAnalogInput(comedi_device * dev, 00169 comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); 00170 INT i_APCI3200_InsnBits_AnalogInput_Test(comedi_device * dev, 00171 comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); 00172 INT i_APCI3200_StopCyclicAcquisition(comedi_device * dev, comedi_subdevice * s); 00173 INT i_APCI3200_InterruptHandleEos(comedi_device * dev); 00174 INT i_APCI3200_CommandTestAnalogInput(comedi_device * dev, comedi_subdevice * s, 00175 comedi_cmd * cmd); 00176 INT i_APCI3200_CommandAnalogInput(comedi_device * dev, comedi_subdevice * s); 00177 INT i_APCI3200_ReadDigitalInput(comedi_device * dev, comedi_subdevice * s, 00178 comedi_insn * insn, lsampl_t * data); 00179 //Interrupt 00180 void v_APCI3200_Interrupt(int irq, void *d); 00181 int i_APCI3200_InterruptHandleEos(comedi_device * dev); 00182 //Reset functions 00183 INT i_APCI3200_Reset(comedi_device * dev); 00184 00185 int i_APCI3200_ReadCJCCalOffset(comedi_device * dev, lsampl_t * data); 00186 int i_APCI3200_ReadCJCValue(comedi_device * dev, lsampl_t * data); 00187 int i_APCI3200_ReadCalibrationGainValue(comedi_device * dev, UINT * data); 00188 int i_APCI3200_ReadCalibrationOffsetValue(comedi_device * dev, UINT * data); 00189 int i_APCI3200_Read1AnalogInputChannel(comedi_device * dev, 00190 comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); 00191 int i_APCI3200_ReadCJCCalGain(comedi_device * dev, lsampl_t * data);