/*
+----------------------------------------------------------------------------+
-| int i_APCI1710_InsnConfigINCCPT(struct comedi_device *dev,struct comedi_subdevice *s,
-struct comedi_insn *insn,unsigned int *data)
-
-+----------------------------------------------------------------------------+
-| Task : Configuration function for INC_CPT |
-+----------------------------------------------------------------------------+
-| Input Parameters : |
-+----------------------------------------------------------------------------+
-| Output Parameters : *data
-+----------------------------------------------------------------------------+
-| Return Value : |
-+----------------------------------------------------------------------------+
-*/
-
-int i_APCI1710_InsnConfigINCCPT(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
-{
- struct addi_private *devpriv = dev->private;
- unsigned int ui_ConfigType;
- int i_ReturnValue = 0;
-
- ui_ConfigType = CR_CHAN(insn->chanspec);
-
- printk("\nINC_CPT");
-
- devpriv->tsk_Current = current; /* Save the current process task structure */
- switch (ui_ConfigType) {
- case APCI1710_INCCPT_INITCOUNTER:
- i_ReturnValue = i_APCI1710_InitCounter(dev,
- CR_AREF(insn->chanspec),
- (unsigned char) data[0],
- (unsigned char) data[1],
- (unsigned char) data[2], (unsigned char) data[3], (unsigned char) data[4]);
- break;
-
- case APCI1710_INCCPT_COUNTERAUTOTEST:
- i_ReturnValue = i_APCI1710_CounterAutoTest(dev,
- (unsigned char *) &data[0]);
- break;
-
- case APCI1710_INCCPT_INITINDEX:
- i_ReturnValue = i_APCI1710_InitIndex(dev,
- CR_AREF(insn->chanspec),
- (unsigned char) data[0],
- (unsigned char) data[1], (unsigned char) data[2], (unsigned char) data[3]);
- break;
-
- case APCI1710_INCCPT_INITREFERENCE:
- i_ReturnValue = i_APCI1710_InitReference(dev,
- CR_AREF(insn->chanspec), (unsigned char) data[0]);
- break;
-
- case APCI1710_INCCPT_INITEXTERNALSTROBE:
- i_ReturnValue = i_APCI1710_InitExternalStrobe(dev,
- CR_AREF(insn->chanspec),
- (unsigned char) data[0], (unsigned char) data[1]);
- break;
-
- case APCI1710_INCCPT_INITCOMPARELOGIC:
- i_ReturnValue = i_APCI1710_InitCompareLogic(dev,
- CR_AREF(insn->chanspec), (unsigned int) data[0]);
- break;
-
- case APCI1710_INCCPT_INITFREQUENCYMEASUREMENT:
- i_ReturnValue = i_APCI1710_InitFrequencyMeasurement(dev,
- CR_AREF(insn->chanspec),
- (unsigned char) data[0],
- (unsigned char) data[1], (unsigned int) data[2], (unsigned int *) &data[0]);
- break;
-
- default:
- printk("Insn Config : Config Parameter Wrong\n");
-
- }
-
- if (i_ReturnValue >= 0)
- i_ReturnValue = insn->n;
- return i_ReturnValue;
-}
-
-/*
-+----------------------------------------------------------------------------+
| Function Name : _INT_ i_APCI1710_InitCounter |
| (unsigned char_ b_BoardHandle, |
| unsigned char_ b_ModulNbr, |
| wrong. |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_InitCounter(struct comedi_device *dev,
- unsigned char b_ModulNbr,
- unsigned char b_CounterRange,
- unsigned char b_FirstCounterModus,
- unsigned char b_FirstCounterOption,
- unsigned char b_SecondCounterModus, unsigned char b_SecondCounterOption)
+static int i_APCI1710_InitCounter(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_CounterRange,
+ unsigned char b_FirstCounterModus,
+ unsigned char b_FirstCounterOption,
+ unsigned char b_SecondCounterModus,
+ unsigned char b_SecondCounterOption)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -2: No counter module found |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_CounterAutoTest(struct comedi_device *dev, unsigned char *pb_TestStatus)
+static int i_APCI1710_CounterAutoTest(struct comedi_device *dev,
+ unsigned char *pb_TestStatus)
{
struct addi_private *devpriv = dev->private;
unsigned char b_ModulCpt = 0;
| See function "i_APCI1710_SetBoardIntRoutineX" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_InitIndex(struct comedi_device *dev,
- unsigned char b_ModulNbr,
- unsigned char b_ReferenceAction,
- unsigned char b_IndexOperation, unsigned char b_AutoMode, unsigned char b_InterruptEnable)
+static int i_APCI1710_InitIndex(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_ReferenceAction,
+ unsigned char b_IndexOperation,
+ unsigned char b_AutoMode,
+ unsigned char b_InterruptEnable)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -4: Reference level parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_InitReference(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_ReferenceLevel)
+static int i_APCI1710_InitReference(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_ReferenceLevel)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -5: External strobe level parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_InitExternalStrobe(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_ExternalStrobe, unsigned char b_ExternalStrobeLevel)
+static int i_APCI1710_InitExternalStrobe(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_ExternalStrobe,
+ unsigned char b_ExternalStrobeLevel)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_InitCompareLogic(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned int ui_CompareValue)
+static int i_APCI1710_InitCompareLogic(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned int ui_CompareValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -7: 40MHz quartz not on board |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_InitFrequencyMeasurement(struct comedi_device *dev,
- unsigned char b_ModulNbr,
- unsigned char b_PCIInputClock,
- unsigned char b_TimingUnity,
- unsigned int ul_TimingInterval, unsigned int *pul_RealTimingInterval)
+static int i_APCI1710_InitFrequencyMeasurement(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_PCIInputClock,
+ unsigned char b_TimingUnity,
+ unsigned int ul_TimingInterval,
+ unsigned int *pul_RealTimingInterval)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
return i_ReturnValue;
}
-/*########################################################################### */
-
- /* INSN BITS */
-/*########################################################################### */
-
/*
-+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnBitsINCCPT(struct comedi_device *dev,struct comedi_subdevice *s,
-struct comedi_insn *insn,unsigned int *data) |
-+----------------------------------------------------------------------------+
-| Task : Set & Clear Functions for INC_CPT |
-+----------------------------------------------------------------------------+
-| Input Parameters :
-+----------------------------------------------------------------------------+
-| Output Parameters : - |
-+----------------------------------------------------------------------------+
-| Return Value :
-+----------------------------------------------------------------------------+
-*/
-
-int i_APCI1710_InsnBitsINCCPT(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+ * Configuration function for INC_CPT
+ */
+static int i_APCI1710_InsnConfigINCCPT(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_BitsType;
+ unsigned int ui_ConfigType;
int i_ReturnValue = 0;
- ui_BitsType = CR_CHAN(insn->chanspec);
- devpriv->tsk_Current = current; /* Save the current process task structure */
+ ui_ConfigType = CR_CHAN(insn->chanspec);
- switch (ui_BitsType) {
- case APCI1710_INCCPT_CLEARCOUNTERVALUE:
- i_ReturnValue = i_APCI1710_ClearCounterValue(dev,
- (unsigned char) CR_AREF(insn->chanspec));
+ printk("\nINC_CPT");
+
+ devpriv->tsk_Current = current; /* Save the current process task structure */
+ switch (ui_ConfigType) {
+ case APCI1710_INCCPT_INITCOUNTER:
+ i_ReturnValue = i_APCI1710_InitCounter(dev,
+ CR_AREF(insn->chanspec),
+ (unsigned char) data[0],
+ (unsigned char) data[1],
+ (unsigned char) data[2], (unsigned char) data[3], (unsigned char) data[4]);
break;
- case APCI1710_INCCPT_CLEARALLCOUNTERVALUE:
- i_ReturnValue = i_APCI1710_ClearAllCounterValue(dev);
+ case APCI1710_INCCPT_COUNTERAUTOTEST:
+ i_ReturnValue = i_APCI1710_CounterAutoTest(dev,
+ (unsigned char *) &data[0]);
break;
- case APCI1710_INCCPT_SETINPUTFILTER:
- i_ReturnValue = i_APCI1710_SetInputFilter(dev,
- (unsigned char) CR_AREF(insn->chanspec),
- (unsigned char) data[0], (unsigned char) data[1]);
+ case APCI1710_INCCPT_INITINDEX:
+ i_ReturnValue = i_APCI1710_InitIndex(dev,
+ CR_AREF(insn->chanspec),
+ (unsigned char) data[0],
+ (unsigned char) data[1], (unsigned char) data[2], (unsigned char) data[3]);
break;
- case APCI1710_INCCPT_LATCHCOUNTER:
- i_ReturnValue = i_APCI1710_LatchCounter(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char) data[0]);
+ case APCI1710_INCCPT_INITREFERENCE:
+ i_ReturnValue = i_APCI1710_InitReference(dev,
+ CR_AREF(insn->chanspec), (unsigned char) data[0]);
break;
- case APCI1710_INCCPT_SETINDEXANDREFERENCESOURCE:
- i_ReturnValue = i_APCI1710_SetIndexAndReferenceSource(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char) data[0]);
+ case APCI1710_INCCPT_INITEXTERNALSTROBE:
+ i_ReturnValue = i_APCI1710_InitExternalStrobe(dev,
+ CR_AREF(insn->chanspec),
+ (unsigned char) data[0], (unsigned char) data[1]);
break;
- case APCI1710_INCCPT_SETDIGITALCHLON:
- i_ReturnValue = i_APCI1710_SetDigitalChlOn(dev,
- (unsigned char) CR_AREF(insn->chanspec));
+ case APCI1710_INCCPT_INITCOMPARELOGIC:
+ i_ReturnValue = i_APCI1710_InitCompareLogic(dev,
+ CR_AREF(insn->chanspec), (unsigned int) data[0]);
break;
- case APCI1710_INCCPT_SETDIGITALCHLOFF:
- i_ReturnValue = i_APCI1710_SetDigitalChlOff(dev,
- (unsigned char) CR_AREF(insn->chanspec));
+ case APCI1710_INCCPT_INITFREQUENCYMEASUREMENT:
+ i_ReturnValue = i_APCI1710_InitFrequencyMeasurement(dev,
+ CR_AREF(insn->chanspec),
+ (unsigned char) data[0],
+ (unsigned char) data[1], (unsigned int) data[2], (unsigned int *) &data[0]);
break;
default:
- printk("Bits Config Parameter Wrong\n");
+ printk("Insn Config : Config Parameter Wrong\n");
+
}
if (i_ReturnValue >= 0)
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_ClearCounterValue(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_ClearCounterValue(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -2: No counter module found |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_ClearAllCounterValue(struct comedi_device *dev)
+static int i_APCI1710_ClearAllCounterValue(struct comedi_device *dev)
{
struct addi_private *devpriv = dev->private;
unsigned char b_ModulCpt = 0;
| -6: 40MHz quartz not on board |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_SetInputFilter(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_PCIInputClock, unsigned char b_Filter)
+static int i_APCI1710_SetInputFilter(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_PCIInputClock,
+ unsigned char b_Filter)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -4: The selected latch register parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_LatchCounter(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_LatchReg)
+static int i_APCI1710_LatchCounter(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_LatchReg)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -4: The source selection is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_SetIndexAndReferenceSource(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_SourceSelection)
+static int i_APCI1710_SetIndexAndReferenceSource(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_SourceSelection)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_SetDigitalChlOn(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_SetDigitalChlOn(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_SetDigitalChlOff(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_SetDigitalChlOff(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
return i_ReturnValue;
}
-/*########################################################################### */
-
- /* INSN WRITE */
-/*########################################################################### */
-
/*
-+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev,struct comedi_subdevice *s,
-struct comedi_insn *insn,unsigned int *data) |
-+----------------------------------------------------------------------------+
-| Task : Enable Disable functions for INC_CPT |
-+----------------------------------------------------------------------------+
-| Input Parameters :
-+----------------------------------------------------------------------------+
-| Output Parameters : - |
-+----------------------------------------------------------------------------+
-| Return Value :
-+----------------------------------------------------------------------------+
-*/
-int i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+ * Set & Clear Functions for INC_CPT
+ */
+static int i_APCI1710_InsnBitsINCCPT(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_WriteType;
+ unsigned int ui_BitsType;
int i_ReturnValue = 0;
- ui_WriteType = CR_CHAN(insn->chanspec);
+ ui_BitsType = CR_CHAN(insn->chanspec);
devpriv->tsk_Current = current; /* Save the current process task structure */
- switch (ui_WriteType) {
- case APCI1710_INCCPT_ENABLELATCHINTERRUPT:
- i_ReturnValue = i_APCI1710_EnableLatchInterrupt(dev,
+ switch (ui_BitsType) {
+ case APCI1710_INCCPT_CLEARCOUNTERVALUE:
+ i_ReturnValue = i_APCI1710_ClearCounterValue(dev,
(unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_DISABLELATCHINTERRUPT:
- i_ReturnValue = i_APCI1710_DisableLatchInterrupt(dev,
- (unsigned char) CR_AREF(insn->chanspec));
+ case APCI1710_INCCPT_CLEARALLCOUNTERVALUE:
+ i_ReturnValue = i_APCI1710_ClearAllCounterValue(dev);
break;
- case APCI1710_INCCPT_WRITE16BITCOUNTERVALUE:
- i_ReturnValue = i_APCI1710_Write16BitCounterValue(dev,
+ case APCI1710_INCCPT_SETINPUTFILTER:
+ i_ReturnValue = i_APCI1710_SetInputFilter(dev,
(unsigned char) CR_AREF(insn->chanspec),
- (unsigned char) data[0], (unsigned int) data[1]);
- break;
-
- case APCI1710_INCCPT_WRITE32BITCOUNTERVALUE:
- i_ReturnValue = i_APCI1710_Write32BitCounterValue(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned int) data[0]);
-
- break;
-
- case APCI1710_INCCPT_ENABLEINDEX:
- i_APCI1710_EnableIndex(dev, (unsigned char) CR_AREF(insn->chanspec));
+ (unsigned char) data[0], (unsigned char) data[1]);
break;
- case APCI1710_INCCPT_DISABLEINDEX:
- i_ReturnValue = i_APCI1710_DisableIndex(dev,
- (unsigned char) CR_AREF(insn->chanspec));
+ case APCI1710_INCCPT_LATCHCOUNTER:
+ i_ReturnValue = i_APCI1710_LatchCounter(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char) data[0]);
break;
- case APCI1710_INCCPT_ENABLECOMPARELOGIC:
- i_ReturnValue = i_APCI1710_EnableCompareLogic(dev,
- (unsigned char) CR_AREF(insn->chanspec));
+ case APCI1710_INCCPT_SETINDEXANDREFERENCESOURCE:
+ i_ReturnValue = i_APCI1710_SetIndexAndReferenceSource(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char) data[0]);
break;
- case APCI1710_INCCPT_DISABLECOMPARELOGIC:
- i_ReturnValue = i_APCI1710_DisableCompareLogic(dev,
+ case APCI1710_INCCPT_SETDIGITALCHLON:
+ i_ReturnValue = i_APCI1710_SetDigitalChlOn(dev,
(unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_ENABLEFREQUENCYMEASUREMENT:
- i_ReturnValue = i_APCI1710_EnableFrequencyMeasurement(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char) data[0]);
- break;
-
- case APCI1710_INCCPT_DISABLEFREQUENCYMEASUREMENT:
- i_ReturnValue = i_APCI1710_DisableFrequencyMeasurement(dev,
+ case APCI1710_INCCPT_SETDIGITALCHLOFF:
+ i_ReturnValue = i_APCI1710_SetDigitalChlOff(dev,
(unsigned char) CR_AREF(insn->chanspec));
break;
default:
- printk("Write Config Parameter Wrong\n");
+ printk("Bits Config Parameter Wrong\n");
}
if (i_ReturnValue >= 0)
| "i_APCI1710_SetBoardIntRoutine" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_EnableLatchInterrupt(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_EnableLatchInterrupt(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_SetBoardIntRoutine" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_DisableLatchInterrupt(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_DisableLatchInterrupt(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -4: The selected 16-Bit counter parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_Write16BitCounterValue(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_SelectedCounter, unsigned int ui_WriteValue)
+static int i_APCI1710_Write16BitCounterValue(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_SelectedCounter,
+ unsigned int ui_WriteValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_Write32BitCounterValue(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned int ul_WriteValue)
+static int i_APCI1710_Write32BitCounterValue(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned int ul_WriteValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitIndex" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_EnableIndex(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_EnableIndex(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitIndex" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_DisableIndex(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_DisableIndex(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| See function "i_APCI1710_SetBoardIntRoutineX" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_EnableCompareLogic(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_EnableCompareLogic(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| See function "i_APCI1710_InitCompareLogic" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_DisableCompareLogic(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_DisableCompareLogic(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -6: Interrupt function not initialised. |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_EnableFrequencyMeasurement(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_InterruptEnable)
+static int i_APCI1710_EnableFrequencyMeasurement(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_InterruptEnable)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| See function "i_APCI1710_InitFrequencyMeasurement" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_DisableFrequencyMeasurement(struct comedi_device *dev, unsigned char b_ModulNbr)
+static int i_APCI1710_DisableFrequencyMeasurement(struct comedi_device *dev,
+ unsigned char b_ModulNbr)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
return i_ReturnValue;
}
-/*########################################################################### */
-
- /* INSN READ */
-
-/*########################################################################### */
-
/*
-+----------------------------------------------------------------------------+
-| Function Name :INT i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev,struct comedi_subdevice *s,
-struct comedi_insn *insn,unsigned int *data) |
-+----------------------------------------------------------------------------+
-| Task : Read and Get functions for INC_CPT |
-+----------------------------------------------------------------------------+
-| Input Parameters :
-+----------------------------------------------------------------------------+
-| Output Parameters : - |
-+----------------------------------------------------------------------------+
-| Return Value :
-+----------------------------------------------------------------------------+
-*/
-int i_APCI1710_InsnReadINCCPT(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+ * Enable Disable functions for INC_CPT
+ */
+static int i_APCI1710_InsnWriteINCCPT(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
{
struct addi_private *devpriv = dev->private;
- unsigned int ui_ReadType;
+ unsigned int ui_WriteType;
int i_ReturnValue = 0;
- ui_ReadType = CR_CHAN(insn->chanspec);
-
+ ui_WriteType = CR_CHAN(insn->chanspec);
devpriv->tsk_Current = current; /* Save the current process task structure */
- switch (ui_ReadType) {
- case APCI1710_INCCPT_READLATCHREGISTERSTATUS:
- i_ReturnValue = i_APCI1710_ReadLatchRegisterStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec),
- (unsigned char) CR_RANGE(insn->chanspec), (unsigned char *) &data[0]);
- break;
- case APCI1710_INCCPT_READLATCHREGISTERVALUE:
- i_ReturnValue = i_APCI1710_ReadLatchRegisterValue(dev,
- (unsigned char) CR_AREF(insn->chanspec),
- (unsigned char) CR_RANGE(insn->chanspec), (unsigned int *) &data[0]);
- printk("Latch Register Value %d\n", data[0]);
- break;
-
- case APCI1710_INCCPT_READ16BITCOUNTERVALUE:
- i_ReturnValue = i_APCI1710_Read16BitCounterValue(dev,
- (unsigned char) CR_AREF(insn->chanspec),
- (unsigned char) CR_RANGE(insn->chanspec), (unsigned int *) &data[0]);
+ switch (ui_WriteType) {
+ case APCI1710_INCCPT_ENABLELATCHINTERRUPT:
+ i_ReturnValue = i_APCI1710_EnableLatchInterrupt(dev,
+ (unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_READ32BITCOUNTERVALUE:
- i_ReturnValue = i_APCI1710_Read32BitCounterValue(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned int *) &data[0]);
+ case APCI1710_INCCPT_DISABLELATCHINTERRUPT:
+ i_ReturnValue = i_APCI1710_DisableLatchInterrupt(dev,
+ (unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_GETINDEXSTATUS:
- i_ReturnValue = i_APCI1710_GetIndexStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ case APCI1710_INCCPT_WRITE16BITCOUNTERVALUE:
+ i_ReturnValue = i_APCI1710_Write16BitCounterValue(dev,
+ (unsigned char) CR_AREF(insn->chanspec),
+ (unsigned char) data[0], (unsigned int) data[1]);
break;
- case APCI1710_INCCPT_GETREFERENCESTATUS:
- i_ReturnValue = i_APCI1710_GetReferenceStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
- break;
+ case APCI1710_INCCPT_WRITE32BITCOUNTERVALUE:
+ i_ReturnValue = i_APCI1710_Write32BitCounterValue(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned int) data[0]);
- case APCI1710_INCCPT_GETUASSTATUS:
- i_ReturnValue = i_APCI1710_GetUASStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
break;
- case APCI1710_INCCPT_GETCBSTATUS:
- i_ReturnValue = i_APCI1710_GetCBStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ case APCI1710_INCCPT_ENABLEINDEX:
+ i_APCI1710_EnableIndex(dev, (unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_GET16BITCBSTATUS:
- i_ReturnValue = i_APCI1710_Get16BitCBStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec),
- (unsigned char *) &data[0], (unsigned char *) &data[1]);
+ case APCI1710_INCCPT_DISABLEINDEX:
+ i_ReturnValue = i_APCI1710_DisableIndex(dev,
+ (unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_GETUDSTATUS:
- i_ReturnValue = i_APCI1710_GetUDStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
-
+ case APCI1710_INCCPT_ENABLECOMPARELOGIC:
+ i_ReturnValue = i_APCI1710_EnableCompareLogic(dev,
+ (unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_GETINTERRUPTUDLATCHEDSTATUS:
- i_ReturnValue = i_APCI1710_GetInterruptUDLatchedStatus(dev,
- (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ case APCI1710_INCCPT_DISABLECOMPARELOGIC:
+ i_ReturnValue = i_APCI1710_DisableCompareLogic(dev,
+ (unsigned char) CR_AREF(insn->chanspec));
break;
- case APCI1710_INCCPT_READFREQUENCYMEASUREMENT:
- i_ReturnValue = i_APCI1710_ReadFrequencyMeasurement(dev,
- (unsigned char) CR_AREF(insn->chanspec),
- (unsigned char *) &data[0],
- (unsigned char *) &data[1], (unsigned int *) &data[2]);
+ case APCI1710_INCCPT_ENABLEFREQUENCYMEASUREMENT:
+ i_ReturnValue = i_APCI1710_EnableFrequencyMeasurement(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char) data[0]);
break;
- case APCI1710_INCCPT_READINTERRUPT:
- data[0] = devpriv->s_InterruptParameters.
- s_FIFOInterruptParameters[devpriv->
- s_InterruptParameters.ui_Read].b_OldModuleMask;
- data[1] = devpriv->s_InterruptParameters.
- s_FIFOInterruptParameters[devpriv->
- s_InterruptParameters.ui_Read].ul_OldInterruptMask;
- data[2] = devpriv->s_InterruptParameters.
- s_FIFOInterruptParameters[devpriv->
- s_InterruptParameters.ui_Read].ul_OldCounterLatchValue;
-
- /**************************/
- /* Increment the read FIFO */
- /***************************/
-
- devpriv->
- s_InterruptParameters.
- ui_Read = (devpriv->s_InterruptParameters.
- ui_Read + 1) % APCI1710_SAVE_INTERRUPT;
-
+ case APCI1710_INCCPT_DISABLEFREQUENCYMEASUREMENT:
+ i_ReturnValue = i_APCI1710_DisableFrequencyMeasurement(dev,
+ (unsigned char) CR_AREF(insn->chanspec));
break;
default:
- printk("ReadType Parameter wrong\n");
+ printk("Write Config Parameter Wrong\n");
}
if (i_ReturnValue >= 0)
i_ReturnValue = insn->n;
return i_ReturnValue;
-
}
/*
| -4: The selected latch register parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_ReadLatchRegisterStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_LatchReg, unsigned char *pb_LatchStatus)
+static int i_APCI1710_ReadLatchRegisterStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_LatchReg,
+ unsigned char *pb_LatchStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -4: The selected latch register parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_ReadLatchRegisterValue(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_LatchReg, unsigned int *pul_LatchValue)
+static int i_APCI1710_ReadLatchRegisterValue(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_LatchReg,
+ unsigned int *pul_LatchValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -4: The selected 16-Bit counter parameter is wrong |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_Read16BitCounterValue(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char b_SelectedCounter, unsigned int *pui_CounterValue)
+static int i_APCI1710_Read16BitCounterValue(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char b_SelectedCounter,
+ unsigned int *pui_CounterValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_Read32BitCounterValue(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned int *pul_CounterValue)
+static int i_APCI1710_Read32BitCounterValue(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned int *pul_CounterValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitIndex" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_GetIndexStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_IndexStatus)
+static int i_APCI1710_GetIndexStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_IndexStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitReference" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_GetReferenceStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_ReferenceStatus)
+static int i_APCI1710_GetReferenceStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_ReferenceStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_GetUASStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_UASStatus)
+static int i_APCI1710_GetUASStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_UASStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_GetCBStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_CBStatus)
+static int i_APCI1710_GetCBStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_CBStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| -5: Firmware revision error |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_Get16BitCBStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_CBStatusCounter0, unsigned char *pb_CBStatusCounter1)
+static int i_APCI1710_Get16BitCBStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_CBStatusCounter0,
+ unsigned char *pb_CBStatusCounter1)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| "i_APCI1710_InitCounter" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_GetUDStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_UDStatus)
+static int i_APCI1710_GetUDStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_UDStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| See function "i_APCI1710_SetBoardIntRoutineX" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_GetInterruptUDLatchedStatus(struct comedi_device *dev,
- unsigned char b_ModulNbr, unsigned char *pb_UDStatus)
+static int i_APCI1710_GetInterruptUDLatchedStatus(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_UDStatus)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
| See function "i_APCI1710_InitFrequencyMeasurement" |
+----------------------------------------------------------------------------+
*/
-
-int i_APCI1710_ReadFrequencyMeasurement(struct comedi_device *dev,
- unsigned char b_ModulNbr,
- unsigned char *pb_Status, unsigned char *pb_UDStatus, unsigned int *pul_ReadValue)
+static int i_APCI1710_ReadFrequencyMeasurement(struct comedi_device *dev,
+ unsigned char b_ModulNbr,
+ unsigned char *pb_Status,
+ unsigned char *pb_UDStatus,
+ unsigned int *pul_ReadValue)
{
struct addi_private *devpriv = dev->private;
int i_ReturnValue = 0;
return i_ReturnValue;
}
+/*
+ * Read and Get functions for INC_CPT
+ */
+static int i_APCI1710_InsnReadINCCPT(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn,
+ unsigned int *data)
+{
+ struct addi_private *devpriv = dev->private;
+ unsigned int ui_ReadType;
+ int i_ReturnValue = 0;
+
+ ui_ReadType = CR_CHAN(insn->chanspec);
+
+ devpriv->tsk_Current = current; /* Save the current process task structure */
+ switch (ui_ReadType) {
+ case APCI1710_INCCPT_READLATCHREGISTERSTATUS:
+ i_ReturnValue = i_APCI1710_ReadLatchRegisterStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec),
+ (unsigned char) CR_RANGE(insn->chanspec), (unsigned char *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_READLATCHREGISTERVALUE:
+ i_ReturnValue = i_APCI1710_ReadLatchRegisterValue(dev,
+ (unsigned char) CR_AREF(insn->chanspec),
+ (unsigned char) CR_RANGE(insn->chanspec), (unsigned int *) &data[0]);
+ printk("Latch Register Value %d\n", data[0]);
+ break;
+
+ case APCI1710_INCCPT_READ16BITCOUNTERVALUE:
+ i_ReturnValue = i_APCI1710_Read16BitCounterValue(dev,
+ (unsigned char) CR_AREF(insn->chanspec),
+ (unsigned char) CR_RANGE(insn->chanspec), (unsigned int *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_READ32BITCOUNTERVALUE:
+ i_ReturnValue = i_APCI1710_Read32BitCounterValue(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned int *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_GETINDEXSTATUS:
+ i_ReturnValue = i_APCI1710_GetIndexStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_GETREFERENCESTATUS:
+ i_ReturnValue = i_APCI1710_GetReferenceStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_GETUASSTATUS:
+ i_ReturnValue = i_APCI1710_GetUASStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_GETCBSTATUS:
+ i_ReturnValue = i_APCI1710_GetCBStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_GET16BITCBSTATUS:
+ i_ReturnValue = i_APCI1710_Get16BitCBStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec),
+ (unsigned char *) &data[0], (unsigned char *) &data[1]);
+ break;
+
+ case APCI1710_INCCPT_GETUDSTATUS:
+ i_ReturnValue = i_APCI1710_GetUDStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+
+ break;
+
+ case APCI1710_INCCPT_GETINTERRUPTUDLATCHEDSTATUS:
+ i_ReturnValue = i_APCI1710_GetInterruptUDLatchedStatus(dev,
+ (unsigned char) CR_AREF(insn->chanspec), (unsigned char *) &data[0]);
+ break;
+
+ case APCI1710_INCCPT_READFREQUENCYMEASUREMENT:
+ i_ReturnValue = i_APCI1710_ReadFrequencyMeasurement(dev,
+ (unsigned char) CR_AREF(insn->chanspec),
+ (unsigned char *) &data[0],
+ (unsigned char *) &data[1], (unsigned int *) &data[2]);
+ break;
+
+ case APCI1710_INCCPT_READINTERRUPT:
+ data[0] = devpriv->s_InterruptParameters.
+ s_FIFOInterruptParameters[devpriv->
+ s_InterruptParameters.ui_Read].b_OldModuleMask;
+ data[1] = devpriv->s_InterruptParameters.
+ s_FIFOInterruptParameters[devpriv->
+ s_InterruptParameters.ui_Read].ul_OldInterruptMask;
+ data[2] = devpriv->s_InterruptParameters.
+ s_FIFOInterruptParameters[devpriv->
+ s_InterruptParameters.ui_Read].ul_OldCounterLatchValue;
+
+ /**************************/
+ /* Increment the read FIFO */
+ /***************************/
+
+ devpriv->
+ s_InterruptParameters.
+ ui_Read = (devpriv->s_InterruptParameters.
+ ui_Read + 1) % APCI1710_SAVE_INTERRUPT;
+
+ break;
+
+ default:
+ printk("ReadType Parameter wrong\n");
+ }
+
+ if (i_ReturnValue >= 0)
+ i_ReturnValue = insn->n;
+ return i_ReturnValue;
+
+}