RTXI 1.3
comedi/comedi/drivers/addi-data/APCI1710_INCCPT.h
Go to the documentation of this file.
00001 
00025 #define APCI1710_16BIT_COUNTER                          0x10
00026 #define APCI1710_32BIT_COUNTER                          0x0
00027 #define APCI1710_QUADRUPLE_MODE                         0x0
00028 #define APCI1710_DOUBLE_MODE                            0x3
00029 #define APCI1710_SIMPLE_MODE                            0xF
00030 #define APCI1710_DIRECT_MODE                            0x80
00031 #define APCI1710_HYSTERESIS_ON                          0x60
00032 #define APCI1710_HYSTERESIS_OFF                         0x0
00033 #define APCI1710_INCREMENT                              0x60
00034 #define APCI1710_DECREMENT                              0x0
00035 #define APCI1710_LATCH_COUNTER                          0x1
00036 #define APCI1710_CLEAR_COUNTER                          0x0
00037 #define APCI1710_LOW                                    0x0
00038 #define APCI1710_HIGH                                   0x1
00039 
00040 /*********************/
00041 /* Version 0600-0229 */
00042 /*********************/
00043 
00044 #define APCI1710_HIGH_EDGE_CLEAR_COUNTER                0x0
00045 #define APCI1710_HIGH_EDGE_LATCH_COUNTER                0x1
00046 #define APCI1710_LOW_EDGE_CLEAR_COUNTER                 0x2
00047 #define APCI1710_LOW_EDGE_LATCH_COUNTER                 0x3
00048 #define APCI1710_HIGH_EDGE_LATCH_AND_CLEAR_COUNTER      0x4
00049 #define APCI1710_LOW_EDGE_LATCH_AND_CLEAR_COUNTER       0x5
00050 #define APCI1710_SOURCE_0                               0x0
00051 #define APCI1710_SOURCE_1                               0x1
00052 
00053 #define APCI1710_30MHZ           30
00054 #define APCI1710_33MHZ           33
00055 #define APCI1710_40MHZ           40
00056 
00057 #define APCI1710_ENABLE_LATCH_INT               0x80
00058 #define APCI1710_DISABLE_LATCH_INT              (~APCI1710_ENABLE_LATCH_INT)
00059 
00060 #define APCI1710_INDEX_LATCH_COUNTER            0x10
00061 #define APCI1710_INDEX_AUTO_MODE                0x8
00062 #define APCI1710_ENABLE_INDEX                   0x4
00063 #define APCI1710_DISABLE_INDEX                  (~APCI1710_ENABLE_INDEX)
00064 #define APCI1710_ENABLE_LATCH_AND_CLEAR         0x8
00065 #define APCI1710_DISABLE_LATCH_AND_CLEAR        (~APCI1710_ENABLE_LATCH_AND_CLEAR)
00066 #define APCI1710_SET_LOW_INDEX_LEVEL            0x4
00067 #define APCI1710_SET_HIGH_INDEX_LEVEL           (~APCI1710_SET_LOW_INDEX_LEVEL)
00068 #define APCI1710_INVERT_INDEX_RFERENCE          0x2
00069 #define APCI1710_DEFAULT_INDEX_RFERENCE         (~APCI1710_INVERT_INDEX_RFERENCE)
00070 
00071 #define APCI1710_ENABLE_INDEX_INT               0x1
00072 #define APCI1710_DISABLE_INDEX_INT              (~APCI1710_ENABLE_INDEX_INT)
00073 
00074 #define APCI1710_ENABLE_FREQUENCY               0x4
00075 #define APCI1710_DISABLE_FREQUENCY              (~APCI1710_ENABLE_FREQUENCY)
00076 
00077 #define APCI1710_ENABLE_FREQUENCY_INT           0x8
00078 #define APCI1710_DISABLE_FREQUENCY_INT          (~APCI1710_ENABLE_FREQUENCY_INT)
00079 
00080 #define APCI1710_ENABLE_40MHZ_FREQUENCY         0x40
00081 #define APCI1710_DISABLE_40MHZ_FREQUENCY        (~APCI1710_ENABLE_40MHZ_FREQUENCY)
00082 
00083 #define APCI1710_ENABLE_40MHZ_FILTER            0x80
00084 #define APCI1710_DISABLE_40MHZ_FILTER           (~APCI1710_ENABLE_40MHZ_FILTER)
00085 
00086 #define APCI1710_ENABLE_COMPARE_INT             0x2
00087 #define APCI1710_DISABLE_COMPARE_INT            (~APCI1710_ENABLE_COMPARE_INT)
00088 
00089 #define APCI1710_ENABLE_INDEX_ACTION            0x20
00090 #define APCI1710_DISABLE_INDEX_ACTION           (~APCI1710_ENABLE_INDEX_ACTION)
00091 #define APCI1710_REFERENCE_HIGH                 0x40
00092 #define APCI1710_REFERENCE_LOW                  (~APCI1710_REFERENCE_HIGH)
00093 
00094 #define APCI1710_TOR_GATE_LOW           0x40
00095 #define APCI1710_TOR_GATE_HIGH          (~APCI1710_TOR_GATE_LOW)
00096 
00097 //      INSN CONFIG 
00098 #define APCI1710_INCCPT_INITCOUNTER                                                     100
00099 #define APCI1710_INCCPT_COUNTERAUTOTEST                                         101
00100 #define APCI1710_INCCPT_INITINDEX                                                       102
00101 #define APCI1710_INCCPT_INITREFERENCE                                           103
00102 #define APCI1710_INCCPT_INITEXTERNALSTROBE                                      104
00103 #define APCI1710_INCCPT_INITCOMPARELOGIC                                        105
00104 #define APCI1710_INCCPT_INITFREQUENCYMEASUREMENT                        106
00105 
00106 // INSN READ
00107 #define APCI1710_INCCPT_READLATCHREGISTERSTATUS                         200
00108 #define APCI1710_INCCPT_READLATCHREGISTERVALUE                          201
00109 #define APCI1710_INCCPT_READ16BITCOUNTERVALUE                           202
00110 #define APCI1710_INCCPT_READ32BITCOUNTERVALUE                           203
00111 #define APCI1710_INCCPT_GETINDEXSTATUS                                          204
00112 #define APCI1710_INCCPT_GETREFERENCESTATUS                                      205
00113 #define APCI1710_INCCPT_GETUASSTATUS                                            206
00114 #define APCI1710_INCCPT_GETCBSTATUS                                                     207
00115 #define APCI1710_INCCPT_GET16BITCBSTATUS                                        208
00116 #define APCI1710_INCCPT_GETUDSTATUS                                                     209
00117 #define APCI1710_INCCPT_GETINTERRUPTUDLATCHEDSTATUS                     210
00118 #define APCI1710_INCCPT_READFREQUENCYMEASUREMENT                        211
00119 #define APCI1710_INCCPT_READINTERRUPT                       212
00120 
00121 //INSN BITS
00122 #define APCI1710_INCCPT_CLEARCOUNTERVALUE                                       300
00123 #define APCI1710_INCCPT_CLEARALLCOUNTERVALUE                            301
00124 #define APCI1710_INCCPT_SETINPUTFILTER                                          302
00125 #define APCI1710_INCCPT_LATCHCOUNTER                                            303
00126 #define APCI1710_INCCPT_SETINDEXANDREFERENCESOURCE                      304
00127 #define APCI1710_INCCPT_SETDIGITALCHLON                                         305
00128 #define APCI1710_INCCPT_SETDIGITALCHLOFF                                        306
00129 
00130 // INSN WRITE
00131 #define APCI1710_INCCPT_ENABLELATCHINTERRUPT                            400
00132 #define APCI1710_INCCPT_DISABLELATCHINTERRUPT                           401
00133 #define APCI1710_INCCPT_WRITE16BITCOUNTERVALUE                          402
00134 #define APCI1710_INCCPT_WRITE32BITCOUNTERVALUE                          403
00135 #define APCI1710_INCCPT_ENABLEINDEX                                                     404
00136 #define APCI1710_INCCPT_DISABLEINDEX                                            405
00137 #define APCI1710_INCCPT_ENABLECOMPARELOGIC                                      406
00138 #define APCI1710_INCCPT_DISABLECOMPARELOGIC                                     407
00139 #define APCI1710_INCCPT_ENABLEFREQUENCYMEASUREMENT                      408
00140 #define APCI1710_INCCPT_DISABLEFREQUENCYMEASUREMENT                     409
00141 
00142 /************ Main Functions *************/
00143 INT i_APCI1710_InsnConfigINCCPT(comedi_device * dev, comedi_subdevice * s,
00144         comedi_insn * insn, lsampl_t * data);
00145 
00146 INT i_APCI1710_InsnBitsINCCPT(comedi_device * dev, comedi_subdevice * s,
00147         comedi_insn * insn, lsampl_t * data);
00148 
00149 INT i_APCI1710_InsnWriteINCCPT(comedi_device * dev, comedi_subdevice * s,
00150         comedi_insn * insn, lsampl_t * data);
00151 
00152 INT i_APCI1710_InsnReadINCCPT(comedi_device * dev, comedi_subdevice * s,
00153         comedi_insn * insn, lsampl_t * data);
00154 
00155 /*********** Supplementary Functions********/
00156 
00157 // INSN CONFIG
00158 
00159 INT i_APCI1710_InitCounter(comedi_device * dev,
00160         BYTE b_ModulNbr,
00161         BYTE b_CounterRange,
00162         BYTE b_FirstCounterModus,
00163         BYTE b_FirstCounterOption,
00164         BYTE b_SecondCounterModus, BYTE b_SecondCounterOption);
00165 
00166 INT i_APCI1710_CounterAutoTest(comedi_device * dev, PBYTE pb_TestStatus);
00167 
00168 INT i_APCI1710_InitIndex(comedi_device * dev,
00169         BYTE b_ModulNbr,
00170         BYTE b_ReferenceAction,
00171         BYTE b_IndexOperation, BYTE b_AutoMode, BYTE b_InterruptEnable);
00172 
00173 INT i_APCI1710_InitReference(comedi_device * dev,
00174         BYTE b_ModulNbr, BYTE b_ReferenceLevel);
00175 
00176 INT i_APCI1710_InitExternalStrobe(comedi_device * dev,
00177         BYTE b_ModulNbr, BYTE b_ExternalStrobe, BYTE b_ExternalStrobeLevel);
00178 
00179 INT i_APCI1710_InitCompareLogic(comedi_device * dev,
00180         BYTE b_ModulNbr, UINT ui_CompareValue);
00181 
00182 INT i_APCI1710_InitFrequencyMeasurement(comedi_device * dev,
00183         BYTE b_ModulNbr,
00184         BYTE b_PCIInputClock,
00185         BYTE b_TimingUnity,
00186         ULONG ul_TimingInterval, PULONG pul_RealTimingInterval);
00187 
00188 //INSN BITS
00189 
00190 INT i_APCI1710_ClearCounterValue(comedi_device * dev, BYTE b_ModulNbr);
00191 
00192 INT i_APCI1710_ClearAllCounterValue(comedi_device * dev);
00193 
00194 INT i_APCI1710_SetInputFilter(comedi_device * dev,
00195         BYTE b_ModulNbr, BYTE b_PCIInputClock, BYTE b_Filter);
00196 
00197 INT i_APCI1710_LatchCounter(comedi_device * dev,
00198         BYTE b_ModulNbr, BYTE b_LatchReg);
00199 
00200 INT i_APCI1710_SetIndexAndReferenceSource(comedi_device * dev,
00201         BYTE b_ModulNbr, BYTE b_SourceSelection);
00202 
00203 INT i_APCI1710_SetDigitalChlOn(comedi_device * dev, BYTE b_ModulNbr);
00204 
00205 INT i_APCI1710_SetDigitalChlOff(comedi_device * dev, BYTE b_ModulNbr);
00206 
00207 // INSN WRITE
00208 INT i_APCI1710_EnableLatchInterrupt(comedi_device * dev, BYTE b_ModulNbr);
00209 
00210 INT i_APCI1710_DisableLatchInterrupt(comedi_device * dev, BYTE b_ModulNbr);
00211 
00212 INT i_APCI1710_Write16BitCounterValue(comedi_device * dev,
00213         BYTE b_ModulNbr, BYTE b_SelectedCounter, UINT ui_WriteValue);
00214 
00215 INT i_APCI1710_Write32BitCounterValue(comedi_device * dev,
00216         BYTE b_ModulNbr, ULONG ul_WriteValue);
00217 
00218 INT i_APCI1710_EnableIndex(comedi_device * dev, BYTE b_ModulNbr);
00219 
00220 INT i_APCI1710_DisableIndex(comedi_device * dev, BYTE b_ModulNbr);
00221 
00222 INT i_APCI1710_EnableCompareLogic(comedi_device * dev, BYTE b_ModulNbr);
00223 
00224 INT i_APCI1710_DisableCompareLogic(comedi_device * dev, BYTE b_ModulNbr);
00225 
00226 INT i_APCI1710_EnableFrequencyMeasurement(comedi_device * dev,
00227         BYTE b_ModulNbr, BYTE b_InterruptEnable);
00228 
00229 INT i_APCI1710_DisableFrequencyMeasurement(comedi_device * dev,
00230         BYTE b_ModulNbr);
00231 
00232 // INSN READ
00233 
00234 INT i_APCI1710_ReadLatchRegisterStatus(comedi_device * dev,
00235         BYTE b_ModulNbr, BYTE b_LatchReg, PBYTE pb_LatchStatus);
00236 
00237 INT i_APCI1710_ReadLatchRegisterValue(comedi_device * dev,
00238         BYTE b_ModulNbr, BYTE b_LatchReg, PULONG pul_LatchValue);
00239 
00240 INT i_APCI1710_Read16BitCounterValue(comedi_device * dev,
00241         BYTE b_ModulNbr, BYTE b_SelectedCounter, PUINT pui_CounterValue);
00242 
00243 INT i_APCI1710_Read32BitCounterValue(comedi_device * dev,
00244         BYTE b_ModulNbr, PULONG pul_CounterValue);
00245 
00246 INT i_APCI1710_GetIndexStatus(comedi_device * dev,
00247         BYTE b_ModulNbr, PBYTE pb_IndexStatus);
00248 
00249 INT i_APCI1710_GetReferenceStatus(comedi_device * dev,
00250         BYTE b_ModulNbr, PBYTE pb_ReferenceStatus);
00251 
00252 INT i_APCI1710_GetUASStatus(comedi_device * dev,
00253         BYTE b_ModulNbr, PBYTE pb_UASStatus);
00254 
00255 INT i_APCI1710_GetCBStatus(comedi_device * dev,
00256         BYTE b_ModulNbr, PBYTE pb_CBStatus);
00257 
00258 INT i_APCI1710_Get16BitCBStatus(comedi_device * dev,
00259         BYTE b_ModulNbr, PBYTE pb_CBStatusCounter0, PBYTE pb_CBStatusCounter1);
00260 
00261 INT i_APCI1710_GetUDStatus(comedi_device * dev,
00262         BYTE b_ModulNbr, PBYTE pb_UDStatus);
00263 
00264 INT i_APCI1710_GetInterruptUDLatchedStatus(comedi_device * dev,
00265         BYTE b_ModulNbr, PBYTE pb_UDStatus);
00266 
00267 INT i_APCI1710_ReadFrequencyMeasurement(comedi_device * dev,
00268         BYTE b_ModulNbr,
00269         PBYTE pb_Status, PBYTE pb_UDStatus, PULONG pul_ReadValue);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines