/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigDigitalInputEvent |
-| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| (struct comedi_device *dev,struct comedi_subdevice *s, |
+| struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : An event can be generated for each port. |
| The first event is related to the first 8 channels |
| (port 2). An interrupt is generated when one or both |
| events have occurred |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| data[0] :Number of the input port on |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_ConfigDigitalInputEvent(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+INT i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
+ struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{
int i_PatternPolarity = 0, i_PatternTransition = 0, i_PatternMask = 0;
int i_MaxChannel = 0, i_Count = 0, i_EventMask = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_StartStopInputEvent |
-| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| (struct comedi_device *dev,struct comedi_subdevice *s, |
+| struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Allows or disallows a port event |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_Channel : Channel number to read |
-| lsampl_t *data : Data Pointer to read status |
+| unsigned int *data : Data Pointer to read status |
data[0] :0 Start input event
1 Stop input event
data[1] :No of port (1 or 2)
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_StartStopInputEvent(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
int i_Event1InterruptStatus = 0, i_Event2InterruptStatus =
0, i_RegValue;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_Initialisation |
-| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| (struct comedi_device *dev,struct comedi_subdevice *s, |
+| struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_Channel : Channel number to read |
-| lsampl_t *data : Data Pointer to read status |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_Initialisation(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+INT i_APCI1500_Initialisation(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
int i_DummyRead = 0;
/******************/
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ReadMoreDigitalInput |
-| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| (struct comedi_device *dev,struct comedi_subdevice *s, |
+| struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To be Read |
| UINT *data : Data Pointer
data[0] : 0 Read a single channel
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+INT i_APCI1500_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[1];
UINT ui_Mask = 0;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigDigitalOutputErrorInterrupt
- (comedi_device *dev,comedi_subdevice *s comedi_insn
- *insn,lsampl_t *data) |
+ (struct comedi_device *dev,struct comedi_subdevice *s struct comedi_insn
+ *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures the digital output memory and the digital
output error interrupt |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
-| comedi_subdevice *s, :pointer to subdevice structure
- comedi_insn *insn :pointer to insn structure |
+| struct comedi_subdevice *s, :pointer to subdevice structure
+ struct comedi_insn *insn :pointer to insn structure |
| data[0] :1:Memory on |
| 0:Memory off |
data[1] :1 Enable the voltage error interrupt
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ConfigDigitalOutputErrorInterrupt(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_ConfigDigitalOutputErrorInterrupt(struct comedi_device * dev,
+ struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{
devpriv->b_OutputMemoryStatus = data[0];
return insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_WriteDigitalOutput |
-| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| (struct comedi_device *dev,struct comedi_subdevice *s, |
+| struct comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
+| Input Parameters : struct comedi_device *dev : Driver handle |
| UINT ui_NoOfChannels : No Of Channels To Write |
| UINT *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+INT i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
static UINT ui_Temp = 0;
UINT ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigCounterTimerWatchdog(comedi_device
- *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data)|
+ *dev,struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data)|
| |
+----------------------------------------------------------------------------+
| Task : Configures The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| comedi_subdevice *s, :pointer to subdevice structure
- comedi_insn *insn :pointer to insn structure |
-| lsampl_t *data : Data Pointer to read status data[0] : 2 APCI1500_1_8_KHZ
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| struct comedi_subdevice *s, :pointer to subdevice structure
+ struct comedi_insn *insn :pointer to insn structure |
+| unsigned int *data : Data Pointer to read status data[0] : 2 APCI1500_1_8_KHZ
| 1 APCI1500_3_6_KHZ |
| 0 APCI1500_115_KHZ
data[1] : 0 Counter1/Timer1
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ConfigCounterTimerWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
+ struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{
int i_TimerCounterMode, i_MasterConfiguration;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_StartStopTriggerTimerCounterWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data); |
+| (struct comedi_device *dev,struct comedi_subdevice *s,
+ struct comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop or trigger the timer counter or Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| comedi_subdevice *s, :pointer to subdevice structure
- comedi_insn *insn :pointer to insn structure |
-| lsampl_t *data : Data Pointer to read status |
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| struct comedi_subdevice *s, :pointer to subdevice structure
+ struct comedi_insn *insn :pointer to insn structure |
+| unsigned int *data : Data Pointer to read status |
data[0] : 0 Counter1/Timer1
1 Counter2/Timer2
2 Counter3/Watchdog
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_StartStopTriggerTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
+ struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{
int i_CommandAndStatusValue;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ReadCounterTimerWatchdog |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data); |
+| (struct comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn *insn,
+ unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read The Watchdog |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| comedi_subdevice *s, :pointer to subdevice structure
- comedi_insn *insn :pointer to insn structure |
-| lsampl_t *data : Data Pointer to read status |
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| struct comedi_subdevice *s, :pointer to subdevice structure
+ struct comedi_insn *insn :pointer to insn structure |
+| unsigned int *data : Data Pointer to read status |
data[0] : 0 Counter1/Timer1
1 Counter2/Timer2
2 Counter3/Watchdog
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ReadCounterTimerWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
+ struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{
int i_CommandAndStatusValue;
switch (data[0]) {
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ReadInterruptMask |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data); |
+| (struct comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn *insn,
+ unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Read the interrupt mask |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| comedi_subdevice *s, :pointer to subdevice structure
- comedi_insn *insn :pointer to insn structure |
-| lsampl_t *data : Data Pointer to read status |
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| struct comedi_subdevice *s, :pointer to subdevice structure
+ struct comedi_insn *insn :pointer to insn structure |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ReadInterruptMask(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_ReadInterruptMask(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
data[0] = i_InterruptMask;
data[1] = i_InputChannel;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigureInterrupt |
-| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data); |
+| (struct comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn *insn,
+ unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Configures the interrupt registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev : Driver handle |
-| comedi_subdevice *s, :pointer to subdevice structure
- comedi_insn *insn :pointer to insn structure |
-| lsampl_t *data : Data Pointer |
+| Input Parameters : struct comedi_device *dev : Driver handle |
+| struct comedi_subdevice *s, :pointer to subdevice structure
+ struct comedi_insn *insn :pointer to insn structure |
+| unsigned int *data : Data Pointer |
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI1500_ConfigureInterrupt(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+int i_APCI1500_ConfigureInterrupt(struct comedi_device * dev, struct comedi_subdevice * s,
+ struct comedi_insn * insn, unsigned int * data)
{
UINT ui_Status;
int i_RegValue;
static VOID v_APCI1500_Interrupt(int irq, void *d)
{
- comedi_device *dev = d;
+ struct comedi_device *dev = d;
UINT ui_InterruptStatus = 0;
int i_RegValue = 0;
i_InterruptMask = 0;
/*
+----------------------------------------------------------------------------+
-| Function Name : int i_APCI1500_Reset(comedi_device *dev) | |
+| Function Name : int i_APCI1500_Reset(struct comedi_device *dev) | |
+----------------------------------------------------------------------------+
| Task :resets all the registers |
+----------------------------------------------------------------------------+
-| Input Parameters : comedi_device *dev
+| Input Parameters : struct comedi_device *dev
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-INT i_APCI1500_Reset(comedi_device * dev)
+INT i_APCI1500_Reset(struct comedi_device * dev)
{
int i_DummyRead = 0;
i_TimerCounter1Init = 0;