/* max length of device and driver names */
#define COMEDI_NAMELEN 20
- typedef unsigned int lsampl_t;
- typedef unsigned short sampl_t;
-
/* packs and unpacks a channel/range number */
#define CR_PACK(chan, rng, aref) ((((aref)&0x3)<<24) | (((rng)&0xff)<<16) | (chan))
unsigned int flags;
unsigned int n_chan; /* number of channels */
unsigned int *chanlist; /* channel/range list */
- sampl_t *data; /* data list, size depends on subd flags */
+ short *data; /* data list, size depends on subd flags */
unsigned int n; /* number of scans */
unsigned int trigsrc;
unsigned int trigvar;
struct comedi_insn_struct {
unsigned int insn;
unsigned int n;
- lsampl_t *data;
+ unsigned int *data;
unsigned int subdev;
unsigned int chanspec;
unsigned int unused[3];
unsigned int *chanlist; /* channel/range list */
unsigned int chanlist_len;
- sampl_t *data; /* data list, size depends on subd flags */
+ short *data; /* data list, size depends on subd flags */
unsigned int data_len;
};
struct comedi_chaninfo_struct {
unsigned int subdev;
- lsampl_t *maxdata_list;
+ unsigned int *maxdata_list;
unsigned int *flaglist;
unsigned int *rangelist;
unsigned int unused[4];
unsigned int subd_flags;
unsigned int timer_type;
unsigned int len_chanlist;
- lsampl_t maxdata;
+ unsigned int maxdata;
unsigned int flags; /* channel flags */
unsigned int range_type; /* lookup in kernel */
unsigned int settling_time_0;
struct comedi32_chaninfo_struct {
unsigned int subdev;
- compat_uptr_t maxdata_list; /* 32-bit 'lsampl_t *' */
+ compat_uptr_t maxdata_list; /* 32-bit 'unsigned int *' */
compat_uptr_t flaglist; /* 32-bit 'unsigned int *' */
compat_uptr_t rangelist; /* 32-bit 'unsigned int *' */
unsigned int unused[4];
unsigned int stop_arg;
compat_uptr_t chanlist; /* 32-bit 'unsigned int *' */
unsigned int chanlist_len;
- compat_uptr_t data; /* 32-bit 'sampl_t *' */
+ compat_uptr_t data; /* 32-bit 'short *' */
unsigned int data_len;
};
struct comedi32_insn_struct {
unsigned int insn;
unsigned int n;
- compat_uptr_t data; /* 32-bit 'lsampl_t *' */
+ compat_uptr_t data; /* 32-bit 'unsigned int *' */
unsigned int subdev;
unsigned int chanspec;
unsigned int unused[3];
if (s->maxdata || !s->maxdata_list)
return -EINVAL;
if (copy_to_user(it.maxdata_list, s->maxdata_list,
- s->n_chan * sizeof(lsampl_t)))
+ s->n_chan * sizeof(unsigned int)))
return -EFAULT;
}
return 0;
}
-static int parse_insn(comedi_device *dev, comedi_insn *insn, lsampl_t *data,
+static int parse_insn(comedi_device *dev, comedi_insn *insn, unsigned int *data,
void *file);
/*
* COMEDI_INSNLIST
{
comedi_insnlist insnlist;
comedi_insn *insns = NULL;
- lsampl_t *data = NULL;
+ unsigned int *data = NULL;
int i = 0;
int ret = 0;
if (copy_from_user(&insnlist, arg, sizeof(comedi_insnlist)))
return -EFAULT;
- data = kmalloc(sizeof(lsampl_t) * MAX_SAMPLES, GFP_KERNEL);
+ data = kmalloc(sizeof(unsigned int) * MAX_SAMPLES, GFP_KERNEL);
if (!data) {
DPRINTK("kmalloc failed\n");
ret = -ENOMEM;
}
if (insns[i].insn & INSN_MASK_WRITE) {
if (copy_from_user(data, insns[i].data,
- insns[i].n * sizeof(lsampl_t))) {
+ insns[i].n * sizeof(unsigned int))) {
DPRINTK("copy_from_user failed\n");
ret = -EFAULT;
goto error;
goto error;
if (insns[i].insn & INSN_MASK_READ) {
if (copy_to_user(insns[i].data, data,
- insns[i].n * sizeof(lsampl_t))) {
+ insns[i].n * sizeof(unsigned int))) {
DPRINTK("copy_to_user failed\n");
ret = -EFAULT;
goto error;
return i;
}
-static int check_insn_config_length(comedi_insn *insn, lsampl_t *data)
+static int check_insn_config_length(comedi_insn *insn, unsigned int *data)
{
if (insn->n < 1)
return -EINVAL;
return -EINVAL;
}
-static int parse_insn(comedi_device *dev, comedi_insn *insn, lsampl_t *data,
+static int parse_insn(comedi_device *dev, comedi_insn *insn, unsigned int *data,
void *file)
{
comedi_subdevice *s;
}
} else {
/* a subdevice instruction */
- lsampl_t maxdata;
+ unsigned int maxdata;
if (insn->subdev >= dev->n_subdevices) {
DPRINTK("subdevice %d out of range\n", insn->subdev);
static int do_insn_ioctl(comedi_device *dev, void *arg, void *file)
{
comedi_insn insn;
- lsampl_t *data = NULL;
+ unsigned int *data = NULL;
int ret = 0;
- data = kmalloc(sizeof(lsampl_t) * MAX_SAMPLES, GFP_KERNEL);
+ data = kmalloc(sizeof(unsigned int) * MAX_SAMPLES, GFP_KERNEL);
if (!data) {
ret = -ENOMEM;
goto error;
if (insn.n > MAX_SAMPLES)
insn.n = MAX_SAMPLES;
if (insn.insn & INSN_MASK_WRITE) {
- if (copy_from_user(data, insn.data, insn.n * sizeof(lsampl_t))) {
+ if (copy_from_user(data, insn.data, insn.n * sizeof(unsigned int))) {
ret = -EFAULT;
goto error;
}
if (ret < 0)
goto error;
if (insn.insn & INSN_MASK_READ) {
- if (copy_to_user(insn.data, data, insn.n * sizeof(lsampl_t))) {
+ if (copy_to_user(insn.data, data, insn.n * sizeof(unsigned int))) {
ret = -EFAULT;
goto error;
}
int io_bits;
- lsampl_t maxdata; /* if maxdata==0, use list */
- const lsampl_t *maxdata_list; /* list is channel specific */
+ unsigned int maxdata; /* if maxdata==0, use list */
+ const unsigned int *maxdata_list; /* list is channel specific */
unsigned int flags;
const unsigned int *flaglist;
unsigned int *chanlist; /* driver-owned chanlist (not used) */
int (*insn_read) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
int (*insn_write) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
int (*insn_bits) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
int (*insn_config) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
int (*do_cmd) (comedi_device *, comedi_subdevice *);
int (*do_cmdtest) (comedi_device *, comedi_subdevice *, comedi_cmd *);
unsigned bits);
unsigned comedi_get_subdevice_runflags(comedi_subdevice *s);
int insn_inval(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/* range stuff */
static inline unsigned int bytes_per_sample(const comedi_subdevice *subd)
{
if (subd->subdev_flags & SDF_LSAMPL)
- return sizeof(lsampl_t);
+ return sizeof(unsigned int);
else
- return sizeof(sampl_t);
+ return sizeof(short);
}
/* must be used in attach to set dev->hw_dev if you wish to dma directly
}
}
-int comedi_buf_put(comedi_async *async, sampl_t x);
-int comedi_buf_get(comedi_async *async, sampl_t *x);
+int comedi_buf_put(comedi_async *async, short x);
+int comedi_buf_get(comedi_async *async, short *x);
unsigned int comedi_buf_write_n_available(comedi_async *async);
unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes);
int comedi_trigger(void *dev, unsigned int subdev, comedi_trig *it);
int __comedi_trigger(void *dev, unsigned int subdev, comedi_trig *it);
int comedi_data_write(void *dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t data);
+ unsigned int range, unsigned int aref, unsigned int data);
int comedi_data_read(void *dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t *data);
+ unsigned int range, unsigned int aref, unsigned int *data);
int comedi_data_read_hint(void *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref);
int comedi_data_read_delayed(void *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref,
- lsampl_t *data, unsigned int nano_sec);
+ unsigned int *data, unsigned int nano_sec);
int comedi_dio_config(void *dev, unsigned int subdev, unsigned int chan,
unsigned int io);
int comedi_dio_read(void *dev, unsigned int subdev, unsigned int chan,
int comedi_get_subdevice_type(void *dev, unsigned int subdevice);
int comedi_find_subdevice_by_type(void *dev, int type, unsigned int subd);
int comedi_get_n_channels(void *dev, unsigned int subdevice);
-lsampl_t comedi_get_maxdata(void *dev, unsigned int subdevice, unsigned
+unsigned int comedi_get_maxdata(void *dev, unsigned int subdevice, unsigned
int chan);
int comedi_get_n_ranges(void *dev, unsigned int subdevice, unsigned int
chan);
int comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig *it);
int __comedi_trigger(unsigned int minor, unsigned int subdev, comedi_trig *it);
int comedi_data_write(unsigned int dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t data);
+ unsigned int range, unsigned int aref, unsigned int data);
int comedi_data_read(unsigned int dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t *data);
+ unsigned int range, unsigned int aref, unsigned int *data);
int comedi_dio_config(unsigned int dev, unsigned int subdev, unsigned int chan,
unsigned int io);
int comedi_dio_read(unsigned int dev, unsigned int subdev, unsigned int chan,
int comedi_find_subdevice_by_type(unsigned int minor, int type,
unsigned int subd);
int comedi_get_n_channels(unsigned int minor, unsigned int subdevice);
-lsampl_t comedi_get_maxdata(unsigned int minor, unsigned int subdevice, unsigned
+unsigned int comedi_get_maxdata(unsigned int minor, unsigned int subdevice, unsigned
int chan);
int comedi_get_n_ranges(unsigned int minor, unsigned int subdevice, unsigned int
chan);
static int postconfig(comedi_device *dev);
static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static void *comedi_recognize(comedi_driver * driv, const char *name);
static void comedi_report_boards(comedi_driver *driv);
static int poll_invalid(comedi_device *dev, comedi_subdevice *s);
}
int insn_inval(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
return -EINVAL;
}
static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
comedi_insn new_insn;
int ret;
unsigned chan = CR_CHAN(insn->chanspec);
const unsigned base_bitfield_channel =
(chan < channels_per_bitfield) ? 0 : chan;
- lsampl_t new_data[2];
+ unsigned int new_data[2];
memset(new_data, 0, sizeof(new_data));
memset(&new_insn, 0, sizeof(new_insn));
new_insn.insn = INSN_BITS;
return num_bytes;
}
-int comedi_buf_get(comedi_async *async, sampl_t *x)
+int comedi_buf_get(comedi_async *async, short *x)
{
unsigned int n = comedi_buf_read_n_available(async);
- if (n < sizeof(sampl_t))
+ if (n < sizeof(short))
return 0;
- comedi_buf_read_alloc(async, sizeof(sampl_t));
- *x = *(sampl_t *) (async->prealloc_buf + async->buf_read_ptr);
- comedi_buf_read_free(async, sizeof(sampl_t));
+ comedi_buf_read_alloc(async, sizeof(short));
+ *x = *(short *) (async->prealloc_buf + async->buf_read_ptr);
+ comedi_buf_read_free(async, sizeof(short));
return 1;
}
-int comedi_buf_put(comedi_async *async, sampl_t x)
+int comedi_buf_put(comedi_async *async, short x)
{
- unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(sampl_t));
+ unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(short));
- if (n < sizeof(sampl_t)) {
+ if (n < sizeof(short)) {
async->events |= COMEDI_CB_ERROR;
return 0;
}
- *(sampl_t *) (async->prealloc_buf + async->buf_write_ptr) = x;
- comedi_buf_write_free(async, sizeof(sampl_t));
+ *(short *) (async->prealloc_buf + async->buf_write_ptr) = x;
+ comedi_buf_write_free(async, sizeof(short));
return 1;
}
void subdev_8255_interrupt(comedi_device * dev, comedi_subdevice * s)
{
- sampl_t d;
+ short d;
d = CALLBACK_FUNC(0, _8255_DATA, 0, CALLBACK_ARG);
d |= (CALLBACK_FUNC(0, _8255_DATA + 1, 0, CALLBACK_ARG) << 8);
}
static int subdev_8255_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
}
static int subdev_8255_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
unsigned int bits;
COMEDI_INITCLEANUP(driver_acl7225b);
static int acl7225b_do_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int acl7225b_di_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
| BYTE_ b_OutputLevel, |
| BYTE_ b_HardwareGateLevel)
INT i_InsnConfig_InitTimer(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data)
+ comedi_insn *insn,unsigned int *data)
|
+----------------------------------------------------------------------------+
| Task : Configure the Timer (b_TimerNbr) operating mode |
*/
INT i_APCI1710_InsnConfigInitTimer(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
| BYTE_ b_TimerNbr, |
| BYTE_ b_InterruptEnable)
INT i_APCI1710_InsnWriteEnableDisableTimer(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data) |
+ comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable OR Disable the Timer (b_TimerNbr) from selected module |
| (b_ModulNbr). You must calling the |
INT i_APCI1710_InsnWriteEnableDisableTimer(comedi_device * dev,
comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_DummyRead;
| BYTE_ b_ModulNbr, |
| PULONG_ pul_TimerValueArray)
INT i_APCI1710_InsnReadAllTimerValue(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data) |
+ comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the all timer values from selected timer |
| module (b_ModulNbr). |
*/
INT i_APCI1710_InsnReadAllTimerValue(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
INT i_ReturnValue = 0;
BYTE b_ModulNbr, b_ReadType;
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnBitsTimer(comedi_device *dev,
-comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read write functions for Timer |
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnBitsTimer(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
BYTE b_BitsType;
INT i_ReturnValue = 0;
* 82X54 TIMER INISIALISATION FUNCTION
*/
INT i_APCI1710_InsnConfigInitTimer(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteEnableDisableTimer(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
* 82X54 READ FUNCTION
*/
INT i_APCI1710_InsnReadAllTimerValue(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnBitsTimer(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
* 82X54 READ & WRITE FUNCTION
*/
INT i_APCI1710_InsnConfigInitChrono(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
ULONG ul_TimerValue = 0;
| BYTE_ b_CycleMode, |
| BYTE_ b_InterruptEnable)
INT i_APCI1710_InsnWriteEnableDisableChrono(comedi_device *dev,
-comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable the chronometer from selected module |
| (b_ModulNbr). You must calling the |
*/
INT i_APCI1710_InsnWriteEnableDisableChrono(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
BYTE b_ModulNbr, b_CycleMode, b_InterruptEnable, b_Action;
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnReadChrono(comedi_device *dev,comedi_subdevice *s,
-comedi_insn *insn,lsampl_t *data) |
+comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read functions for Timer |
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnReadChrono(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
BYTE b_ReadType;
INT i_ReturnValue = insn->n;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI1710_InsnBitsChronoDigitalIO(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data) |
+ comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Sets the output witch has been passed with the |
| parameter b_Channel. Setting an output means setting an|
*/
INT i_APCI1710_InsnBitsChronoDigitalIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
BYTE b_ModulNbr, b_OutputChannel, b_InputChannel, b_IOType;
* CHRONOMETER INISIALISATION FUNCTION
*/
INT i_APCI1710_InsnConfigInitChrono(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteEnableDisableChrono(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
* CHRONOMETER READ FUNCTION
*/
INT i_APCI1710_InsnReadChrono(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_GetChronoProgressStatus(comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_ChronoStatus);
*/
INT i_APCI1710_InsnBitsChronoDigitalIO(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI1710_InsnConfigDigitalIO(comedi_device *dev, |
-| comedi_subdevice *s,comedi_insn *insn,lsampl_t *data)|
+| comedi_subdevice *s,comedi_insn *insn,unsigned int *data)|
+----------------------------------------------------------------------------+
| Task : Configure the digital I/O operating mode from selected |
| module (b_ModulNbr). You must calling this function be|
*/
INT i_APCI1710_InsnConfigDigitalIO(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
BYTE b_ModulNbr, b_ChannelAMode, b_ChannelBMode;
BYTE b_MemoryOnOff, b_ConfigType;
+----------------------------------------------------------------------------+
|INT i_APCI1710_InsnReadDigitalIOChlValue(comedi_device *dev,comedi_subdevice
-*s, comedi_insn *insn,lsampl_t *data)
+*s, comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
| Task : Read the status from selected digital I/O digital input|
//
// PBYTE_ pb_ChannelStatus)
INT i_APCI1710_InsnReadDigitalIOChlValue(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_StatusReg;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI1710_InsnWriteDigitalIOChlOnOff(comedi_device
-|*dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data)
+|*dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
| Task : Sets or resets the output witch has been passed with the |
// BYTE_ b_ModulNbr,
// BYTE_ b_OutputChannel)
INT i_APCI1710_InsnWriteDigitalIOChlOnOff(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_WriteValue = 0;
+----------------------------------------------------------------------------+
|INT i_APCI1710_InsnBitsDigitalIOPortOnOff(comedi_device *dev,comedi_subdevice
- *s, comedi_insn *insn,lsampl_t *data)
+ *s, comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
| Task : write:
Sets or resets one or several outputs from port. |
// BYTE_ b_ModulNbr,
// BYTE_ b_PortValue)
INT i_APCI1710_InsnBitsDigitalIOPortOnOff(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_WriteValue = 0;
* DIGITAL I/O INISIALISATION FUNCTION
*/
INT i_APCI1710_InsnConfigDigitalIO(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
* INPUT OUTPUT FUNCTIONS
*/
INT i_APCI1710_InsnReadDigitalIOChlValue(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteDigitalIOChlOnOff(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnBitsDigitalIOPortOnOff(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
+----------------------------------------------------------------------------+
| INT i_APCI1710_InsnConfigINCCPT(comedi_device *dev,comedi_subdevice *s,
-comedi_insn *insn,lsampl_t *data)
+comedi_insn *insn,unsigned int *data)
+----------------------------------------------------------------------------+
| Task : Configuration function for INC_CPT |
*/
INT i_APCI1710_InsnConfigINCCPT(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_ConfigType;
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnBitsINCCPT(comedi_device *dev,comedi_subdevice *s,
-comedi_insn *insn,lsampl_t *data) |
+comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Set & Clear Functions for INC_CPT |
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnBitsINCCPT(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_BitsType;
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnWriteINCCPT(comedi_device *dev,comedi_subdevice *s,
-comedi_insn *insn,lsampl_t *data) |
+comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Enable Disable functions for INC_CPT |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnWriteINCCPT(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_WriteType;
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnWriteINCCPT(comedi_device *dev,comedi_subdevice *s,
-comedi_insn *insn,lsampl_t *data) |
+comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read and Get functions for INC_CPT |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnReadINCCPT(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_ReadType;
INT i_ReturnValue = 0;
/************ Main Functions *************/
INT i_APCI1710_InsnConfigINCCPT(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t * data);
+ comedi_insn *insn, unsigned int * data);
INT i_APCI1710_InsnBitsINCCPT(comedi_device *dev, comedi_subdevice * s,
- comedi_insn *insn, lsampl_t * data);
+ comedi_insn *insn, unsigned int * data);
INT i_APCI1710_InsnWriteINCCPT(comedi_device *dev, comedi_subdevice * s,
- comedi_insn *insn, lsampl_t * data);
+ comedi_insn *insn, unsigned int * data);
INT i_APCI1710_InsnReadINCCPT(comedi_device *dev, comedi_subdevice * s,
- comedi_insn *insn, lsampl_t * data);
+ comedi_insn *insn, unsigned int * data);
/*********** Supplementary Functions********/
*/
INT i_APCI1710_InsnConfigInitPulseEncoder(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_IntRegister;
*/
INT i_APCI1710_InsnWriteEnableDisablePulseEncoder(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
BYTE b_ModulNbr;
PBYTE_ pb_Status)
*/
INT i_APCI1710_InsnBitsReadWritePulseEncoder(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_StatusRegister;
}
INT i_APCI1710_InsnReadInterruptPulseEncoder(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->s_InterruptParameters.
INT i_APCI1710_InsnConfigInitPulseEncoder(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteEnableDisablePulseEncoder(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
* READ PULSE ENCODER FUNCTIONS
INT i_APCI1710_InsnReadInterruptPulseEncoder(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
* WRITE PULSE ENCODER FUNCTIONS
INT i_APCI1710_InsnBitsReadWritePulseEncoder(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnConfigPWM(comedi_device *dev,
-comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Pwm Init and Get Pwm Initialisation |
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnConfigPWM(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
BYTE b_ConfigType;
INT i_ReturnValue = 0;
/*
+----------------------------------------------------------------------------+
| Function Name :INT i_APCI1710_InsnWritePWM(comedi_device *dev,
-comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Pwm Enable Disable and Set New Timing |
+----------------------------------------------------------------------------+
*/
INT i_APCI1710_InsnWritePWM(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
BYTE b_WriteType;
INT i_ReturnValue = 0;
*/
INT i_APCI1710_InsnReadGetPWMStatus(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_Status;
}
INT i_APCI1710_InsnBitsReadPWMInterrupt(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->s_InterruptParameters.
s_FIFOInterruptParameters[devpriv->
#define APCI1710_PWM_NEWTIMING 2
INT i_APCI1710_InsnConfigPWM(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InitPWM(comedi_device *dev,
BYTE b_ModulNbr,
PBYTE pb_InterruptEnable, PBYTE pb_Enable);
INT i_APCI1710_InsnWritePWM(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_EnablePWM(comedi_device *dev,
BYTE b_ModulNbr,
INT i_APCI1710_DisablePWM(comedi_device *dev, BYTE b_ModulNbr, BYTE b_PWM);
INT i_APCI1710_InsnReadGetPWMStatus(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnBitsReadPWMInterrupt(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
*/
INT i_APCI1710_InsnConfigInitSSI(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
UINT ui_TimerValue;
| PULONG_ pul_Position, |
| PULONG_ pul_TurnCpt)
INT i_APCI1710_ReadSSIValue(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data) |
+ comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task :
*/
INT i_APCI1710_InsnReadSSIValue(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
BYTE b_Cpt;
*/
INT i_APCI1710_InsnBitsSSIDigitalIO(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_StatusReg;
* SSI INISIALISATION FUNCTION
*/
INT i_APCI1710_InsnConfigInitSSI(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnReadSSIValue(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnBitsSSIDigitalIO(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
*/
INT i_APCI1710_InsnConfigInitTorCounter(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
ULONG ul_TimerValue = 0;
*/
INT i_APCI1710_InsnWriteEnableDisableTorCounter(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_Status;
*/
INT i_APCI1710_InsnReadGetTorCounterInitialisation(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_Status;
*/
INT i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_Status;
*/
INT i_APCI1710_InsnConfigInitTorCounter(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteEnableDisableTorCounter(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
INT i_APCI1710_InsnReadGetTorCounterInitialisation(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
* TOR_COUNTER READ FUNCTION
*/
INT i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
*/
INT i_APCI1710_InsnConfigInitTTLIO(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
BYTE b_ModulNbr;
*/
INT i_APCI1710_InsnBitsReadTTLIO(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_StatusReg;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI1710_InsnReadTTLIOAllPortValue(comedi_device
-*dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+*dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read the status from all digital input ports |
| (port A, port B and port C) from selected TTL |
*/
INT i_APCI1710_InsnReadTTLIOAllPortValue(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_StatusReg;
| BYTE_ b_ModulNbr, |
| BYTE_ b_OutputChannel)
INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data) |
+ comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Sets or resets the output witch has been passed with the |
| parameter b_Channel. Setting an output means setting |
*/
INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = 0;
DWORD dw_StatusReg = 0;
* TTL INISIALISATION FUNCTION
*/
INT i_APCI1710_InsnConfigInitTTLIO(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
* TTL INPUT FUNCTION
*/
INT i_APCI1710_InsnBitsReadTTLIO(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnReadTTLIOAllPortValue(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
* TTL OUTPUT FUNCTIONS
*/
INT i_APCI1710_InsnWriteSetTTLIOChlOnOff(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
+----------------------------------------------------------------------------+
| Function name : |
|INT i_ADDIDATA_InsnReadEeprom(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data)
+ comedi_insn *insn,unsigned int *data)
| |
+----------------------------------------------------------------------------+
| Task : Read 256 words from EEPROM |
| |
+----------------------------------------------------------------------------+
| Input Parameters :(comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data) |
+ comedi_insn *insn,unsigned int *data) |
| |
| |
+----------------------------------------------------------------------------+
*/
static int i_ADDIDATA_InsnReadEeprom(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
WORD w_Data;
WORD w_Address;
int (*i_hwdrv_InsnConfigAnalogInput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnReadAnalogInput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnWriteAnalogInput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnBitsAnalogInput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_CommandTestAnalogInput)(comedi_device *dev,
comedi_subdevice *s,
comedi_cmd *cmd);
int (*i_hwdrv_InsnConfigAnalogOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnWriteAnalogOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnBitsAnalogOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/* Digital Input */
int (*i_hwdrv_InsnConfigDigitalInput) (comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnReadDigitalInput) (comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnWriteDigitalInput) (comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnBitsDigitalInput) (comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/* Digital Output */
int (*i_hwdrv_InsnConfigDigitalOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnWriteDigitalOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnBitsDigitalOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnReadDigitalOutput)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/* TIMER */
int (*i_hwdrv_InsnConfigTimer)(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int (*i_hwdrv_InsnWriteTimer)(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdrv_InsnReadTimer)(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int (*i_hwdrv_InsnBitsTimer)(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/* TTL IO */
int (*i_hwdr_ConfigInitTTLIO)(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdr_ReadTTLIOBits)(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int (*i_hwdr_ReadTTLIOAllPortValue)(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int (*i_hwdr_WriteTTLIOChlOnOff)(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
} boardtype;
//MODULE INFO STRUCTURE
UINT ui_AiTimer1; //Timer constant for Timer1
UINT ui_AiFlags;
UINT ui_AiDataLength;
- sampl_t *AiData; // Pointer to sample data
+ short *AiData; // Pointer to sample data
UINT ui_AiNbrofScans; // number of scans to do
USHORT us_UseDma; // To use Dma or not
BYTE b_DmaDoubleBuffer; // we can use double buffering
UINT ui_DmaActualBuffer; // which buffer is used now
//*UPDATE-0.7.57->0.7.68
//ULONG ul_DmaBufferVirtual[2];// pointers to begin of DMA buffer
- sampl_t *ul_DmaBufferVirtual[2]; // pointers to begin of DMA buffer
+ short *ul_DmaBufferVirtual[2]; // pointers to begin of DMA buffer
ULONG ul_DmaBufferHw[2]; // hw address of DMA buff
UINT ui_DmaBufferSize[2]; // size of dma buffer in bytes
UINT ui_DmaBufferUsesize[2]; // which size we may now used for transfer
static irqreturn_t v_ADDI_Interrupt(int irq, void *d PT_REGS_ARG);
static int i_ADDIDATA_InsnReadEeprom(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_ConfigTimerWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI035_ConfigTimerWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Status = 0;
UINT ui_Command = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_StartStopWriteTimerWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Selected Timer , or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI035_StartStopWriteTimerWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Command = 0;
INT i_Count = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_ReadTimerWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI035_ReadTimerWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Status = 0; // Status register
i_WatchdogNbr = insn->unused[0];
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI035_ConfigAnalogInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Analog Input Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| data[0] : Warning delay value
| |
+----------------------------------------------------------------------------+
*/
INT i_APCI035_ConfigAnalogInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
devpriv->tsk_Current = current;
outl(0x200 | 0, devpriv->iobase + 128 + 0x4);
+----------------------------------------------------------------------------+
| Function Name : int i_APCI035_ReadAnalogInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI035_ReadAnalogInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_CommandRegister = 0;
/******************/
/* TIMER */
/* timer value is passed as u seconds */
INT i_APCI035_ConfigTimerWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI035_StartStopWriteTimerWatchdog(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI035_ReadTimerWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/* Temperature Related Defines (Analog Input Subdevice) */
INT i_APCI035_ConfigAnalogInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI035_ReadAnalogInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/* Interrupt */
static void v_APCI035_Interrupt(int irq, void *d);
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_ConfigDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures the digital input Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| data[0] : 1 Enable Digital Input Interrupt |
*/
INT i_APCI1032_ConfigDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_Read1DigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
| Input Parameters : 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_APCI1032_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
UINT ui_Channel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1032_ReadMoreDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
*/
INT i_APCI1032_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[0];
UINT ui_Mask = 0;
// for di read
INT i_APCI1032_ConfigDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1032_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1032_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1500_ConfigDigitalInputEvent |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| 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 |
| events have occurred |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| 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)
+ comedi_subdevice * s, 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) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Allows or disallows a port event |
+----------------------------------------------------------------------------+
| Input Parameters : 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)
+ 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) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
| Input Parameters : 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)
+ 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) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
*/
INT i_APCI1500_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ 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) |
+ *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 |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
+----------------------------------------------------------------------------+
*/
int i_APCI1500_ConfigDigitalOutputErrorInterrupt(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, 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) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
*/
INT i_APCI1500_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ 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,comedi_subdevice *s,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
+| 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)
+ comedi_subdevice * s, 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); |
+ 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 |
+| 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)
+ comedi_subdevice * s, 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); |
+ 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 |
+| 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)
+ comedi_subdevice * s, 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); |
+ 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI1500_ReadInterruptMask(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ 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); |
+ 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 |
+| unsigned int *data : Data Pointer |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI1500_ConfigureInterrupt(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Status;
int i_RegValue;
/*----------DIGITAL INPUT----------------*/
static int i_APCI1500_Initialisation(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int i_APCI1500_ConfigDigitalInputEvent(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
static int i_APCI1500_StartStopInputEvent(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int i_APCI1500_ReadMoreDigitalInput(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*---------- DIGITAL OUTPUT------------*/
static int i_APCI1500_ConfigDigitalOutputErrorInterrupt(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
static int i_APCI1500_WriteDigitalOutput(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*----------TIMER----------------*/
static int i_APCI1500_ConfigCounterTimerWatchdog(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
static int i_APCI1500_StartStopTriggerTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
static int i_APCI1500_ReadCounterTimerWatchdog(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
static int i_APCI1500_ReadInterruptMask(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*----------INTERRUPT HANDLER------*/
static void v_APCI1500_Interrupt(int irq, void *d);
static int i_APCI1500_ConfigureInterrupt(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*----------RESET---------------*/
static int i_APCI1500_Reset(comedi_device *dev);
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_Read1DigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1516_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
UINT ui_Channel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ReadMoreDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
INT i_APCI1516_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[0];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ConfigDigitalOutput (comedi_device *dev,
- comedi_subdevice *s comedi_insn *insn,lsampl_t *data) |
+ comedi_subdevice *s comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
+----------------------------------------------------------------------------+
*/
int i_APCI1516_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
devpriv->b_OutputMemoryStatus = data[0];
return insn->n;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data) |
+ unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
INT i_APCI1516_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
UINT ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ReadDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data) |
+ unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
INT i_APCI1516_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ConfigWatchdog(comedi_device *dev,
- comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+ comedi_subdevice *s,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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI1516_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
//Disable the watchdog
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_StartStopWriteWatchdog |
| (comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data); |
+ comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop 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 |
+ | unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI1516_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case 0: //stop the watchdog
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1516_ReadWatchdog |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data); |
+ 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI1516_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = inw(devpriv->i_IobaseAddon + APCI1516_WATCHDOG_STATUS) & 0x1;
return insn->n;
//Digital Input
INT i_APCI1516_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1516_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//Digital Output
int i_APCI1516_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1516_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1516_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
int i_APCI1516_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI1516_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI1516_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//reset
INT i_APCI1516_Reset(comedi_device *dev);
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ConfigDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures the digital input Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| data[0] : 1 Enable Digital Input Interrupt |
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_ConfigDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
devpriv->tsk_Current = current;
/*******************************/
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_Read1DigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
| Input Parameters : 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_APCI1564_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
UINT ui_Channel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadMoreDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[0];
UINT ui_Mask = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ConfigDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
UINT ui_NoOfChannel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
UINT ui_NoOfChannel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ConfigTimerCounterWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_ConfigTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
devpriv->tsk_Current = current;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_StartStopWriteTimerCounterWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_StartStopWriteTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
if (devpriv->b_TimerSelectMode == ADDIDATA_WATCHDOG) {
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadTimerCounterWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI1564_ReadTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI1564_ReadInterruptStatus |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task :Reads the interrupt status register |
+----------------------------------------------------------------------------+
*/
int i_APCI1564_ReadInterruptStatus(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
*data = ui_Type;
return insn->n;
//DI
// for di read
INT i_APCI1564_ConfigDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1564_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1564_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//DO
int i_APCI1564_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1564_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI1564_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI1564_ReadInterruptStatus(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
INT i_APCI1564_ConfigTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI1564_StartStopWriteTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int i_APCI1564_ReadTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// INTERRUPT
static VOID v_APCI1564_Interrupt(int irq, void *d);
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task APCI16XX_TTL_INIT (using defaults) : |
| Configure the TTL I/O operating mode from all ports |
*/
int i_APCI16XX_InsnConfigInitTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Command = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read the status from selected TTL digital input |
| (b_InputChannel) |
*/
int i_APCI16XX_InsnBitsReadTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Command = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read the status from all digital input ports |
+----------------------------------------------------------------------------+
*/
int i_APCI16XX_InsnReadTTLIOAllPortValue(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
BYTE b_Command = (BYTE) CR_AREF(insn->chanspec);
INT i_ReturnValue = insn->n;
BYTE b_Cpt = 0;
BYTE b_NumberOfPort = 0;
- lsampl_t *pls_ReadData = data;
+ unsigned int *pls_ReadData = data;
/********************/
/* Test the command */
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Set the state from selected TTL digital output |
| (b_OutputChannel) |
*/
int i_APCI16XX_InsnBitsWriteTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Command = 0;
int i_APCI16XX_InsnConfigInitTTLIO(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
/*
+----------------------------------------------------------------------------+
int i_APCI16XX_InsnBitsReadTTLIO(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int i_APCI16XX_InsnReadTTLIOAllPortValue(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
+----------------------------------------------------------------------------+
int i_APCI16XX_InsnBitsWriteTTLIO(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int i_APCI16XX_Reset(comedi_device *dev);
#endif
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_ConfigDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI2016_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if ((data[0] != 0) && (data[0] != 1)) {
comedi_error(dev,
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI2016_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_NoOfChannel;
UINT ui_Temp, ui_Temp1;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_BitsDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI2016_BitsDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
UINT ui_NoOfChannel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_ConfigWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI2016_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_StartStopWriteWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI2016_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2016_ReadWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI2016_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
udelay(5);
data[0] = inw(devpriv->i_IobaseAddon + APCI2016_WATCHDOG_STATUS) & 0x1;
//DO
int i_APCI2016_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2016_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2016_BitsDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
int i_APCI2016_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2016_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2016_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ConfigDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI2032_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command = 0;
devpriv->tsk_Current = current;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
*/
INT i_APCI2032_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
UINT ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ReadDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
*/
INT i_APCI2032_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
UINT ui_NoOfChannel;
/*
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI2032_ConfigWatchdog(comedi_device
- *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data)|
+ *dev,comedi_subdevice *s,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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI2032_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
//Disable the watchdog
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_StartStopWriteWatchdog |
| (comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data); |
+ comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop 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 |
+ | unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI2032_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case 0: //stop the watchdog
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ReadWatchdog |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data); |
+ 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI2032_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] =
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2032_ReadInterruptStatus |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task :Reads the interrupt status register |
+----------------------------------------------------------------------------+
*/
int i_APCI2032_ReadInterruptStatus(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
*data = ui_Type;
return insn->n;
//DO
int i_APCI2032_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI2032_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI2032_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2032_ReadInterruptStatus(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
INT i_APCI2032_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2032_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2032_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_Read1DigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the digital input |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI2200_Read1DigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue = 0;
UINT ui_Channel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ReadMoreDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Return the status of the Requested digital inputs |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
INT i_APCI2200_ReadMoreDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_PortValue = data[0];
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ConfigDigitalOutput (comedi_device *dev,
- comedi_subdevice *s comedi_insn *insn,lsampl_t *data) |
+ comedi_subdevice *s comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| comedi_subdevice *s, :pointer to subdevice structure
comedi_insn *insn :pointer to insn structure |
+----------------------------------------------------------------------------+
*/
int i_APCI2200_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
devpriv->b_OutputMemoryStatus = data[0];
return insn->n;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data) |
+ unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes port value To the selected port |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
INT i_APCI2200_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
UINT ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ReadDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data) |
+ unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
| 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
INT i_APCI2200_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
/*
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ConfigWatchdog(comedi_device *dev,
- comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+ comedi_subdevice *s,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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI2200_ConfigWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
//Disable the watchdog
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_StartStopWriteWatchdog |
| (comedi_device *dev,comedi_subdevice *s,
- comedi_insn *insn,lsampl_t *data); |
+ comedi_insn *insn,unsigned int *data); |
+----------------------------------------------------------------------------+
| Task : Start / Stop 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 |
+ | unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI2200_StartStopWriteWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case 0: //stop the watchdog
+----------------------------------------------------------------------------+
| Function Name : int i_APCI2200_ReadWatchdog |
| (comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,
- lsampl_t *data); |
+ 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 |
+| unsigned int *data : Data Pointer to read status |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
*/
int i_APCI2200_ReadWatchdog(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] =
inw(devpriv->iobase + APCI2200_WATCHDOG +
//Digital Input
INT i_APCI2200_ReadMoreDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI2200_Read1DigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//Digital Output
int i_APCI2200_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI2200_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI2200_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// TIMER
int i_APCI2200_ConfigWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2200_StartStopWriteWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI2200_ReadWatchdog(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//reset
INT i_APCI2200_Reset(comedi_device *dev);
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnConfigAnalogInput(comedi_device *dev,|
-| comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+| comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Calls card specific function |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
+----------------------------------------------------------------------------+
| Return Value : |
| |
*/
int i_APCI3120_InsnConfigAnalogInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT i;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnReadAnalogInput(comedi_device *dev, |
-| comedi_subdevice *s,comedi_insn *insn, lsampl_t *data) |
+| comedi_subdevice *s,comedi_insn *insn, unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : card specific function |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
+----------------------------------------------------------------------------+
| Return Value : |
| |
*/
int i_APCI3120_InsnReadAnalogInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
USHORT us_ConvertTiming, us_TmpValue, i;
BYTE b_Tmp;
/*int i_APCI3120_InterruptHandleEos(comedi_device *dev)
{
int n_chan,i;
- sampl_t *data;
+ short *data;
comedi_subdevice *s=dev->subdevices+0;
comedi_async *async = s->async;
data=async->data+async->buf_int_ptr;//new samples added from here onwards
{
data[i]=inw(dev->iobase+0);
}
- async->buf_int_count+=n_chan*sizeof(sampl_t);
- async->buf_int_ptr+=n_chan*sizeof(sampl_t);
+ async->buf_int_count+=n_chan*sizeof(short);
+ async->buf_int_ptr+=n_chan*sizeof(short);
comedi_eos(dev,s);
if (s->async->buf_int_ptr>=s->async->data_len) // for buffer rool over
{
}
/*UPDATE-0.7.57->0.7.68
- ptr=(sampl_t *)devpriv->ul_DmaBufferVirtual[devpriv->ui_DmaActualBuffer];
+ ptr=(short *)devpriv->ul_DmaBufferVirtual[devpriv->ui_DmaActualBuffer];
// if there is not enough space left in the buffer to copy all data contained in the DMABufferVirtual
- if(s->async->buf_int_ptr+samplesinbuf*sizeof(sampl_t)>=devpriv->ui_AiDataLength)
+ if(s->async->buf_int_ptr+samplesinbuf*sizeof(short)>=devpriv->ui_AiDataLength)
{
- m=(devpriv->ui_AiDataLength-s->async->buf_int_ptr)/sizeof(sampl_t);
+ m=(devpriv->ui_AiDataLength-s->async->buf_int_ptr)/sizeof(short);
v_APCI3120_InterruptDmaMoveBlock16bit(dev,s,(void *)ptr,((void *)(devpriv->AiData))+s->async->buf_int_ptr,m);
- s->async->buf_int_count+=m*sizeof(sampl_t);
- ptr+=m*sizeof(sampl_t);
+ s->async->buf_int_count+=m*sizeof(short);
+ ptr+=m*sizeof(short);
samplesinbuf-=m;
s->async->buf_int_ptr=0;
comedi_eobuf(dev,s);
{
v_APCI3120_InterruptDmaMoveBlock16bit(dev,s,(void *)ptr,((void *)(devpriv->AiData))+s->async->buf_int_ptr,samplesinbuf);
- s->async->buf_int_count+=samplesinbuf*sizeof(sampl_t);
- s->async->buf_int_ptr+=samplesinbuf*sizeof(sampl_t);
+ s->async->buf_int_count+=samplesinbuf*sizeof(short);
+ s->async->buf_int_ptr+=samplesinbuf*sizeof(short);
if (!(devpriv->ui_AiFlags & TRIG_WAKE_EOS))
{
comedi_bufcheck(dev,s);
/*
+----------------------------------------------------------------------------+
| Function name :void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device|
-|*dev,comedi_subdevice *s,sampl_t *dma,sampl_t *data,int n) |
+|*dev,comedi_subdevice *s,short *dma,short *data,int n) |
| |
+----------------------------------------------------------------------------+
| Task : This function copies the data from DMA buffer to the |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
-| sampl_t *dma |
-| sampl_t *data,int n |
+| short *dma |
+| short *data,int n |
+----------------------------------------------------------------------------+
| Return Value : void |
| |
+----------------------------------------------------------------------------+
*/
-/*void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,comedi_subdevice *s,sampl_t *dma,sampl_t *data,int n)
+/*void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,comedi_subdevice *s,short *dma,short *data,int n)
{
int i,j,m;
}
*/
void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device * dev,
- comedi_subdevice * s, sampl_t * dma_buffer, unsigned int num_samples)
+ comedi_subdevice * s, short * dma_buffer, unsigned int num_samples)
{
devpriv->ui_AiActualScan +=
(s->async->cur_chan + num_samples) / devpriv->ui_AiScanLength;
s->async->cur_chan += num_samples;
s->async->cur_chan %= devpriv->ui_AiScanLength;
- cfc_write_array_to_buffer(s, dma_buffer, num_samples * sizeof(sampl_t));
+ cfc_write_array_to_buffer(s, dma_buffer, num_samples * sizeof(short));
}
/*
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnConfigTimer(comedi_device *dev, |
-| comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+| comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task :Configure Timer 2 |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
| |
| data[0]= TIMER configure as timer |
| = WATCHDOG configure as watchdog |
*/
int i_APCI3120_InsnConfigTimer(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Timervalue2;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnWriteTimer(comedi_device *dev, |
-| comedi_subdevice *s, comedi_insn *insn,lsampl_t *data) |
+| comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : To start and stop the timer |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
| |
| data[0] = 1 (start) |
| data[0] = 0 (stop ) |
*/
int i_APCI3120_InsnWriteTimer(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Timervalue2 = 0;
/*
+----------------------------------------------------------------------------+
| Function name : int i_APCI3120_InsnReadTimer(comedi_device *dev, |
-| comedi_subdevice *s,comedi_insn *insn, lsampl_t *data) |
+| comedi_subdevice *s,comedi_insn *insn, unsigned int *data) |
| |
| |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
| |
+----------------------------------------------------------------------------+
| Return Value : |
+----------------------------------------------------------------------------+
*/
int i_APCI3120_InsnReadTimer(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
BYTE b_Tmp;
USHORT us_TmpValue, us_TmpValue_2, us_StatusValue;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnReadDigitalInput(comedi_device *dev, |
-| comedi_subdevice *s, comedi_insn *insn,lsampl_t *data) |
+| comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
| |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
+----------------------------------------------------------------------------+
| Return Value : |
| |
*/
int i_APCI3120_InsnReadDigitalInput(comedi_device * dev, comedi_subdevice
- * s, comedi_insn * insn, lsampl_t * data)
+ * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Chan, ui_TmpValue;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnBitsDigitalInput(comedi_device *dev, |
-|comedi_subdevice *s, comedi_insn *insn,lsampl_t *data) |
+|comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Reads the value of the Digital input Port i.e.4channels|
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
+----------------------------------------------------------------------------+
| Return Value : |
| |
+----------------------------------------------------------------------------+
*/
int i_APCI3120_InsnBitsDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_TmpValue;
ui_TmpValue = (UINT) inw(devpriv->iobase + APCI3120_RD_STATUS);
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnConfigDigitalOutput(comedi_device |
-| *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+| *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task :Configure the output memory ON or OFF |
| Input Parameters :comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
+----------------------------------------------------------------------------+
| Return Value : |
| |
*/
int i_APCI3120_InsnConfigDigitalOutput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if ((data[0] != 0) && (data[0] != 1)) {
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnBitsDigitalOutput(comedi_device *dev, |
-| comedi_subdevice *s, comedi_insn *insn,lsampl_t *data) |
+| comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : write diatal output port |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
data[0] Value to be written
data[1] :1 Set digital o/p ON
data[1] 2 Set digital o/p OFF with memory ON
*/
int i_APCI3120_InsnBitsDigitalOutput(comedi_device * dev, comedi_subdevice
- * s, comedi_insn * insn, lsampl_t * data)
+ * s, comedi_insn * insn, unsigned int * data)
{
if ((data[0] > this_board->i_DoMaxdata) || (data[0] < 0)) {
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnWriteDigitalOutput(comedi_device *dev,|
-|comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) |
+|comedi_subdevice *s,comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Write digiatl output |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
data[0] Value to be written
data[1] :1 Set digital o/p ON
data[1] 2 Set digital o/p OFF with memory ON
*/
int i_APCI3120_InsnWriteDigitalOutput(comedi_device * dev, comedi_subdevice
- * s, comedi_insn * insn, lsampl_t * data)
+ * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp1;
/*
+----------------------------------------------------------------------------+
| Function name :int i_APCI3120_InsnWriteAnalogOutput(comedi_device *dev,|
-|comedi_subdevice *s, comedi_insn *insn,lsampl_t *data) |
+|comedi_subdevice *s, comedi_insn *insn,unsigned int *data) |
| |
+----------------------------------------------------------------------------+
| Task : Write analog output |
| Input Parameters : comedi_device *dev |
| comedi_subdevice *s |
| comedi_insn *insn |
-| lsampl_t *data |
+| unsigned int *data |
+----------------------------------------------------------------------------+
| Return Value : |
| |
*/
int i_APCI3120_InsnWriteAnalogOutput(comedi_device * dev, comedi_subdevice
- * s, comedi_insn * insn, lsampl_t * data)
+ * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Range, ui_Channel;
USHORT us_TmpValue;
comedi_subdevice *s);
// Interrupt functions
void v_APCI3120_Interrupt(int irq, void *d);
-//UPDATE-0.7.57->0.7.68 void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,comedi_subdevice *s,sampl_t *dma,sampl_t *data,int n);
+//UPDATE-0.7.57->0.7.68 void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,comedi_subdevice *s,short *dma,short *data,int n);
void v_APCI3120_InterruptDmaMoveBlock16bit(comedi_device *dev,
comedi_subdevice *s,
- sampl_t *dma_buffer,
+ short *dma_buffer,
unsigned int num_samples);
int i_APCI3120_InterruptHandleEos(comedi_device *dev);
void v_APCI3120_InterruptDma(int irq, void *d);
// TIMER
int i_APCI3120_InsnConfigTimer(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3120_InsnWriteTimer(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3120_InsnReadTimer(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//DI
// for di read
int i_APCI3120_InsnBitsDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3120_InsnReadDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//DO
//int i_APCI3120_WriteDigitalOutput(comedi_device *dev, BYTE data);
int i_APCI3120_InsnConfigDigitalOutput(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int i_APCI3120_InsnBitsDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3120_InsnWriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//AO
//int i_APCI3120_Write1AnalogValue(comedi_device *dev,UINT ui_Range,UINT ui_Channel,UINT data );
int i_APCI3120_InsnWriteAnalogOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//AI HArdware layer
int i_APCI3120_InsnConfigAnalogInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3120_InsnReadAnalogInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3120_CommandTestAnalogInput(comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
int i_APCI3120_CommandAnalogInput(comedi_device *dev, comedi_subdevice *s);
}
INT i_APCI3200_GetChannelCalibrationValue(comedi_device * dev,
- unsigned int ui_Channel_num, lsampl_t * CJCCurrentSource,
- lsampl_t * ChannelCurrentSource, lsampl_t * ChannelGainFactor)
+ unsigned int ui_Channel_num, unsigned int * CJCCurrentSource,
+ unsigned int * ChannelCurrentSource, unsigned int * ChannelGainFactor)
{
int i_DiffChannel = 0;
int i_Module = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
*/
INT i_APCI3200_ReadDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp = 0;
UINT ui_NoOfChannel = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ConfigDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI3200_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if ((data[0] != 0) && (data[0] != 1)) {
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : writes To the digital Output Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
- | lsampl_t *data : Data Pointer contains |
+ | unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| data[0] :Value to output
data[1] : 0 o/p single channel
+----------------------------------------------------------------------------+
*/
INT i_APCI3200_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp = 0, ui_Temp1 = 0;
UINT ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI3200_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
UINT ui_NoOfChannel;
+----------------------------------------------------------------------------+
| Function Name : INT i_APCI3200_ConfigAnalogInput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Analog Input Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
- | lsampl_t *data : Data Pointer contains |
+ | unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| data[0]
+----------------------------------------------------------------------------+
*/
INT i_APCI3200_ConfigAnalogInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ul_Config = 0, ul_Temp = 0;
//END JK 06.07.04: Management of sevrals boards
//Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68
- memset(s_BoardInfos[dev->minor].ui_ScanValueArray, 0, (7 + 12) * sizeof(lsampl_t)); // 7 is the maximal number of channels
+ memset(s_BoardInfos[dev->minor].ui_ScanValueArray, 0, (7 + 12) * sizeof(unsigned int)); // 7 is the maximal number of channels
//End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68
//BEGIN JK 02.07.04 : This while can't be do, it block the process when using severals boards
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadAnalogInput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI3200_ReadAnalogInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_DummyValue = 0;
int i_ConvertCJCCalibration;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_Read1AnalogInputChannel |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI3200_Read1AnalogInputChannel(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_EOC = 0;
UINT ui_ChannelNo = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCalibrationOffsetValue |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read calibration offset value of the selected channel|
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCalibrationGainValue |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read calibration gain value of the selected channel |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCJCValue |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read CJC value of the selected channel |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCJCValue(comedi_device * dev, lsampl_t * data)
+int i_APCI3200_ReadCJCValue(comedi_device * dev, unsigned int * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCJCCalOffset |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read CJC calibration offset value of the selected channel
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCJCCalOffset(comedi_device * dev, lsampl_t * data)
+int i_APCI3200_ReadCJCCalOffset(comedi_device * dev, unsigned int * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_ReadCJCGainValue |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read CJC calibration gain value
+----------------------------------------------------------------------------+
| |
+----------------------------------------------------------------------------+
*/
-int i_APCI3200_ReadCJCCalGain(comedi_device * dev, lsampl_t * data)
+int i_APCI3200_ReadCJCCalGain(comedi_device * dev, unsigned int * data)
{
UINT ui_EOC = 0;
INT ui_CommandRegister = 0;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_InsnBits_AnalogInput_Test |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Tests the Selected Anlog Input Channel |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
- | lsampl_t *data : Data Pointer contains |
+ | unsigned int *data : Data Pointer contains |
| configuration parameters as below |
|
|
*/
INT i_APCI3200_InsnBits_AnalogInput_Test(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
UINT ui_Configuration = 0;
INT i_Temp; //,i_TimeUnit;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3200_InsnWriteReleaseAnalogInput |
| (comedi_device *dev,comedi_subdevice *s, |
- | comedi_insn *insn,lsampl_t *data) |
+ | comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Resets the channels |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
- | lsampl_t *data : Data Pointer
+ | unsigned int *data : Data Pointer
+----------------------------------------------------------------------------+
| Output Parameters : -- |
*/
INT i_APCI3200_InsnWriteReleaseAnalogInput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
i_APCI3200_Reset(dev);
return insn->n;
s->async->events |= COMEDI_CB_EOS;
// Test if enougth memory is available and allocate it for 7 values
- //n = comedi_buf_write_alloc(s->async, 7*sizeof(lsampl_t));
+ //n = comedi_buf_write_alloc(s->async, 7*sizeof(unsigned int));
n = comedi_buf_write_alloc(s->async,
- (7 + 12) * sizeof(lsampl_t));
+ (7 + 12) * sizeof(unsigned int));
// If not enougth memory available, event is set to Comedi Buffer Errror
- if (n > ((7 + 12) * sizeof(lsampl_t))) {
+ if (n > ((7 + 12) * sizeof(unsigned int))) {
printk("\ncomedi_buf_write_alloc n = %i", n);
s->async->events |= COMEDI_CB_ERROR;
}
// Write all 7 scan values in the comedi buffer
comedi_buf_memcpy_to(s->async, 0,
- (lsampl_t *) s_BoardInfos[dev->minor].
- ui_ScanValueArray, (7 + 12) * sizeof(lsampl_t));
+ (unsigned int *) s_BoardInfos[dev->minor].
+ ui_ScanValueArray, (7 + 12) * sizeof(unsigned int));
// Update comedi buffer pinters indexes
comedi_buf_write_free(s->async,
- (7 + 12) * sizeof(lsampl_t));
+ (7 + 12) * sizeof(unsigned int));
// Send events
comedi_event(dev, s);
UINT ui_InterruptChannelValue[144]; //Buffer
BYTE b_StructInitialized;
//Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68
- lsampl_t ui_ScanValueArray[7 + 12]; // 7 is the maximal number of channels
+ unsigned int ui_ScanValueArray[7 + 12]; // 7 is the maximal number of channels
//End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68
//Begin JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
//AI
INT i_APCI3200_ConfigAnalogInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3200_ReadAnalogInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3200_InsnWriteReleaseAnalogInput(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3200_InsnBits_AnalogInput_Test(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3200_StopCyclicAcquisition(comedi_device *dev, comedi_subdevice *s);
INT i_APCI3200_InterruptHandleEos(comedi_device *dev);
INT i_APCI3200_CommandTestAnalogInput(comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
INT i_APCI3200_CommandAnalogInput(comedi_device *dev, comedi_subdevice *s);
INT i_APCI3200_ReadDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//Interrupt
void v_APCI3200_Interrupt(int irq, void *d);
int i_APCI3200_InterruptHandleEos(comedi_device *dev);
//Reset functions
INT i_APCI3200_Reset(comedi_device *dev);
-int i_APCI3200_ReadCJCCalOffset(comedi_device *dev, lsampl_t *data);
-int i_APCI3200_ReadCJCValue(comedi_device *dev, lsampl_t *data);
+int i_APCI3200_ReadCJCCalOffset(comedi_device *dev, unsigned int *data);
+int i_APCI3200_ReadCJCValue(comedi_device *dev, unsigned int *data);
int i_APCI3200_ReadCalibrationGainValue(comedi_device *dev, UINT *data);
int i_APCI3200_ReadCalibrationOffsetValue(comedi_device *dev, UINT *data);
int i_APCI3200_Read1AnalogInputChannel(comedi_device *dev,
comedi_subdevice *s, comedi_insn *insn,
- lsampl_t *data);
-int i_APCI3200_ReadCJCCalGain(comedi_device *dev, lsampl_t *data);
+ unsigned int *data);
+int i_APCI3200_ReadCJCCalGain(comedi_device *dev, unsigned int *data);
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadDigitalInput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
*/
INT i_APCI3501_ReadDigitalInput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
UINT ui_NoOfChannel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Digital Output Subdevice. |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI3501_ConfigDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if ((data[0] != 0) && (data[0] != 1)) {
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_WriteDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : writes To the digital Output Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI3501_WriteDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp, ui_Temp1;
UINT ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadDigitalOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read value of the selected channel or port |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI3501_ReadDigitalOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
UINT ui_Temp;
UINT ui_NoOfChannel;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigAnalogOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Analog Output Subdevice |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| data[0] : Voltage Mode |
+----------------------------------------------------------------------------+
*/
INT i_APCI3501_ConfigAnalogOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
outl(data[0],
devpriv->iobase + APCI3501_ANALOG_OUTPUT +
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_WriteAnalogOutput |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Writes To the Selected Anlog Output Channel |
+----------------------------------------------------------------------------+
| Input Parameters : comedi_device *dev : Driver handle |
| comedi_subdevice *s : Subdevice Pointer |
| comedi_insn *insn : Insn Structure Pointer |
-| lsampl_t *data : Data Pointer contains |
+| unsigned int *data : Data Pointer contains |
| configuration parameters as below |
| |
| |
+----------------------------------------------------------------------------+
*/
INT i_APCI3501_WriteAnalogOutput(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0, ul_Channel_no, ul_Polarity, ul_DAC_Ready = 0;;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ConfigTimerCounterWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Configures The Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
INT i_APCI3501_ConfigTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
devpriv->tsk_Current = current;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_StartStopWriteTimerCounterWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Start / Stop The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
*/
int i_APCI3501_StartStopWriteTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
ULONG ul_Command1 = 0;
int i_Temp;
+----------------------------------------------------------------------------+
| Function Name : int i_APCI3501_ReadTimerCounterWatchdog |
| (comedi_device *dev,comedi_subdevice *s, |
-| comedi_insn *insn,lsampl_t *data) |
+| comedi_insn *insn,unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read The Selected Timer , Counter or Watchdog |
+----------------------------------------------------------------------------+
*/
int i_APCI3501_ReadTimerCounterWatchdog(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if (devpriv->b_TimerSelectMode == ADDIDATA_WATCHDOG) {
//AO
INT i_APCI3501_ConfigAnalogOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3501_WriteAnalogOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//DI
// for di read
-//INT i_APCI3501_ReadDigitalInput(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data);
+//INT i_APCI3501_ReadDigitalInput(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
INT i_APCI3501_ReadDigitalInput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//DO
int i_APCI3501_ConfigDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3501_WriteDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
INT i_APCI3501_ReadDigitalOutput(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
INT i_APCI3501_ConfigTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
int i_APCI3501_StartStopWriteTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
comedi_insn *insn,
- lsampl_t *data);
+ unsigned int *data);
int i_APCI3501_ReadTimerCounterWatchdog(comedi_device *dev,
comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
//Interrupt
void v_APCI3501_Interrupt(int irq, void *d);
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task Converting mode and convert time selection |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_AnalogInputConfigOperatingMode(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_TimeBase = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task Converting mode and convert time selection |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnConfigAnalogInput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task Read 1 analog input |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnReadAnalogInput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Configuration = (BYTE) CR_RANGE(insn->chanspec);
data[dw_AcquisitionCpt]
=
- (lsampl_t)
+ (unsigned int)
readl((void
*)
(devpriv->
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task Read 1 analog input |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnWriteAnalogOutput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
BYTE b_Range = (BYTE) CR_RANGE(insn->chanspec);
BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec);
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task You must calling this function be |
| for you call any other function witch access of TTL. |
*/
int i_APCI3XXX_InsnConfigInitTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Command = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Write the selected output mask and read the status from|
| all TTL channles |
*/
int i_APCI3XXX_InsnBitsTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_ChannelCpt = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read the status from selected channel |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnReadTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec);
INT i_ReturnValue = insn->n;
- lsampl_t *pls_ReadData = data;
+ unsigned int *pls_ReadData = data;
/************************/
/* Test the buffer size */
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Set the state from TTL output channel |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnWriteTTLIO(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec);
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Reads the value of the specified Digital input channel |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnReadDigitalInput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec);
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Reads the value of the Digital input Port i.e.4channels|
+----------------------------------------------------------------------------+
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnBitsDigitalInput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
DWORD dw_Temp = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Write the selected output mask and read the status from|
| all digital output channles |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnBitsDigitalOutput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_ChannelCpt = 0;
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Set the state from digital output channel |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnWriteDigitalOutput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Channel = CR_CHAN(insn->chanspec);
| (comedi_device *dev, |
| comedi_subdevice *s, |
| comedi_insn *insn, |
-| lsampl_t *data) |
+| unsigned int *data) |
+----------------------------------------------------------------------------+
| Task : Read the state from digital output channel |
+----------------------------------------------------------------------------+
*/
int i_APCI3XXX_InsnReadDigitalOutput(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
INT i_ReturnValue = insn->n;
BYTE b_Channel = CR_CHAN(insn->chanspec);
typedef struct {
int data;
struct pci_dev *pci_dev; /* for a PCI device */
- lsampl_t ao_readback[2]; /* Used for AO readback */
+ unsigned int ao_readback[2]; /* Used for AO readback */
} pci6208_private;
#define devpriv ((pci6208_private *)dev->private)
/*read/write functions*/
static int pci6208_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pci6208_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
//static int pci6208_dio_insn_bits(comedi_device *dev,comedi_subdevice *s,
-// comedi_insn *insn,lsampl_t *data);
+// comedi_insn *insn,unsigned int *data);
//static int pci6208_dio_insn_config(comedi_device *dev,comedi_subdevice *s,
-// comedi_insn *insn,lsampl_t *data);
+// comedi_insn *insn,unsigned int *data);
/*
* Attach is called by the Comedi core to configure the driver
}
static int pci6208_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i = 0, Data_Read;
unsigned short chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int pci6208_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
//static int pci6208_dio_insn_bits(comedi_device *dev,comedi_subdevice *s,
-// comedi_insn *insn,lsampl_t *data)
+// comedi_insn *insn,unsigned int *data)
//{
// if(insn->n!=2)return -EINVAL;
//}
//static int pci6208_dio_insn_config(comedi_device *dev,comedi_subdevice *s,
-// comedi_insn *insn,lsampl_t *data)
+// comedi_insn *insn,unsigned int *data)
//{
// int chan=CR_CHAN(insn->chanspec);
/* Digital IO */
static int adl_pci7432_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci7432_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/* */
}
static int adl_pci7432_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
printk("comedi: pci7432_do_insn_bits called\n");
printk("comedi: data0: %8x data1: %8x\n", data[0], data[1]);
}
static int adl_pci7432_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
printk("comedi: pci7432_di_insn_bits called\n");
printk("comedi: data0: %8x data1: %8x\n", data[0], data[1]);
};
static int adl_pci8164_insn_read_msts(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_read_ssts(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_read_buf0(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_read_buf1(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_write_cmd(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_write_otp(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_write_buf0(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int adl_pci8164_insn_write_buf1(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int adl_pci8164_attach(comedi_device * dev, comedi_devconfig * it)
{
}
static int adl_pci8164_insn_read_msts(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
char *axisname;
}
static int adl_pci8164_insn_read_ssts(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
char *axisname;
}
static int adl_pci8164_insn_read_buf0(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
char *axisname;
}
static int adl_pci8164_insn_read_buf1(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
}
static int adl_pci8164_insn_write_cmd(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int axis, axis_reg;
}
static int adl_pci8164_insn_write_otp(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
}
static int adl_pci8164_insn_write_buf0(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
}
static int adl_pci8164_insn_write_buf1(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int axis, axis_reg;
int is_valid; // Is device valid
- sampl_t ai_bounce_buffer[2 * PCI9111_FIFO_HALF_SIZE];
+ short ai_bounce_buffer[2 * PCI9111_FIFO_HALF_SIZE];
} pci9111_private_data_struct;
#define dev_private ((pci9111_private_data_struct *)dev->private)
static void pci9111_ai_munge(comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int start_chan_index)
{
- unsigned int i, num_samples = num_bytes / sizeof(sampl_t);
- sampl_t *array = data;
+ unsigned int i, num_samples = num_bytes / sizeof(short);
+ short *array = data;
int resolution =
((pci9111_board_struct *) dev->board_ptr)->ai_resolution;
bytes_written =
cfc_write_array_to_buffer(subdevice,
dev_private->ai_bounce_buffer,
- num_samples * sizeof(sampl_t));
+ num_samples * sizeof(short));
} else {
int position = 0;
int to_read;
ai_bounce_buffer +
position,
to_read *
- sizeof(sampl_t));
+ sizeof(short));
} else {
to_read =
dev_private->
position;
bytes_written +=
- sizeof(sampl_t) *
+ sizeof(short) *
to_read;
}
}
dev_private->stop_counter -=
- bytes_written / sizeof(sampl_t);
+ bytes_written / sizeof(short);
}
}
#undef AI_INSN_DEBUG
static int pci9111_ai_insn_read(comedi_device * dev,
- comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * subdevice, comedi_insn * insn, unsigned int * data)
{
int resolution =
((pci9111_board_struct *) dev->board_ptr)->ai_resolution;
static int
pci9111_ao_insn_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i;
//
static int pci9111_ao_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i;
//
static int pci9111_di_insn_bits(comedi_device * dev,
- comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * subdevice, comedi_insn * insn, unsigned int * data)
{
- lsampl_t bits;
+ unsigned int bits;
bits = pci9111_di_get_bits();
data[1] = bits;
//
static int pci9111_do_insn_bits(comedi_device * dev,
- comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * subdevice, comedi_insn * insn, unsigned int * data)
{
- lsampl_t bits;
+ unsigned int bits;
// Only set bits that have been masked
// data[0] = mask
char ai12_startstop; // measure can start/stop on external trigger
unsigned int ai_divisor1, ai_divisor2; // divisors for start of measure on external start
unsigned int ai_data_len;
- sampl_t *ai_data;
- sampl_t ao_data[2]; // data output buffer
+ short *ai_data;
+ short ao_data[2]; // data output buffer
unsigned int ai_scans; // number of scans to do
char dma_doublebuf; // we can use double buffring
unsigned int dma_actbuf; // which buffer is used now
- sampl_t *dmabuf_virt[2]; // pointers to begin of DMA buffer
+ short *dmabuf_virt[2]; // pointers to begin of DMA buffer
unsigned long dmabuf_hw[2]; // hw address of DMA buff
unsigned int dmabuf_size[2]; // size of dma buffer in bytes
unsigned int dmabuf_use_size[2]; // which size we may now used for transfer
==============================================================================
*/
static int pci9118_insn_read_ai(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, timeout;
==============================================================================
*/
static int pci9118_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, chanreg, ch;
==============================================================================
*/
static int pci9118_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, chan;
==============================================================================
*/
static int pci9118_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[1] = inl(dev->iobase + PCI9118_DI) & 0xf;
==============================================================================
*/
static int pci9118_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
}
static unsigned int defragment_dma_buffer(comedi_device * dev,
- comedi_subdevice * s, sampl_t * dma_buffer, unsigned int num_samples)
+ comedi_subdevice * s, short * dma_buffer, unsigned int num_samples)
{
unsigned int i = 0, j = 0;
unsigned int start_pos = devpriv->ai_add_front,
==============================================================================
*/
static unsigned int move_block_from_dma(comedi_device * dev,
- comedi_subdevice * s, sampl_t * dma_buffer, unsigned int num_samples)
+ comedi_subdevice * s, short * dma_buffer, unsigned int num_samples)
{
unsigned int num_bytes;
s->async->cur_chan %= devpriv->ai_n_scanlen;
num_bytes =
cfc_write_array_to_buffer(s, dma_buffer,
- num_samples * sizeof(sampl_t));
- if (num_bytes < num_samples * sizeof(sampl_t))
+ num_samples * sizeof(short));
+ if (num_bytes < num_samples * sizeof(short))
return -1;
return 0;
}
static void pci9118_ai_munge(comedi_device * dev, comedi_subdevice * s,
void *data, unsigned int num_bytes, unsigned int start_chan_index)
{
- unsigned int i, num_samples = num_bytes / sizeof(sampl_t);
- sampl_t *array = data;
+ unsigned int i, num_samples = num_bytes / sizeof(short);
+ short *array = data;
for (i = 0; i < num_samples; i++) {
if (devpriv->usedma)
comedi_subdevice * s, unsigned short int_adstat, unsigned int int_amcc,
unsigned short int_daq)
{
- register sampl_t sampl;
+ register short sampl;
s->async->events = 0;
if (devpriv->ai_n_scanlen < this_board->half_fifo_size) {
devpriv->dmabuf_panic_size[0] =
(this_board->half_fifo_size / devpriv->ai_n_scanlen +
- 1) * devpriv->ai_n_scanlen * sizeof(sampl_t);
+ 1) * devpriv->ai_n_scanlen * sizeof(short);
devpriv->dmabuf_panic_size[1] =
(this_board->half_fifo_size / devpriv->ai_n_scanlen +
- 1) * devpriv->ai_n_scanlen * sizeof(sampl_t);
+ 1) * devpriv->ai_n_scanlen * sizeof(short);
} else {
devpriv->dmabuf_panic_size[0] =
(devpriv->ai_n_scanlen << 1) % devpriv->dmabuf_size[0];
devpriv->dma_doublebuf = 0;
for (i = 0; i < 2; i++) {
for (pages = 4; pages >= 0; pages--)
- if ((devpriv->dmabuf_virt[i] = (sampl_t *)
+ if ((devpriv->dmabuf_virt[i] = (short *)
__get_free_pages(GFP_KERNEL,
pages)))
break;
int differential; /* option 3 of comedi_config */
int last_channel;
int last_range;
- lsampl_t digital_state;
+ unsigned int digital_state;
}adq12b_private;
#define devpriv ((adq12b_private *)dev->private)
num_names: sizeof(adq12b_boards) / sizeof(adq12b_board),
};
-static int adq12b_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data);
-static int adq12b_di_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,lsampl_t *data);
-static int adq12b_do_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,lsampl_t *data);
+static int adq12b_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
+static int adq12b_di_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data);
+static int adq12b_do_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data);
/*
* Attach is called by the Comedi core to configure the driver
* mode.
*/
-static int adq12b_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data)
+static int adq12b_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data)
{
int n, i;
int range, channel;
}
-static int adq12b_di_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,lsampl_t *data)
+static int adq12b_di_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data)
{
/* only bits 0-4 have information about digital inputs */
}
-static int adq12b_do_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,lsampl_t *data)
+static int adq12b_do_insn_bits(comedi_device *dev,comedi_subdevice *s, comedi_insn *insn,unsigned int *data)
{
int channel;
unsigned int *ai_chanlist; // actaul chanlist
unsigned int ai_flags; // flaglist
unsigned int ai_data_len; // len of data buffer
- sampl_t *ai_data; // data buffer
+ short *ai_data; // data buffer
unsigned int ai_timer1; // timers
unsigned int ai_timer2;
- sampl_t ao_data[4]; // data output buffer
+ short ao_data[4]; // data output buffer
unsigned int cnt0_write_wait; // after a write, wait for update of the internal state
} pci1710_private;
==============================================================================
*/
static int pci171x_insn_read_ai(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, timeout;
#ifdef PCI171x_PARANOIDCHECK
==============================================================================
*/
static int pci171x_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, chan, range, ofs;
==============================================================================
*/
static int pci171x_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, chan;
==============================================================================
*/
static int pci171x_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[1] = inw(dev->iobase + PCI171x_DI);
==============================================================================
*/
static int pci171x_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
==============================================================================
*/
static int pci171x_insn_counter_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int msb, lsb, ccntrl;
int i;
==============================================================================
*/
static int pci171x_insn_counter_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
uint msb, lsb, ccntrl, status;
==============================================================================
*/
static int pci171x_insn_counter_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
#ifdef unused
/* This doesn't work like a normal Comedi counter config */
==============================================================================
*/
static int pci1720_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, rangereg, chan;
comedi_subdevice *s = dev->subdevices + 0;
int m;
#ifdef PCI171x_PARANOIDCHECK
- sampl_t sampl;
+ short sampl;
#endif
DPRINTK("adv_pci1710 EDBG: BGN: interrupt_pci1710_every_sample(...)\n");
}
samplesinbuf = this_board->fifo_half_size;
- if (samplesinbuf * sizeof(sampl_t) >= devpriv->ai_data_len) {
- m = devpriv->ai_data_len / sizeof(sampl_t);
+ if (samplesinbuf * sizeof(short) >= devpriv->ai_data_len) {
+ m = devpriv->ai_data_len / sizeof(short);
if (move_block_from_fifo(dev, s, m, 0))
return;
samplesinbuf -= m;
struct pci_dev *pcidev;
unsigned char da_range[8]; // D/A output range for each channel
- sampl_t ao_data[8]; // data output buffer
+ short ao_data[8]; // data output buffer
} pci1723_private;
/*the following macro to make it easy to
}
static int pci1723_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, chan;
analog data output;
*/
static int pci1723_ao_write_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, chan;
chan = CR_CHAN(insn->chanspec);
digital i/o config/query
*/
static int pci1723_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
unsigned int bits;
digital i/o bits read/write
*/
static int pci1723_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
==============================================================================
*/
static int pci_dio_insn_bits_di_b(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
int i;
==============================================================================
*/
static int pci_dio_insn_bits_di_w(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
int i;
==============================================================================
*/
static int pci_dio_insn_bits_do_b(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
int i;
==============================================================================
*/
static int pci_dio_insn_bits_do_w(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
const diosubd_data *d = (const diosubd_data *)s->private;
int i;
==============================================================================
*/
static int pci1760_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[1] = inb(dev->iobase + IMB3);
==============================================================================
*/
static int pci1760_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int ret;
unsigned char omb[4] = {
==============================================================================
*/
static int pci1760_insn_cnt_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int ret, n;
unsigned char omb[4] = {
==============================================================================
*/
static int pci1760_insn_cnt_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int ret;
unsigned char chan = CR_CHAN(insn->chanspec) & 0x07;
#define thisboard ((const board_type *) dev->board_ptr)
typedef struct {
- lsampl_t ao_readback[4];
+ unsigned int ao_readback[4];
} aio12_8_private;
#define devpriv ((aio12_8_private *) dev->private)
static int aio_aio12_8_ai_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
unsigned char control =
}
static int aio_aio12_8_ao_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int val = devpriv->ao_readback[CR_CHAN(insn->chanspec)];
}
static int aio_aio12_8_ao_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
typedef struct {
int data;
struct pci_dev *pci_dev;
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
} aio_iiro_16_private;
#define devpriv ((aio_iiro_16_private *) dev->private)
};
static int aio_iiro_16_dio_insn_bits_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int aio_iiro_16_dio_insn_bits_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int aio_iiro_16_attach(comedi_device * dev, comedi_devconfig * it)
{
}
static int aio_iiro_16_dio_insn_bits_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int aio_iiro_16_dio_insn_bits_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
TRIG_NOW). The scan begins a short time after the hardware interrupt
occurs, subject to interrupt latencies (scan_begin_src == TRIG_EXT,
scan_begin_arg == 0). The value read from the interrupt status register
-is packed into a sampl_t value, one bit per requested channel, in the
+is packed into a short value, one bit per requested channel, in the
order they appear in the channel list.
*/
*/
static int
dio200_subdev_intr_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
dio200_subdev_intr *subpriv = s->private;
*/
if (triggered & subpriv->enabled_isns) {
/* Collect scan data. */
- sampl_t val;
+ short val;
unsigned int n, ch, len;
val = 0;
*/
static int
dio200_subdev_8254_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
dio200_subdev_8254 *subpriv = s->private;
int chan = CR_CHAN(insn->chanspec);
*/
static int
dio200_subdev_8254_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
dio200_subdev_8254 *subpriv = s->private;
int chan = CR_CHAN(insn->chanspec);
*/
static int
dio200_get_clock_src(dio200_subdev_8254 * subpriv, unsigned int counter_number,
- lsampl_t * period_ns)
+ unsigned int * period_ns)
{
unsigned clock_src;
*/
static int
dio200_subdev_8254_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
dio200_subdev_8254 *subpriv = s->private;
int ret;
static void pc236_intr_enable(comedi_device * dev);
static int pc236_intr_check(comedi_device * dev);
static int pc236_intr_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pc236_intr_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int pc236_intr_cmd(comedi_device * dev, comedi_subdevice * s);
* Copied from the comedi_parport driver.
*/
static int pc236_intr_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[1] = 0;
return 2;
static int pc263_request_region(unsigned minor, unsigned long from,
unsigned long extent);
static int pc263_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pc263_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/*
* This function looks for a PCI device matching the requested board name,
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int pc263_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int pc263_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 1)
return -EINVAL;
unsigned long iobase1;
unsigned long state;
spinlock_t ao_spinlock;
- lsampl_t *ao_readback;
- sampl_t *ao_scan_vals;
+ unsigned int *ao_readback;
+ short *ao_scan_vals;
unsigned char *ao_scan_order;
int intr_cpuid;
short intr_running;
* Called from the 'insn_write' function to perform a single write.
*/
static void
-pci224_ao_set_data(comedi_device * dev, int chan, int range, lsampl_t data)
+pci224_ao_set_data(comedi_device * dev, int chan, int range, unsigned int data)
{
unsigned short mangled;
*/
static int
pci224_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan, range;
*/
static int
pci224_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan;
unsigned int bytes_per_scan;
if (cmd->chanlist_len) {
- bytes_per_scan = cmd->chanlist_len * sizeof(sampl_t);
+ bytes_per_scan = cmd->chanlist_len * sizeof(short);
} else {
/* Shouldn't get here! */
- bytes_per_scan = sizeof(sampl_t);
+ bytes_per_scan = sizeof(short);
}
/* Determine number of scans available in buffer. */
num_scans = comedi_buf_read_n_available(s->async) / bytes_per_scan;
unsigned int num_bytes, unsigned int chan_index)
{
comedi_async *async = s->async;
- sampl_t *array = data;
+ short *array = data;
unsigned int length = num_bytes / sizeof(*array);
unsigned int offset;
unsigned int shift;
spinlock_t ao_stop_spinlock; /* Spin lock for stopping AO command */
unsigned long state; /* State flags */
unsigned long iobase1; /* PCI230's I/O space 1 */
- lsampl_t ao_readback[2]; /* Used for AO readback */
+ unsigned int ao_readback[2]; /* Used for AO readback */
unsigned int ai_scan_count; /* Number of analogue input scans
* remaining. */
unsigned int ai_scan_pos; /* Current position within analogue
COMEDI_PCI_INITCLEANUP(driver_amplc_pci230, pci230_pci_table);
static int pci230_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pci230_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pci230_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static void pci230_ct_setup_ns_mode(comedi_device * dev, unsigned int ct,
unsigned int mode, uint64_t ns, unsigned int round);
static void pci230_ns_to_single_timer(unsigned int *ns, unsigned int round);
static void pci230_ai_stop(comedi_device * dev, comedi_subdevice * s);
static void pci230_handle_ai(comedi_device * dev, comedi_subdevice * s);
-static sampl_t pci230_ai_read(comedi_device * dev)
+static short pci230_ai_read(comedi_device * dev)
{
/* Read sample. */
- sampl_t data = (sampl_t) inw(dev->iobase + PCI230_ADCDATA);
+ short data = (short) inw(dev->iobase + PCI230_ADCDATA);
/* PCI230 is 12 bit - stored in upper bits of 16 bit register (lower
* four bits reserved for expansion). */
}
static inline unsigned short pci230_ao_mangle_datum(comedi_device * dev,
- sampl_t datum)
+ short datum)
{
/* If a bipolar range was specified, mangle it (straight binary->twos
* complement). */
return (unsigned short)datum;
}
-static inline void pci230_ao_write_nofifo(comedi_device * dev, sampl_t datum,
+static inline void pci230_ao_write_nofifo(comedi_device * dev, short datum,
unsigned int chan)
{
/* Store unmangled datum to be read back later. */
? PCI230_DACOUT1 : PCI230_DACOUT2));
}
-static inline void pci230_ao_write_fifo(comedi_device * dev, sampl_t datum,
+static inline void pci230_ao_write_fifo(comedi_device * dev, short datum,
unsigned int chan)
{
/* Store unmangled datum to be read back later. */
* COMEDI_SUBD_AI instruction;
*/
static int pci230_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int n, i;
unsigned int chan, range, aref;
* COMEDI_SUBD_AO instructions;
*/
static int pci230_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan, range;
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int pci230_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
static void pci230_handle_ao_nofifo(comedi_device * dev, comedi_subdevice * s)
{
- sampl_t data;
+ short data;
int i, ret;
comedi_async *async = s->async;
comedi_cmd *cmd = &async->cmd;
dacstat = inw(dev->iobase + PCI230_DACCON);
/* Determine number of scans available in buffer. */
- bytes_per_scan = cmd->chanlist_len * sizeof(sampl_t);
+ bytes_per_scan = cmd->chanlist_len * sizeof(short);
num_scans = comedi_buf_read_n_available(async) / bytes_per_scan;
if (!devpriv->ao_continuous) {
/* Fixed number of scans. */
/* Process scans. */
for (n = 0; n < num_scans; n++) {
for (i = 0; i < cmd->chanlist_len; i++) {
- sampl_t datum;
+ short datum;
comedi_buf_get(async, &datum);
pci230_ao_write_fifo(dev, datum,
}
static int c6xdigio_pwmo_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
printk("c6xdigio_pwmo_insn_read %x\n", insn->n);
return insn->n;
}
static int c6xdigio_pwmo_insn_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
//static int c6xdigio_ei_init_insn_read(comedi_device *dev,
// comedi_subdevice *s,
// comedi_insn *insn,
-// lsampl_t *data)
+// unsigned int *data)
//{
// printk("c6xdigio_ei_init_insn_read %x\n", insn->n);
// return insn->n;
//static int c6xdigio_ei_init_insn_write(comedi_device *dev,
// comedi_subdevice *s,
// comedi_insn *insn,
-// lsampl_t *data)
+// unsigned int *data)
//{
// int i;
// int chan = CR_CHAN(insn->chanspec);
//}
static int c6xdigio_ei_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
// printk("c6xdigio_ei__insn_read %x\n", insn->n);
int n;
typedef struct {
struct pcmcia_device *link;
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
unsigned short status1;
unsigned short status2;
} das16cs_private;
static irqreturn_t das16cs_interrupt(int irq, void *d PT_REGS_ARG);
static int das16cs_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16cs_ai_cmd(comedi_device * dev, comedi_subdevice * s);
static int das16cs_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int das16cs_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16cs_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16cs_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16cs_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16cs_timer_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16cs_timer_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int get_prodid(comedi_device * dev, struct pcmcia_device *link)
{
* mode.
*/
static int das16cs_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int to;
}
static int das16cs_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int das16cs_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int das16cs_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int das16cs_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int bits;
}
static int das16cs_timer_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
return -EINVAL;
}
static int das16cs_timer_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
return -EINVAL;
}
volatile unsigned int adc_fifo_bits; // bits to write to interupt/adcfifo register
volatile unsigned int s5933_intcsr_bits; // bits to write to amcc s5933 interrupt control/status register
volatile unsigned int ao_control_bits; // bits to write to ao control and status register
- sampl_t ai_buffer[AI_BUFFER_SIZE];
- sampl_t ao_buffer[AO_BUFFER_SIZE];
+ short ai_buffer[AI_BUFFER_SIZE];
+ short ao_buffer[AO_BUFFER_SIZE];
// divisors of master clock for analog output pacing
unsigned int ao_divisor1;
unsigned int ao_divisor2;
};
static int cb_pcidas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcidas_ao_nofifo_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcidas_ao_fifo_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcidas_ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcidas_ai_cmd(comedi_device * dev, comedi_subdevice * s);
static int cb_pcidas_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static void cb_pcidas_load_counters(comedi_device * dev, unsigned int *ns,
int round_flags);
static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int caldac_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int caldac_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int trimpot_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcidas_trimpot_write(comedi_device * dev, unsigned int channel,
- lsampl_t value);
+ unsigned int value);
static int trimpot_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dac08_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int dac08_write(comedi_device * dev, lsampl_t value);
+ comedi_insn * insn, unsigned int * data);
+static int dac08_write(comedi_device * dev, unsigned int value);
static int dac08_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int caldac_8800_write(comedi_device * dev, unsigned int address,
uint8_t value);
static int trimpot_7376_write(comedi_device * dev, uint8_t value);
* mode.
*/
static int cb_pcidas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i;
unsigned int bits;
return n;
}
-static int ai_config_calibration_source(comedi_device * dev, lsampl_t * data)
+static int ai_config_calibration_source(comedi_device * dev, unsigned int * data)
{
static const int num_calibration_sources = 8;
- lsampl_t source = data[1];
+ unsigned int source = data[1];
if (source >= num_calibration_sources) {
printk("invalid calibration source: %i\n", source);
}
static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int id = data[0];
// analog output insn for pcidas-1000 and 1200 series
static int cb_pcidas_ao_nofifo_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel;
unsigned long flags;
// analog output insn for pcidas-1602 series
static int cb_pcidas_ao_fifo_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel;
unsigned long flags;
// analog output readback insn
// XXX loses track of analog output value back after an analog ouput command is executed
static int cb_pcidas_ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao_value[CR_CHAN(insn->chanspec)];
}
static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
uint8_t nvram_data;
int retval;
}
static int caldac_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
const unsigned int channel = CR_CHAN(insn->chanspec);
}
static int caldac_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->caldac_value[CR_CHAN(insn->chanspec)];
}
/* 1602/16 pregain offset */
-static int dac08_write(comedi_device * dev, lsampl_t value)
+static int dac08_write(comedi_device * dev, unsigned int value)
{
if (devpriv->dac08_value == value)
return 1;
}
static int dac08_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
return dac08_write(dev, data[0]);
}
static int dac08_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->dac08_value;
}
static int cb_pcidas_trimpot_write(comedi_device * dev,
- unsigned int channel, lsampl_t value)
+ unsigned int channel, unsigned int value)
{
if (devpriv->trimpot_value[channel] == value)
return 1;
}
static int trimpot_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
}
static int trimpot_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
num_points = devpriv->ao_count;
num_bytes = cfc_read_array_from_buffer(s, devpriv->ao_buffer,
- num_points * sizeof(sampl_t));
- num_points = num_bytes / sizeof(sampl_t);
+ num_points * sizeof(short));
+ num_points = num_bytes / sizeof(short);
if (cmd->stop_src == TRIG_COUNT) {
devpriv->ao_count -= num_points;
insw(devpriv->adc_fifo + ADCDATA, devpriv->ai_buffer,
num_samples);
cfc_write_array_to_buffer(s, devpriv->ai_buffer,
- num_samples * sizeof(sampl_t));
+ num_samples * sizeof(short));
devpriv->count -= num_samples;
if (async->cmd.stop_src == TRIG_COUNT && devpriv->count == 0) {
async->events |= COMEDI_CB_EOA;
num_points = devpriv->ao_count;
num_bytes =
cfc_read_array_from_buffer(s, devpriv->ao_buffer,
- num_points * sizeof(sampl_t));
- num_points = num_bytes / sizeof(sampl_t);
+ num_points * sizeof(short));
+ num_points = num_bytes / sizeof(short);
if (async->cmd.stop_src == TRIG_COUNT) {
devpriv->ao_count -= num_points;
volatile short ai_cmd_running;
unsigned int ai_fifo_segment_length;
struct ext_clock_info ext_clock;
- sampl_t ao_bounce_buffer[DAC_FIFO_SIZE];
+ short ao_bounce_buffer[DAC_FIFO_SIZE];
} pcidas64_private;
/* inline function that makes it easier to
};
static int ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ai_cmd(comedi_device * dev, comedi_subdevice * s);
static int ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int dio_callback(int dir, int port, int data, unsigned long arg);
static int dio_callback_4020(int dir, int port, int data, unsigned long arg);
static int di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dio_60xx_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dio_60xx_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int calib_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int calib_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ad8402_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static void ad8402_write(comedi_device * dev, unsigned int channel,
unsigned int value);
static int ad8402_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static void check_adc_timing(comedi_device * dev, comedi_cmd * cmd);
static unsigned int get_divisor(unsigned int ns, unsigned int flags);
static void i2c_write(comedi_device * dev, unsigned int address,
}
static int ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int bits = 0, n, i;
unsigned int channel, range, aref;
return n;
}
-static int ai_config_calibration_source(comedi_device * dev, lsampl_t * data)
+static int ai_config_calibration_source(comedi_device * dev, unsigned int * data)
{
- lsampl_t source = data[1];
+ unsigned int source = data[1];
int num_calibration_sources;
if (board(dev)->layout == LAYOUT_60XX)
return 2;
}
-static int ai_config_block_size(comedi_device * dev, lsampl_t * data)
+static int ai_config_block_size(comedi_device * dev, unsigned int * data)
{
int fifo_size;
const hw_fifo_info_t *const fifo = board(dev)->ai_fifo;
return 2;
}
-static int ai_config_master_clock_4020(comedi_device * dev, lsampl_t * data)
+static int ai_config_master_clock_4020(comedi_device * dev, unsigned int * data)
{
unsigned int divisor = data[4];
int retval = 0;
}
// XXX could add support for 60xx series
-static int ai_config_master_clock(comedi_device * dev, lsampl_t * data)
+static int ai_config_master_clock(comedi_device * dev, unsigned int * data)
{
switch (board(dev)->layout) {
}
static int ai_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int id = data[0];
}
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int range = CR_RANGE(insn->chanspec);
}
static int ao_readback_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = priv(dev)->ao_value[CR_CHAN(insn->chanspec)];
}
static int di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t bits;
+ unsigned int bits;
bits = readb(priv(dev)->dio_counter_iobase + DI_REG);
bits &= 0xf;
}
static int do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] &= 0xf;
// zero bits we are going to change
}
static int dio_60xx_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
}
static int dio_60xx_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
}
static int calib_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
}
static int calib_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
/* for pci-das6402/16, channel 0 is analog input gain and channel 1 is offset */
static int ad8402_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
}
static int ad8402_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int channel = CR_CHAN(insn->chanspec);
}
static int eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = read_eeprom(dev, CR_CHAN(insn->chanspec));
static int cb_pcidda_attach(comedi_device * dev, comedi_devconfig * it);
static int cb_pcidda_detach(comedi_device * dev);
-//static int cb_pcidda_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data);
+//static int cb_pcidda_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data);
static int cb_pcidda_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
//static int cb_pcidda_ai_cmd(comedi_device *dev,comedi_subdevice *s);
//static int cb_pcidda_ai_cmdtest(comedi_device *dev,comedi_subdevice *s, comedi_cmd *cmd);
//static int cb_pcidda_ns_to_timer(unsigned int *ns,int round);
#endif
static int cb_pcidda_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int command;
unsigned int channel, range;
struct pci_dev *pci_dev;
/* used for DO readback, curently unused */
- lsampl_t do_readback[4]; /* up to 4 lsampl_t suffice to hold 96 bits for PCI-DIO96 */
+ unsigned int do_readback[4]; /* up to 4 unsigned int suffice to hold 96 bits for PCI-DIO96 */
unsigned long dio_reg_base; // address of port A of the first 8255 chip on board
} pcidio_private;
unsigned long BADR4;
/* Used for AO readback */
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
// Used for DIO
unsigned short int port_a; // copy of BADR4+0
};
static int cb_pcimdas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcimdas_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int cb_pcimdas_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/*
* Attach is called by the Comedi core to configure the driver
* mode.
*/
static int cb_pcimdas_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i;
unsigned int d;
}
static int cb_pcimdas_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int cb_pcimdas_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
#define MAX_AO_READBACK_CHANNELS 6
/* Used for AO readback */
- lsampl_t ao_readback[MAX_AO_READBACK_CHANNELS];
+ unsigned int ao_readback[MAX_AO_READBACK_CHANNELS];
} private;
COMEDI_PCI_INITCLEANUP_NOMODULE(cb_pcimdda_driver, pci_table);
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/*---------------------------------------------------------------------------
HELPER FUNCTION DECLARATIONS
-----------------------------------------------------------------------------*/
/* returns a maxdata value for a given n_bits */
-static inline lsampl_t figure_out_maxdata(int bits)
+static inline unsigned int figure_out_maxdata(int bits)
{
- return (((lsampl_t) 1 << bits) - 1);
+ return (((unsigned int) 1 << bits) - 1);
}
/*
}
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
applications, I would imagine.
*/
static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
for (i = 0; i < insn->n; i++) {
inw(devpriv->registers + chan * 2);
/* should I set data[i] to the result of the actual read on the register
- or the cached lsampl_t in devpriv->ao_readback[]? */
+ or the cached unsigned int in devpriv->ao_readback[]? */
data[i] = devpriv->ao_readback[chan];
}
};
static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int bonding_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
/*
* Attach is called by the Comedi core to configure the driver
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int bonding_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
-#define LSAMPL_BITS (sizeof(lsampl_t)*8)
+#define LSAMPL_BITS (sizeof(unsigned int)*8)
unsigned nchans = LSAMPL_BITS, num_done = 0, i;
if (insn->n != 2)
return -EINVAL;
to this subdevice.. need to shift them to zero position of
course. */
/* Bits corresponding to this subdev. */
- lsampl_t subdevMask = ((1 << bdev->nchans) - 1);
- lsampl_t writeMask, dataBits;
+ unsigned int subdevMask = ((1 << bdev->nchans) - 1);
+ unsigned int writeMask, dataBits;
/* Argh, we have >= LSAMPL_BITS chans.. take all bits */
if (bdev->nchans >= LSAMPL_BITS)
- subdevMask = (lsampl_t) (-1);
+ subdevMask = (unsigned int) (-1);
writeMask = (data[0] >> num_done) & subdevMask;
dataBits = (data[1] >> num_done) & subdevMask;
}
static int bonding_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec), ret, io_bits = s->io_bits;
unsigned int io;
unsigned int num_bytes);
static inline unsigned int cfc_write_to_buffer(comedi_subdevice *subd,
- sampl_t data)
+ short data)
{
return cfc_write_array_to_buffer(subd, &data, sizeof(data));
};
static inline unsigned int cfc_write_long_to_buffer(comedi_subdevice *subd,
- lsampl_t data)
+ unsigned int data)
{
return cfc_write_array_to_buffer(subd, &data, sizeof(data));
};
#define devpriv ((struct parport_private *)(dev->private))
static int parport_insn_a(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
devpriv->a_data &= ~data[0];
}
static int parport_insn_config_a(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
s->io_bits = 0xff;
}
static int parport_insn_b(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
/* should writes be ignored? */
}
static int parport_insn_c(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
data[0] &= 0x0f;
if (data[0]) {
}
static int parport_intr_insn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
if (insn->n < 1)
return -EINVAL;
{
comedi_subdevice *s = dev->read_subdev;
int ret;
- lsampl_t data;
+ unsigned int data;
ret = comedi_data_read(devpriv->device, devpriv->subd,
CR_CHAN(cmd->chanlist[index]),
{
comedi_subdevice *s = dev->write_subdev;
unsigned int num_bytes;
- sampl_t data;
- lsampl_t long_data;
+ short data;
+ unsigned int long_data;
int ret;
if (s->flags & SDF_LSAMPL) {
{
comedi_subdevice *s = dev->read_subdev;
int ret;
- lsampl_t data;
+ unsigned int data;
ret = comedi_dio_bitfield(devpriv->device, devpriv->subd, 0, &data);
if (ret < 0) {
}
static int timer_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
comedi_insn xinsn = *insn;
unsigned int scan_period; /* scan period in usec */
unsigned int convert_period; /* conversion period in usec */
unsigned timer_running:1;
- lsampl_t ao_loopbacks[N_CHANS];
+ unsigned int ao_loopbacks[N_CHANS];
};
#define devpriv ((struct waveform_private *)dev->private)
static int waveform_ai_cmd(comedi_device *dev, comedi_subdevice *s);
static int waveform_ai_cancel(comedi_device *dev, comedi_subdevice *s);
static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int waveform_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
-static sampl_t fake_sawtooth(comedi_device *dev, unsigned int range,
+ comedi_insn *insn, unsigned int *data);
+static short fake_sawtooth(comedi_device *dev, unsigned int range,
unsigned long current_time);
-static sampl_t fake_squarewave(comedi_device *dev, unsigned int range,
+static short fake_squarewave(comedi_device *dev, unsigned int range,
unsigned long current_time);
-static sampl_t fake_flatline(comedi_device *dev, unsigned int range,
+static short fake_flatline(comedi_device *dev, unsigned int range,
unsigned long current_time);
-static sampl_t fake_waveform(comedi_device *dev, unsigned int channel,
+static short fake_waveform(comedi_device *dev, unsigned int channel,
unsigned int range, unsigned long current_time);
/* 1000 nanosec in a microsec */
return 0;
}
-static sampl_t fake_sawtooth(comedi_device *dev, unsigned int range_index,
+static short fake_sawtooth(comedi_device *dev, unsigned int range_index,
unsigned long current_time)
{
comedi_subdevice *s = dev->read_subdev;
return offset + value;
}
-static sampl_t fake_squarewave(comedi_device *dev, unsigned int range_index,
+static short fake_squarewave(comedi_device *dev, unsigned int range_index,
unsigned long current_time)
{
comedi_subdevice *s = dev->read_subdev;
return offset + value;
}
-static sampl_t fake_flatline(comedi_device *dev, unsigned int range_index,
+static short fake_flatline(comedi_device *dev, unsigned int range_index,
unsigned long current_time)
{
return dev->read_subdev->maxdata / 2;
}
/* generates a different waveform depending on what channel is read */
-static sampl_t fake_waveform(comedi_device *dev, unsigned int channel,
+static short fake_waveform(comedi_device *dev, unsigned int channel,
unsigned int range, unsigned long current_time)
{
enum {
}
static int waveform_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i, chan = CR_CHAN(insn->chanspec);
}
static int waveform_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i, chan = CR_CHAN(insn->chanspec);
/* Classic digital IO */
static int contec_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int contec_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
#if 0
static int contec_cmdtest(comedi_device * dev, comedi_subdevice * s,
#endif
static int contec_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
printk("contec_do_insn_bits called\n");
}
static int contec_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
rt_printk("contec_di_insn_bits called\n");
void *daq;
void *plx;
int got_regions;
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
} daqboard2000_private;
#define devpriv ((daqboard2000_private*)dev->private)
}
static int daqboard2000_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
daqboard2000_hw *fpga = devpriv->daq;
}
static int daqboard2000_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int daqboard2000_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* gainlist same as _pgx_ below */
static int das08_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das08_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das08_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das08jr_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das08jr_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das08jr_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das08ao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static void i8254_set_mode_low(unsigned int base, int channel,
unsigned int mode);
#define TIMEOUT 100000
static int das08_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int chan;
}
static int das08_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = 0;
data[1] = DAS08_IP(inb(dev->iobase + DAS08_STATUS));
}
static int das08_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int wbits;
}
static int das08jr_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = 0;
data[1] = inb(dev->iobase + DAS08JR_DIO);
}
static int das08jr_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
// null bits we are going to set
devpriv->do_bits &= ~data[0];
}
static int das08jr_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int lsb, msb;
*
*/
static int das08ao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int lsb, msb;
}
static int das08_counter_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = insn->chanspec;
}
static int das08_counter_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = insn->chanspec;
}
static int das08_counter_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = insn->chanspec;
};
static int das16_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16_cmd_test(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
}
static int das16_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int range;
}
static int das16_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t bits;
+ unsigned int bits;
bits = inb(dev->iobase + DAS16_DIO) & 0xf;
data[1] = bits;
}
static int das16_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t wbits;
+ unsigned int wbits;
// only set bits that have been masked
data[0] &= 0xf;
}
static int das16_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int lsb, msb;
static void das16_ai_munge(comedi_device * dev, comedi_subdevice * s,
void *array, unsigned int num_bytes, unsigned int start_chan_index)
{
- unsigned int i, num_samples = num_bytes / sizeof(sampl_t);
- sampl_t *data = array;
+ unsigned int i, num_samples = num_bytes / sizeof(short);
+ short *data = array;
for (i = 0; i < num_samples; i++) {
data[i] = le16_to_cpu(data[i]);
};
static int das16m1_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16m1_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16m1_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das16m1_cmd_test(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
* needed to keep track of whether new count has been loaded into
* counter yet (loaded by first sample conversion) */
u16 initial_hw_count;
- sampl_t ai_buffer[FIFO_SIZE];
+ short ai_buffer[FIFO_SIZE];
unsigned int do_bits; // saves status of digital output bits
unsigned int divisor1; // divides master clock to obtain conversion speed
unsigned int divisor2; // divides master clock to obtain conversion speed
COMEDI_INITCLEANUP(driver_das16m1);
-static inline sampl_t munge_sample(sampl_t data)
+static inline short munge_sample(short data)
{
return (data >> 4) & 0xfff;
}
}
static int das16m1_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int byte;
}
static int das16m1_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t bits;
+ unsigned int bits;
bits = inb(dev->iobase + DAS16M1_DIO) & 0xf;
data[1] = bits;
}
static int das16m1_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t wbits;
+ unsigned int wbits;
// only set bits that have been masked
data[0] &= 0xf;
return IRQ_HANDLED;
}
-static void munge_sample_array(sampl_t * array, unsigned int num_elements)
+static void munge_sample_array(short * array, unsigned int num_elements)
{
unsigned int i;
insw(dev->iobase, devpriv->ai_buffer, num_samples);
munge_sample_array(devpriv->ai_buffer, num_samples);
cfc_write_array_to_buffer(s, devpriv->ai_buffer,
- num_samples * sizeof(sampl_t));
+ num_samples * sizeof(short));
devpriv->adc_count += num_samples;
if (cmd->stop_src == TRIG_COUNT) {
comedi_cmd * cmd);
static int das1800_ai_do_cmd(comedi_device * dev, comedi_subdevice * s);
static int das1800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das1800_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das1800_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das1800_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das1800_set_frequency(comedi_device * dev);
static unsigned int burst_convert_arg(unsigned int convert_arg, int round_mode);
// figure out how many points to read
num_bytes = devpriv->dma_transfer_size - get_dma_residue(channel);
- num_samples = num_bytes / sizeof(sampl_t);
+ num_samples = num_bytes / sizeof(short);
/* if we only need some of the points */
if (cmd->stop_src == TRIG_COUNT && devpriv->count < num_samples)
static void das1800_handle_fifo_not_empty(comedi_device * dev,
comedi_subdevice * s)
{
- sampl_t dpnt;
+ short dpnt;
int unipolar;
comedi_cmd *cmd = &s->async->cmd;
/* read analog input */
static int das1800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int chan, range, aref, chan_range;
/* writes to an analog output channel */
static int das1800_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
// int range = CR_RANGE(insn->chanspec);
/* reads from digital input channels */
static int das1800_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[1] = inb(dev->iobase + DAS1800_DIGITAL) & 0xf;
/* writes to digital output channels */
static int das1800_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t wbits;
+ unsigned int wbits;
// only set bits that have been masked
data[0] &= (1 << s->n_chan) - 1;
}
#if 0
-static void das6402_ai_fifo_read(comedi_device * dev, sampl_t * data, int n)
+static void das6402_ai_fifo_read(comedi_device * dev, short * data, int n)
{
int i;
outw_p(SCANL, dev->iobase + 2); /* resets the card fifo */
outb_p(IRQ | CONVSRC | BURSTEN | INTE, dev->iobase + 9);
- devpriv->ai_bytes_to_read = it->n * sizeof(sampl_t);
+ devpriv->ai_bytes_to_read = it->n * sizeof(short);
/* um... ignoreirq is a nasty race condition */
devpriv->das6402_ignoreirq = 0;
comedi_cmd * cmd);
static int das800_ai_do_cmd(comedi_device * dev, comedi_subdevice * s);
static int das800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das800_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das800_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int das800_probe(comedi_device * dev);
static int das800_set_frequency(comedi_device * dev);
static irqreturn_t das800_interrupt(int irq, void *d PT_REGS_ARG)
{
short i; /* loop index */
- sampl_t dataPoint = 0;
+ short dataPoint = 0;
comedi_device *dev = d;
comedi_subdevice *s = dev->read_subdev; /* analog input subdevice */
comedi_async *async;
}
static int das800_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int chan;
}
static int das800_di_rbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- lsampl_t bits;
+ unsigned int bits;
bits = inb(dev->iobase + DAS800_STATUS) >> 4;
bits &= 0x7;
}
static int das800_do_wbits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int wbits;
unsigned long irq_flags;
unsigned int ai_scans_left;
/* Used for AO readback */
- lsampl_t ao_readback[4];
+ unsigned int ao_readback[4];
unsigned char dio_config;
} dmm32at_private;
/* prototypes for driver functions below */
static int dmm32at_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dmm32at_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dmm32at_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dmm32at_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dmm32at_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dmm32at_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int dmm32at_ai_cmd(comedi_device * dev, comedi_subdevice * s);
*/
static int dmm32at_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i;
unsigned int d;
}
static int dmm32at_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int dmm32at_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int dmm32at_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned char diobits;
}
static int dmm32at_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned char chanbit;
int chan = CR_CHAN(insn->chanspec);
typedef struct {
const comedi_lrange *dac_range_types[2];
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
} dt2801_private;
#define devpriv ((dt2801_private *)dev->private)
static int dt2801_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2801_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2801_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2801_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2801_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/* These are the low-level routines:
writecommand: write a command to the board
}
static int dt2801_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int d;
int stat;
}
static int dt2801_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao_readback[CR_CHAN(insn->chanspec)];
}
static int dt2801_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
dt2801_writecmd(dev, DT_C_WRITE_DAIM);
dt2801_writedata(dev, CR_CHAN(insn->chanspec));
}
static int dt2801_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int which = 0;
}
static int dt2801_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int which = 0;
COMEDI_INITCLEANUP(driver_dt2811);
static int dt2811_ai_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2811_ao_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2811_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2811_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dt2811_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
enum { card_2811_pgh, card_2811_pgl };
typedef struct {
dac_bipolar_5, dac_bipolar_2_5, dac_unipolar_5
} dac_range[2];
const comedi_lrange *range_type_list[2];
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
} dt2811_private;
#define devpriv ((dt2811_private *)dev->private)
}
static int dt2811_ai_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int timeout = DT2811_TIMEOUT;
#endif
static int dt2811_ao_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan;
}
static int dt2811_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan;
}
static int dt2811_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int dt2811_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
#define DT2814_MAX_SPEED 100000 /* Arbitrary 10 khz limit */
static int dt2814_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i, hi, lo;
int chan;
typedef struct {
const comedi_lrange *range_type_list[8];
- lsampl_t ao_readback[8];
+ unsigned int ao_readback[8];
} dt2815_private;
#define devpriv ((dt2815_private *)dev->private)
}
static int dt2815_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int dt2815_ao_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
COMEDI_INITCLEANUP(driver_dt2817);
static int dt2817_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int mask;
int chan;
}
static int dt2817_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int changed;
const comedi_lrange *darangelist[2];
- sampl_t ao[2];
+ short ao[2];
volatile int dacsr; /* software copies of registers */
volatile int adcsr;
static int dt282x_grab_dma(comedi_device * dev, int dma1, int dma2);
-static void dt282x_munge(comedi_device * dev, sampl_t * buf,
+static void dt282x_munge(comedi_device * dev, short * buf,
unsigned int nbytes)
{
unsigned int i;
#if 0
if (adcsr & DT2821_ADDONE) {
int ret;
- sampl_t data;
+ short data;
- data = (sampl_t) inw(dev->iobase + DT2821_ADDAT);
+ data = (short) inw(dev->iobase + DT2821_ADDAT);
data &= (1 << boardtype.adbits) - 1;
if (devpriv->ad_2scomp) {
data ^= 1 << (boardtype.adbits - 1);
* - trigger conversion and wait for it to finish
*/
static int dt282x_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
* data register, and performs the conversion.
*/
static int dt282x_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)];
}
static int dt282x_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
- sampl_t d;
+ short d;
unsigned int chan;
chan = CR_CHAN(insn->chanspec);
}
static int dt282x_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
}
static int dt282x_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int mask;
resource_size_t phys_addr;
void *io_addr;
unsigned int lock;
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
unsigned int ai_front;
unsigned int ai_rear;
} dt3k_private;
int rear;
int count;
int i;
- sampl_t data;
+ short data;
front = readw(devpriv->io_addr + DPR_AD_Buf_Front);
count = front - devpriv->ai_front;
}
static int dt3k_ai_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
unsigned int chan, gain, aref;
}
static int dt3k_ao_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
unsigned int chan;
}
static int dt3k_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
unsigned int chan;
}
static int dt3k_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int mask;
}
static int dt3k_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int dt3k_mem_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int addr = CR_CHAN(insn->chanspec);
int i;
}
static int dt9812_di_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n;
u8 bits = 0;
}
static int dt9812_do_winsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n;
u8 bits = 0;
}
static int dt9812_ai_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n;
}
static int dt9812_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n;
u16 value;
}
static int dt9812_ao_winsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n;
#define FL512_SIZE 16 /* the size of the used memory */
typedef struct {
- sampl_t ao_readback[2];
+ short ao_readback[2];
} fl512_private;
#define devpriv ((fl512_private *) dev->private)
COMEDI_INITCLEANUP(driver_fl512);
static int fl512_ai_insn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int fl512_ao_insn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int fl512_ao_insn_readback(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
/*
* fl512_ai_insn : this is the analog input function
*/
static int fl512_ai_insn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int n;
unsigned int lo_byte, hi_byte;
* fl512_ao_insn : used to write to a DA port n times
*/
static int fl512_ao_insn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec); /* get chan to write */
* DA port
*/
static int fl512_ao_insn_readback(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
comedi_cmd * cmd);
static int hpdi_cancel(comedi_device * dev, comedi_subdevice * s);
static irqreturn_t handle_interrupt(int irq, void *d PT_REGS_ARG);
-static int dio_config_block_size(comedi_device * dev, lsampl_t * data);
+static int dio_config_block_size(comedi_device * dev, unsigned int * data);
#undef HPDI_DEBUG // disable debugging messages
//#define HPDI_DEBUG // enable debugging code
COMEDI_PCI_INITCLEANUP(driver_hpdi, hpdi_pci_table);
static int dio_config_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case INSN_CONFIG_DIO_OUTPUT:
return 0;
}
-static int dio_config_block_size(comedi_device * dev, lsampl_t * data)
+static int dio_config_block_size(comedi_device * dev, unsigned int * data)
{
unsigned int requested_block_size;
int retval;
unsigned char act_chanlist_len; /* len of scanlist */
unsigned char act_chanlist_pos; /* actual position in MUX list */
unsigned int *ai_chanlist; /* actaul chanlist */
- sampl_t *ai_data; /* data buffer */
- sampl_t ao_data[4]; /* data output buffer */
- sampl_t di_data; /* Digital input data */
+ short *ai_data; /* data buffer */
+ short ao_data[4]; /* data output buffer */
+ short di_data; /* Digital input data */
unsigned int do_data; /* Remember digital output data */
};
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to analogue input data
+ unsigned int *data Pointer to analogue input data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_read_ai(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n, timeout;
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to analogue output data
+ unsigned int *data Pointer to analogue output data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_write_ao(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n, chan, range, timeout;
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to analogue output data
+ unsigned int *data Pointer to analogue output data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_read_ao(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n, chan;
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to analogue output data
+ unsigned int *data Pointer to analogue output data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_bits_di(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
data[1] = readw(devpriv->io_addr + ICP_MULTI_DI);
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to analogue output data
+ unsigned int *data Pointer to analogue output data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_bits_do(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
#ifdef ICP_MULTI_EXTDEBUG
printk("icp multi EDBG: BGN: icp_multi_insn_bits_do(...)\n");
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to counter data
+ unsigned int *data Pointer to counter data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_read_ctr(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
return 0;
}
comedi_device *dev Pointer to current device structure
comedi_subdevice *s Pointer to current subdevice structure
comedi_insn *insn Pointer to current comedi instruction
- lsampl_t *data Pointer to counter data
+ unsigned int *data Pointer to counter data
Returns:int Nmuber of instructions executed
==============================================================================
*/
static int icp_multi_insn_write_ctr(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
return 0;
}
struct {
void *iobase;
const comedi_lrange *ao_range_list[2]; /* range of channels of ao module */
- lsampl_t last_data[2];
+ unsigned int last_data[2];
} pci20006;
struct {
void *iobase;
/* pci20006m */
static int pci20006_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pci20006_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static const comedi_lrange *pci20006_range_list[] = {
&range_bipolar10,
}
static int pci20006_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
pci20xxx_subdev_private *sdp = s->private;
}
static int pci20006_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
pci20xxx_subdev_private *sdp = s->private;
int hi, lo;
/* PCI20341M */
static int pci20341_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static const int pci20341_timebase[] = { 0x00, 0x00, 0x00, 0x04 };
static const int pci20341_settling_time[] = { 0x58, 0x58, 0x93, 0x99 };
}
static int pci20341_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
pci20xxx_subdev_private *sdp = s->private;
unsigned int i = 0, j = 0;
lo = readb(sdp->iobase + PCI20341_LDATA);
hi = readb(sdp->iobase + PCI20341_LDATA + 1);
boarddata = lo + 0x100 * hi;
- data[i] = (sampl_t) ((boarddata + 0x8000) & 0xffff); /* board-data -> comedi-data */
+ data[i] = (short) ((boarddata + 0x8000) & 0xffff); /* board-data -> comedi-data */
}
return i;
static void pci20xxx_dio_config(comedi_device * dev, comedi_subdevice * s);
static int pci20xxx_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pci20xxx_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/* initialize pci20xxx_private */
static int pci20xxx_dio_init(comedi_device * dev, comedi_subdevice * s)
}
static int pci20xxx_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int mask, bits;
}
static int pci20xxx_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int mask = data[0];
comedi_krange range;
} range[9];
const comedi_lrange *range_table_list[8 * 7 + 2];
- lsampl_t maxdata_list[8 * 7 + 2];
+ unsigned int maxdata_list[8 * 7 + 2];
u16 errors;
int retries;
} jr3_pci_subdev_private;
}
static int jr3_pci_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int result;
jr3_pci_subdev_private *p;
/* This should be used only for resetting the counters; maybe it is better
to make a special command 'reset'. */
static int cnt_winsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
/*-- counter read -----------------------------------------------------------*/
static int cnt_rinsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
unsigned char a0, a1, a2, a3, a4;
int chan = CR_CHAN(insn->chanspec);
if (a4 > 0)
result = result - s->maxdata;
- *data = (lsampl_t) result;
+ *data = (unsigned int) result;
/* return the number of samples read */
return 1;
static int reset_board(comedi_device *dev);
static int me4000_dio_insn_bits(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
static int me4000_dio_insn_config(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
static int cnt_reset(comedi_device *dev, unsigned int channel);
unsigned int channel, unsigned int mode);
static int me4000_cnt_insn_config(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
static int me4000_cnt_insn_write(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
static int me4000_cnt_insn_read(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
static int me4000_ai_insn_read(comedi_device *dev,
- comedi_subdevice *subdevice, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *subdevice, comedi_insn *insn, unsigned int *data);
static int me4000_ai_cancel(comedi_device *dev, comedi_subdevice *s);
static int me4000_ai_do_cmd(comedi_device *dev, comedi_subdevice *s);
static int me4000_ao_insn_write(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
static int me4000_ao_insn_read(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data);
/*-----------------------------------------------------------------------------
Meilhaus inline functions
===========================================================================*/
static int me4000_ai_insn_read(comedi_device *dev,
- comedi_subdevice *subdevice, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *subdevice, comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
===========================================================================*/
static int me4000_ao_insn_write(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
}
static int me4000_ao_insn_read(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
===========================================================================*/
static int me4000_dio_insn_bits(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
CALL_PDEBUG("In me4000_dio_insn_bits()\n");
}
static int me4000_dio_insn_config(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
unsigned long tmp;
int chan = CR_CHAN(insn->chanspec);
}
static int me4000_cnt_insn_config(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int err;
}
static int me4000_cnt_insn_read(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
unsigned short tmp;
}
static int me4000_cnt_insn_write(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
unsigned short tmp;
* ------------------------------------------------------------------
*/
static int me_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int bits;
int mask = 1 << CR_CHAN(insn->chanspec);
/* Digital instant input/outputs */
static int me_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
unsigned int mask = data[0];
s->state &= ~mask;
/* Analog instant input */
static int me_ai_insn_read(comedi_device *dev, comedi_subdevice *subdevice,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
unsigned short value;
int chan = CR_CHAN((&insn->chanspec)[0]);
/* Analog instant output */
static int me_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int chan;
int rang;
/* Analog output readback */
static int me_ao_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i;
//----------------------------------------------------------------------------
static int mpc624_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
//----------------------------------------------------------------------------
static int mpc624_attach(comedi_device * dev, comedi_devconfig * it)
{
#define TIMEOUT 200
static int mpc624_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i;
unsigned long int data_in, data_out;
COMEDI_INITCLEANUP(driver_mpc8260cpm);
static int mpc8260cpm_dio_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int mpc8260cpm_dio_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int mpc8260cpm_attach(comedi_device * dev, comedi_devconfig * it)
{
}
static int mpc8260cpm_dio_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
unsigned int d;
}
static int mpc8260cpm_dio_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int port;
unsigned long *p;
COMEDI_INITCLEANUP(driver_multiq3);
struct multiq3_private {
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
};
#define devpriv ((struct multiq3_private *)dev->private)
static int multiq3_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int chan;
}
static int multiq3_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int multiq3_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int multiq3_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int multiq3_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int multiq3_encoder_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
static int ni6527_find_device(comedi_device * dev, int bus, int slot);
static int ni6527_di_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
unsigned int interval;
}
static int ni6527_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int ni6527_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int ni6527_intr_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return -EINVAL;
}
static int ni6527_intr_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return -EINVAL;
static int ni_65xx_find_device(comedi_device * dev, int bus, int slot);
static int ni_65xx_config_filter(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
const unsigned chan = CR_CHAN(insn->chanspec);
const unsigned port =
}
static int ni_65xx_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned port;
}
static int ni_65xx_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned base_bitfield_channel;
const unsigned max_ports_per_bitfield = 5;
}
static int ni_65xx_intr_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return -EINVAL;
}
static int ni_65xx_intr_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return -EINVAL;
/* Possible instructions for a GPCT */
static int ni_660x_GPCT_rinsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int ni_660x_GPCT_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int ni_660x_GPCT_winsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
/* Possible instructions for Digital IO */
static int ni_660x_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int ni_660x_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static inline unsigned ni_660x_num_counters(comedi_device * dev)
{
static int
ni_660x_GPCT_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
return ni_tio_rinsn(subdev_to_counter(s), insn, data);
}
static int
ni_660x_GPCT_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
return ni_tio_insn_config(subdev_to_counter(s), insn, data);
}
static int ni_660x_GPCT_winsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
return ni_tio_winsn(subdev_to_counter(s), insn, data);
}
}
static int ni_660x_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
unsigned base_bitfield_channel = CR_CHAN(insn->chanspec);
}
static int ni_660x_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
struct mite_struct *mite;
int boardtype;
int dio;
- lsampl_t ao_readback[32];
+ unsigned int ao_readback[32];
} ni_670x_private;
#define devpriv ((ni_670x_private *)dev->private)
static int ni_670x_find_device(comedi_device * dev, int bus, int slot);
static int ni_670x_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_670x_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_670x_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_670x_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_670x_attach(comedi_device * dev, comedi_devconfig * it)
{
}
static int ni_670x_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int ni_670x_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int ni_670x_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int ni_670x_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
comedi_cmd * cmd);
static int a2150_ai_cmd(comedi_device * dev, comedi_subdevice * s);
static int a2150_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int a2150_get_timing(comedi_device * dev, unsigned int *period,
int flags);
static int a2150_probe(comedi_device * dev);
comedi_async *async;
comedi_cmd *cmd;
unsigned int max_points, num_points, residue, leftover;
- sampl_t dpnt;
+ short dpnt;
static const int sample_size = sizeof(devpriv->dma_buffer[0]);
if (dev->attached == 0) {
}
static int a2150_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int i, n;
static const int timeout = 100000;
unsigned short cfg3;
/* Used for AO readback */
- lsampl_t ao_readback[10];
+ unsigned int ao_readback[10];
} atao_private;
#define devpriv ((atao_private *)dev->private)
static void atao_reset(comedi_device * dev);
static int atao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int atao_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int atao_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int atao_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int atao_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int atao_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int atao_attach(comedi_device * dev, comedi_devconfig * it)
{
}
static int atao_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int atao_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int atao_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int atao_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
unsigned int mask, bit;
* the caldacs, but we can guess.
*/
static int atao_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
for (i = 0; i < insn->n; i++) {
}
static int atao_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int bitstring, bit;
unsigned int chan = CR_CHAN(insn->chanspec);
enum { dac_internal, dac_external } dac0_reference, dac1_reference;
enum { dac_2comp, dac_straight } dac0_coding, dac1_coding;
const comedi_lrange *ao_range_type_list[2];
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
unsigned int com_reg_1_state; /* current state of command register 1 */
unsigned int com_reg_2_state; /* current state of command register 2 */
} atmio16d_private;
/* Mode 0 is used to get a single conversion on demand */
static int atmio16d_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, t;
int chan;
}
static int atmio16d_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
#ifdef DEBUG1
}
static int atmio16d_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan;
}
static int atmio16d_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int atmio16d_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int mask;
void subdev_700_interrupt(comedi_device * dev, comedi_subdevice * s)
{
- sampl_t d;
+ short d;
d = CALLBACK_FUNC(0, _700_DATA, 0, CALLBACK_ARG);
}
static int subdev_700_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (data[0]) {
s->state &= ~data[0];
}
static int subdev_700_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
comedi_cmd * cmd);
static int labpc_ai_cmd(comedi_device * dev, comedi_subdevice * s);
static int labpc_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int labpc_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int labpc_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int labpc_calib_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int labpc_calib_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int labpc_eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int labpc_eeprom_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static unsigned int labpc_suggest_transfer_size(comedi_cmd cmd);
static void labpc_adc_timing(comedi_device * dev, comedi_cmd * cmd);
#ifdef CONFIG_COMEDI_PCI
static int labpc_drain_fifo(comedi_device * dev)
{
unsigned int lsb, msb;
- sampl_t data;
+ short data;
comedi_async *async = dev->read_subdev->async;
const int timeout = 10000;
unsigned int i;
}
static int labpc_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int chan, range;
// analog output insn
static int labpc_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel, range;
unsigned long flags;
// analog output readback insn
static int labpc_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao_value[CR_CHAN(insn->chanspec)];
}
static int labpc_calib_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->caldac[CR_CHAN(insn->chanspec)];
}
static int labpc_calib_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
}
static int labpc_eeprom_read_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->eeprom_data[CR_CHAN(insn->chanspec)];
}
static int labpc_eeprom_write_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel = CR_CHAN(insn->chanspec);
int ret;
};
static int ni_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_cdio_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int ni_cdio_cmd(comedi_device * dev, comedi_subdevice * s);
unsigned int trignum);
static int ni_serial_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_serial_hw_readwrite8(comedi_device * dev, comedi_subdevice * s,
unsigned char data_out, unsigned char *data_in);
static int ni_serial_sw_readwrite8(comedi_device * dev, comedi_subdevice * s,
unsigned char data_out, unsigned char *data_in);
static int ni_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_eeprom_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_m_series_eeprom_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int ni_pfi_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_pfi_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static unsigned ni_old_get_pfi_routing(comedi_device * dev, unsigned chan);
static void ni_rtsi_init(comedi_device * dev);
static int ni_rtsi_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_rtsi_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static void caldac_setup(comedi_device * dev, comedi_subdevice * s);
static int ni_read_eeprom(comedi_device * dev, int addr);
static int ni_8255_callback(int dir, int port, int data, unsigned long arg);
static int ni_gpct_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_gpct_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_gpct_cmd(comedi_device * dev, comedi_subdevice * s);
static int ni_gpct_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int init_cs5529(comedi_device * dev);
static int cs5529_do_conversion(comedi_device * dev, unsigned short *data);
static int cs5529_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
#ifdef NI_CS5529_DEBUG
static unsigned int cs5529_config_read(comedi_device * dev,
unsigned int reg_select_bits);
unsigned int reg_select_bits);
static int ni_m_series_pwm_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_6143_pwm_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_set_master_clock(comedi_device * dev, unsigned source,
unsigned period_ns);
comedi_cmd *cmd = &async->cmd;
int chan;
int i;
- sampl_t d;
+ short d;
u32 packed_data;
int range;
int err = 1;
return 0;
}
- n /= sizeof(sampl_t);
+ n /= sizeof(short);
if (n > boardtype.ao_fifo_depth / 2)
n = boardtype.ao_fifo_depth / 2;
if (n == 0)
return 0;
- n /= sizeof(sampl_t);
+ n /= sizeof(short);
if (n > boardtype.ao_fifo_depth)
n = boardtype.ao_fifo_depth;
int i;
if (boardtype.reg_type == ni_reg_611x) {
- sampl_t data[2];
+ short data[2];
u32 dl;
for (i = 0; i < n / 2; i++) {
cfc_write_to_buffer(s, data[0]);
}
} else if (boardtype.reg_type == ni_reg_6143) {
- sampl_t data[2];
+ short data[2];
u32 dl;
// This just reads the FIFO assuming the data is present, no checks on the FIFO status are performed
static void ni_handle_fifo_dregs(comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
- sampl_t data[2];
+ short data[2];
u32 dl;
short fifo_empty;
int i;
static void get_last_sample_611x(comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
- sampl_t data;
+ short data;
u32 dl;
if (boardtype.reg_type != ni_reg_611x)
static void get_last_sample_6143(comedi_device * dev)
{
comedi_subdevice *s = dev->subdevices + NI_AI_SUBDEV;
- sampl_t data;
+ short data;
u32 dl;
if (boardtype.reg_type != ni_reg_6143)
comedi_async *async = s->async;
unsigned int i;
unsigned int length = num_bytes / bytes_per_sample(s);
- sampl_t *array = data;
- lsampl_t *larray = data;
+ short *array = data;
+ unsigned int *larray = data;
for (i = 0; i < length; i++) {
#ifdef PCIDMA
if (s->subdev_flags & SDF_LSAMPL)
}
static int ni_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
const unsigned int mask = (1 << boardtype.adbits) - 1;
}
static int ni_ai_config_analog_trig(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ni_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n < 1)
return -EINVAL;
}
static int ni_ai_config_analog_trig(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int a, b, modebits;
int err = 0;
unsigned int range;
unsigned int i;
unsigned int offset;
- unsigned int length = num_bytes / sizeof(sampl_t);
- sampl_t *array = data;
+ unsigned int length = num_bytes / sizeof(short);
+ short *array = data;
offset = 1 << (boardtype.aobits - 1);
for (i = 0; i < length; i++) {
return ni_old_ao_config_chanlist(dev, s, chanspec, n_chans);
}
static int ni_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)];
}
static int ni_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int invert;
}
static int ni_ao_insn_write_671x(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int invert;
}
static int ni_ao_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case INSN_CONFIG_GET_HARDWARE_BUFFER_SIZE:
switch(data[1])
{
case COMEDI_OUTPUT:
- data[2] = 1 + boardtype.ao_fifo_depth * sizeof(sampl_t);
+ data[2] = 1 + boardtype.ao_fifo_depth * sizeof(short);
if(devpriv->mite) data[2] += devpriv->mite->fifo_size;
break;
case COMEDI_INPUT:
// digital io
static int ni_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
rt_printk("ni_dio_insn_config() chan=%d io=%d\n",
}
static int ni_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
rt_printk("ni_dio_insn_bits() mask=0x%x bits=0x%x\n", data[0], data[1]);
}
static int ni_m_series_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
rt_printk("ni_m_series_dio_insn_config() chan=%d io=%d\n",
}
static int ni_m_series_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
#ifdef DEBUG_DIO
rt_printk("ni_m_series_dio_insn_bits() mask=0x%x bits=0x%x\n", data[0],
}
static int ni_serial_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int err = insn->n;
unsigned char byte_out, byte_in = 0;
}
static int ni_freq_out_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->clock_and_fout & FOUT_Divider_mask;
return 1;
}
static int ni_freq_out_insn_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
devpriv->clock_and_fout &= ~FOUT_Enable;
devpriv->stc_writew(dev, devpriv->clock_and_fout,
return insn->n;
}
-static int ni_set_freq_out_clock(comedi_device * dev, lsampl_t clock_source)
+static int ni_set_freq_out_clock(comedi_device * dev, unsigned int clock_source)
{
switch (clock_source) {
case NI_FREQ_OUT_TIMEBASE_1_DIV_2_CLOCK_SRC:
return 3;
}
-static void ni_get_freq_out_clock(comedi_device * dev, lsampl_t * clock_source,
- lsampl_t * clock_period_ns)
+static void ni_get_freq_out_clock(comedi_device * dev, unsigned int * clock_source,
+ unsigned int * clock_period_ns)
{
if (devpriv->clock_and_fout & FOUT_Timebase_Select) {
*clock_source = NI_FREQ_OUT_TIMEBASE_2_CLOCK_SRC;
}
static int ni_freq_out_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case INSN_CONFIG_SET_CLOCK_SRC:
*/
static int ni_eeprom_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = ni_read_eeprom(dev, CR_CHAN(insn->chanspec));
}
static int ni_m_series_eeprom_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->eeprom_buffer[CR_CHAN(insn->chanspec)];
return 1;
}
-static int ni_get_pwm_config(comedi_device * dev, lsampl_t * data)
+static int ni_get_pwm_config(comedi_device * dev, unsigned int * data)
{
data[1] = devpriv->pwm_up_count * devpriv->clock_ns;
data[2] = devpriv->pwm_down_count * devpriv->clock_ns;
}
static int ni_m_series_pwm_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned up_count, down_count;
switch (data[0]) {
}
static int ni_6143_pwm_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned up_count, down_count;
switch (data[0]) {
calibration subdevice
*/
static int ni_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
ni_write_caldac(dev, CR_CHAN(insn->chanspec), data[0]);
}
static int ni_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
data[0] = devpriv->caldacs[CR_CHAN(insn->chanspec)];
#endif
static int ni_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
struct ni_gpct *counter = s->private;
return ni_tio_insn_config(counter, insn, data);
}
static int ni_gpct_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
struct ni_gpct *counter = s->private;
return ni_tio_rinsn(counter, insn, data);
}
static int ni_gpct_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
struct ni_gpct *counter = s->private;
return ni_tio_winsn(counter, insn, data);
}
static int ni_pfi_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if ((boardtype.reg_type & ni_reg_m_series_mask) == 0) {
return -ENOTSUPP;
}
static int ni_pfi_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int chan;
}
static int ni_rtsi_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int ni_rtsi_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int chan = CR_CHAN(insn->chanspec);
switch (data[0]) {
}
static int cs5529_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, retval;
unsigned short sample;
//int i, j;
long int AuxData = 0;
- sampl_t data1 = 0;
- sampl_t data2 = 0;
+ short data1 = 0;
+ short data2 = 0;
int flags;
int status;
int work = 0;
#endif
static int ni_pcidio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 1)
return -EINVAL;
}
static int ni_pcidio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
unsigned short pwm_up_count; \
unsigned short pwm_down_count; \
\
- sampl_t ai_fifo_buffer[0x2000]; \
+ short ai_fifo_buffer[0x2000]; \
uint8_t eeprom_buffer[M_SERIES_EEPROM_SIZE]; \
uint32_t serial_number; \
\
return 0xb + n;
}
-static const lsampl_t counter_status_mask =
+static const unsigned int counter_status_mask =
COMEDI_COUNTER_ARMED | COMEDI_COUNTER_COUNTING;
static int __init ni_tio_init_module(void)
NITIO_Gi_Interrupt_Enable_Reg(counter->counter_index), ~0, 0x0);
}
-static lsampl_t ni_tio_counter_status(struct ni_gpct *counter)
+static unsigned int ni_tio_counter_status(struct ni_gpct *counter)
{
- lsampl_t status = 0;
+ unsigned int status = 0;
const unsigned bits = read_register(counter,
NITIO_Gxx_Status_Reg(counter->counter_index));
if (bits & Gi_Armed_Bit(counter->counter_index)) {
return 0;
}
-static unsigned ni_660x_source_select_bits(lsampl_t clock_source)
+static unsigned ni_660x_source_select_bits(unsigned int clock_source)
{
unsigned ni_660x_clock;
unsigned i;
return Gi_Source_Select_Bits(ni_660x_clock);
}
-static unsigned ni_m_series_source_select_bits(lsampl_t clock_source)
+static unsigned ni_m_series_source_select_bits(unsigned int clock_source)
{
unsigned ni_m_series_clock;
unsigned i;
};
static void ni_tio_set_source_subselect(struct ni_gpct *counter,
- lsampl_t clock_source)
+ unsigned int clock_source)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned second_gate_reg =
}
static int ni_tio_set_clock_src(struct ni_gpct *counter,
- lsampl_t clock_source, lsampl_t period_ns)
+ unsigned int clock_source, unsigned int period_ns)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
unsigned input_select_bits = 0;
}
static void ni_tio_get_clock_src(struct ni_gpct *counter,
- lsampl_t * clock_source, lsampl_t * period_ns)
+ unsigned int * clock_source, unsigned int * period_ns)
{
static const unsigned pico_per_nano = 1000;
uint64_t temp64;
}
static void ni_tio_set_first_gate_modifiers(struct ni_gpct *counter,
- lsampl_t gate_source)
+ unsigned int gate_source)
{
const unsigned mode_mask = Gi_Gate_Polarity_Bit | Gi_Gating_Mode_Mask;
unsigned mode_values = 0;
mode_mask, mode_values);
}
-static int ni_660x_set_first_gate(struct ni_gpct *counter, lsampl_t gate_source)
+static int ni_660x_set_first_gate(struct ni_gpct *counter, unsigned int gate_source)
{
const unsigned selected_gate = CR_CHAN(gate_source);
/* bits of selected_gate that may be meaningful to input select register */
}
static int ni_m_series_set_first_gate(struct ni_gpct *counter,
- lsampl_t gate_source)
+ unsigned int gate_source)
{
const unsigned selected_gate = CR_CHAN(gate_source);
/* bits of selected_gate that may be meaningful to input select register */
}
static int ni_660x_set_second_gate(struct ni_gpct *counter,
- lsampl_t gate_source)
+ unsigned int gate_source)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned second_gate_reg =
}
static int ni_m_series_set_second_gate(struct ni_gpct *counter,
- lsampl_t gate_source)
+ unsigned int gate_source)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned second_gate_reg =
}
int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index,
- lsampl_t gate_source)
+ unsigned int gate_source)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned second_gate_reg =
}
static int ni_tio_set_other_src(struct ni_gpct *counter, unsigned index,
- lsampl_t source)
+ unsigned int source)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
};
static int ni_tio_get_gate_src(struct ni_gpct *counter, unsigned gate_index,
- lsampl_t * gate_source)
+ unsigned int * gate_source)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned mode_bits = ni_tio_get_soft_copy(counter,
}
int ni_tio_insn_config(struct ni_gpct *counter,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case INSN_CONFIG_SET_COUNTER_MODE:
return -EINVAL;
}
-int ni_tio_rinsn(struct ni_gpct *counter, comedi_insn * insn, lsampl_t * data)
+int ni_tio_rinsn(struct ni_gpct *counter, comedi_insn * insn, unsigned int * data)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned channel = CR_CHAN(insn->chanspec);
}
}
-int ni_tio_winsn(struct ni_gpct *counter, comedi_insn * insn, lsampl_t * data)
+int ni_tio_winsn(struct ni_gpct *counter, comedi_insn * insn, unsigned int * data)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
const unsigned channel = CR_CHAN(insn->chanspec);
extern void ni_gpct_device_destroy(struct ni_gpct_device *counter_dev);
extern void ni_tio_init_counter(struct ni_gpct *counter);
extern int ni_tio_rinsn(struct ni_gpct *counter,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
extern int ni_tio_insn_config(struct ni_gpct *counter,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
extern int ni_tio_winsn(struct ni_gpct *counter,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
extern int ni_tio_cmd(struct ni_gpct *counter, comedi_async * async);
extern int ni_tio_cmdtest(struct ni_gpct *counter, comedi_cmd * cmd);
extern int ni_tio_cancel(struct ni_gpct *counter);
int ni_tio_arm(struct ni_gpct *counter, int arm, unsigned start_trigger);
int ni_tio_set_gate_src(struct ni_gpct *counter, unsigned gate_index,
- lsampl_t gate_source);
+ unsigned int gate_source);
#endif /* _COMEDI_NI_TIO_INTERNAL_H */
int ntrig;
int aip[8];
int mode;
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
unsigned int divisor1;
unsigned int divisor2;
} pcl711_private;
}
static int pcl711_ai_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, n;
int hi, lo;
analog output
*/
static int pcl711_ao_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
}
static int pcl711_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
/* Digital port read - Untested on 8112 */
static int pcl711_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
/* Digital port write - Untested on 8112 */
static int pcl711_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
COMEDI_INITCLEANUP(driver_pcl725);
static int pcl725_do_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int pcl725_di_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
typedef struct {
int bipolar[12];
const comedi_lrange *rangelist[12];
- lsampl_t ao_readback[12];
+ unsigned int ao_readback[12];
} pcl726_private;
#define devpriv ((pcl726_private *)dev->private)
static int pcl726_ao_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int hi, lo;
int n;
}
static int pcl726_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int n;
}
static int pcl726_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int pcl726_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
COMEDI_INITCLEANUP(driver_pcl730);
static int pcl730_do_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int pcl730_di_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
unsigned int ai_n_chan; // how many channels is measured
unsigned int ai_flags; // flaglist
unsigned int ai_data_len; // len of data buffer
- sampl_t *ai_data; // data buffer
+ short *ai_data; // data buffer
unsigned int ai_is16b; // =1 we have 16 bit card
unsigned long dmabuf[2]; // PTR to DMA buf
unsigned int dmapages[2]; // how many pages we have allocated
unsigned int dma_runs_to_end; // how many times we must switch DMA buffers
unsigned int last_dma_run; // how many bytes to transfer on last DMA buffer
unsigned int max_812_ai_mode0_rangewait; // setling time for gain
- lsampl_t ao_readback[2]; // data for AO readback
+ unsigned int ao_readback[2]; // data for AO readback
} pcl812_private;
#define devpriv ((pcl812_private *)dev->private)
==============================================================================
*/
static int pcl812_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int timeout, hi;
==============================================================================
*/
static int acl8216_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int timeout;
==============================================================================
*/
static int pcl812_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int i;
==============================================================================
*/
static int pcl812_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int i;
==============================================================================
*/
static int pcl812_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
==============================================================================
*/
static int pcl812_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
if (devpriv->ai_dma) {
if (devpriv->ai_eos) { // we use EOS, so adapt DMA buffer to one scan
devpriv->dmabytestomove[0] =
- devpriv->ai_n_chan * sizeof(sampl_t);
+ devpriv->ai_n_chan * sizeof(short);
devpriv->dmabytestomove[1] =
- devpriv->ai_n_chan * sizeof(sampl_t);
+ devpriv->ai_n_chan * sizeof(short);
devpriv->dma_runs_to_end = 1;
} else {
devpriv->dmabytestomove[0] = devpriv->hwdmasize[0];
if (devpriv->ai_neverending) {
devpriv->dma_runs_to_end = 1;
} else {
- bytes = devpriv->ai_n_chan * devpriv->ai_scans * sizeof(sampl_t); // how many samples we must transfer?
+ bytes = devpriv->ai_n_chan * devpriv->ai_scans * sizeof(short); // how many samples we must transfer?
devpriv->dma_runs_to_end = bytes / devpriv->dmabytestomove[0]; // how many DMA pages we must fill
devpriv->last_dma_run = bytes % devpriv->dmabytestomove[0]; //on last dma transfer must be moved
if (devpriv->dma_runs_to_end == 0)
==============================================================================
*/
static void transfer_from_dma_buf(comedi_device * dev, comedi_subdevice * s,
- sampl_t * ptr, unsigned int bufptr, unsigned int len)
+ short * ptr, unsigned int bufptr, unsigned int len)
{
unsigned int i;
comedi_subdevice *s = dev->subdevices + 0;
unsigned long dma_flags;
int len, bufptr;
- sampl_t *ptr;
+ short *ptr;
#ifdef PCL812_EXTDEBUG
rt_printk("pcl812 EDBG: BGN: interrupt_pcl812_ai_dma(...)\n");
#endif
- ptr = (sampl_t *) devpriv->dmabuf[devpriv->next_dma_buf];
+ ptr = (short *) devpriv->dmabuf[devpriv->next_dma_buf];
len = (devpriv->dmabytestomove[devpriv->next_dma_buf] >> 1) -
devpriv->ai_poll_ptr;
ANALOG INPUT MODE0, 816 cards, slow version
*/
static int pcl816_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int timeout;
analog input dma mode 1 & 3, 816 cards
*/
static void transfer_from_dma_buf(comedi_device * dev, comedi_subdevice * s,
- sampl_t * ptr, unsigned int bufptr, unsigned int len)
+ short * ptr, unsigned int bufptr, unsigned int len)
{
int i;
comedi_subdevice *s = dev->subdevices + 0;
int len, bufptr, this_dma_buf;
unsigned long dma_flags;
- sampl_t *ptr;
+ short *ptr;
disable_dma(devpriv->dma);
this_dma_buf = devpriv->next_dma_buf;
devpriv->dma_runs_to_end--;
outb(0, dev->iobase + PCL816_CLRINT); /* clear INT request */
- ptr = (sampl_t *) devpriv->dmabuf[this_dma_buf];
+ ptr = (short *) devpriv->dmabuf[this_dma_buf];
len = (devpriv->hwdmasize[0] >> 1) - devpriv->ai_poll_ptr;
bufptr = devpriv->ai_poll_ptr;
if (devpriv->dma) {
bytes = devpriv->hwdmasize[0];
if (!devpriv->ai_neverending) {
- bytes = s->async->cmd.chanlist_len * s->async->cmd.chanlist_len * sizeof(sampl_t); // how many
+ bytes = s->async->cmd.chanlist_len * s->async->cmd.chanlist_len * sizeof(short); // how many
devpriv->dma_runs_to_end = bytes / devpriv->hwdmasize[0]; // how many DMA pages we must fill
devpriv->last_dma_run = bytes % devpriv->hwdmasize[0]; //on last dma transfer must be moved
devpriv->dma_runs_to_end--;
}
transfer_from_dma_buf(dev, s,
- (sampl_t *) devpriv->dmabuf[devpriv->next_dma_buf],
+ (short *) devpriv->dmabuf[devpriv->next_dma_buf],
devpriv->ai_poll_ptr, top2);
devpriv->ai_poll_ptr = top1; // new buffer position
unsigned int *ai_chanlist; // actaul chanlist
unsigned int ai_flags; // flaglist
unsigned int ai_data_len; // len of data buffer
- sampl_t *ai_data; // data buffer
+ short *ai_data; // data buffer
unsigned int ai_timer1; // timers
unsigned int ai_timer2;
comedi_subdevice *sub_ai; // ptr to AI subdevice
unsigned char usefifo; // 1=use fifo
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
} pcl818_private;
static const unsigned int muxonechan[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, // used for gain list programming
ANALOG INPUT MODE0, 818 cards, slow version
*/
static int pcl818_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int timeout;
only one sample per call is supported
*/
static int pcl818_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
}
static int pcl818_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
only one sample per call is supported
*/
static int pcl818_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
only one sample per call is supported
*/
static int pcl818_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
comedi_subdevice *s = dev->subdevices + 0;
int i, len, bufptr;
unsigned long flags;
- sampl_t *ptr;
+ short *ptr;
disable_dma(devpriv->dma);
devpriv->next_dma_buf = 1 - devpriv->next_dma_buf;
devpriv->dma_runs_to_end--;
outb(0, dev->iobase + PCL818_CLRINT); /* clear INT request */
- ptr = (sampl_t *) devpriv->dmabuf[1 - devpriv->next_dma_buf];
+ ptr = (short *) devpriv->dmabuf[1 - devpriv->next_dma_buf];
len = devpriv->hwdmasize[0] >> 1;
bufptr = 0;
unsigned long tmp;
unsigned int top1, top2, i, bufptr;
long ofs_dats;
- sampl_t *dmabuf = (sampl_t *) devpriv->dmabuf[0];
+ short *dmabuf = (short *) devpriv->dmabuf[0];
//outb(2,0x378);
switch (devpriv->ai_mode) {
disable_dma(devpriv->dma); // disable dma
bytes = devpriv->hwdmasize[0];
if (!devpriv->neverending_ai) {
- bytes = devpriv->ai_n_chan * devpriv->ai_scans * sizeof(sampl_t); // how many
+ bytes = devpriv->ai_n_chan * devpriv->ai_scans * sizeof(short); // how many
devpriv->dma_runs_to_end = bytes / devpriv->hwdmasize[0]; // how many DMA pages we must fiil
devpriv->last_dma_run = bytes % devpriv->hwdmasize[0]; //on last dma transfer must be moved
devpriv->dma_runs_to_end--;
comedi_subdevice * s)
{
unsigned int flags;
- sampl_t *pole;
+ short *pole;
set_dma_mode(devpriv->dma, DMA_MODE_READ | DMA_AUTOINIT);
flags = claim_dma_lock();
release_dma_lock(flags);
enable_dma(devpriv->dma);
devpriv->last_top_dma = 0; //devpriv->hwdmasize[0];
- pole = (sampl_t *) devpriv->dmabuf[0];
+ pole = (short *) devpriv->dmabuf[0];
devpriv->dmasamplsize = devpriv->hwdmasize[0] / 2;
pole[devpriv->dmasamplsize - 1] = MAGIC_DMA_WORD;
#ifdef unused
/* overriding the 8255 insn config */
static int subdev_3724_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unsigned int mask;
unsigned int bits;
COMEDI_INITCLEANUP(driver_pcm3730);
static int pcm3730_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int pcm3730_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
#define TIMEOUT 100
static int pcmad_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan;
#define thisboard ((const pcmda12_board *)dev->board_ptr)
typedef struct {
- lsampl_t ao_readback[CHANS];
+ unsigned int ao_readback[CHANS];
int simultaneous_xfer_mode;
} pcmda12_private;
};
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/*
* Attach is called by the Comedi core to configure the driver
}
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
This is useful for some control applications, I would imagine.
*/
static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
#define PAGE_INT_ID 3
typedef int (*comedi_insn_fn_t) (comedi_device *, comedi_subdevice *,
- comedi_insn *, lsampl_t *);
+ comedi_insn *, unsigned int *);
static int ai_rinsn(comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
static int ao_rinsn(comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
static int ao_winsn(comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
/*
* Board descriptions for two imaginary boards. Describing the
} intr;
} dio;
struct {
- lsampl_t shadow_samples[8]; /* the last lsampl_t data written */
+ unsigned int shadow_samples[8]; /* the last unsigned int data written */
} ao;
};
} pcmmio_subdev_private;
};
static int pcmmio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pcmmio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static irqreturn_t interrupt_pcmmio(int irq, void *d PT_REGS_ARG);
static void pcmmio_stop_intr(comedi_device *, comedi_subdevice *);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int pcmmio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int byte_no;
if (insn->n != 2)
* contains the channel to be changed, and data[0] contains the
* value COMEDI_INPUT or COMEDI_OUTPUT. */
static int pcmmio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec), byte_no = chan / 8, bit_no =
chan % 8;
if (mytrig & subpriv->
dio.intr.
enabled_mask) {
- lsampl_t val =
+ unsigned int val =
0;
unsigned int n,
ch, len;
}
}
/* Write the scan to the buffer. */
- if (comedi_buf_put(s->async, ((sampl_t *) & val)[0])
+ if (comedi_buf_put(s->async, ((short *) & val)[0])
&&
comedi_buf_put
- (s->async, ((sampl_t *) & val)[1])) {
+ (s->async, ((short *) & val)[1])) {
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
} else {
/* Overflow! Stop acquisition!! */
/* All this is for AI and AO */
static int ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
unsigned long iobase = subpriv->iobase;
CR_AREF(insn->chanspec);
unsigned char command_byte = 0;
unsigned iooffset = 0;
- sampl_t sample, adc_adjust = 0;
+ short sample, adc_adjust = 0;
if (chan > 7)
chan -= 8, iooffset = 4; /* use the second dword for channels > 7 */
}
static int ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
for (n = 0; n < insn->n; n++) {
}
static int ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
unsigned iobase = subpriv->iobase, iooffset = 0;
};
static int pcmuio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pcmuio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static irqreturn_t interrupt_pcmuio(int irq, void *d PT_REGS_ARG);
static void pcmuio_stop_intr(comedi_device *, comedi_subdevice *);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int pcmuio_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int byte_no;
if (insn->n != 2)
* contains the channel to be changed, and data[0] contains the
* value COMEDI_INPUT or COMEDI_OUTPUT. */
static int pcmuio_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec), byte_no = chan / 8, bit_no =
chan % 8;
if (mytrig & subpriv->
intr.
enabled_mask) {
- lsampl_t val =
+ unsigned int val =
0;
unsigned int n,
ch, len;
}
}
/* Write the scan to the buffer. */
- if (comedi_buf_put(s->async, ((sampl_t *) & val)[0])
+ if (comedi_buf_put(s->async, ((short *) & val)[0])
&&
comedi_buf_put
- (s->async, ((sampl_t *) & val)[1])) {
+ (s->async, ((short *) & val)[1])) {
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
} else {
/* Overflow! Stop acquisition!! */
static int poc_attach(comedi_device * dev, comedi_devconfig * it);
static int poc_detach(comedi_device * dev);
static int readback_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int dac02_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pcl733_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int pcl734_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
struct boarddef_struct {
const char *name;
int n_chan;
int n_bits;
int (*winsn) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
int (*rinsn) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
int (*insnbits) (comedi_device *, comedi_subdevice *, comedi_insn *,
- lsampl_t *);
+ unsigned int *);
const comedi_lrange *range;
};
static const struct boarddef_struct boards[] = {
if (alloc_subdevices(dev, 1) < 0)
return -ENOMEM;
- if (alloc_private(dev, sizeof(lsampl_t) * this_board->n_chan) < 0)
+ if (alloc_private(dev, sizeof(unsigned int) * this_board->n_chan) < 0)
return -ENOMEM;
/* analog output subdevice */
}
static int readback_insn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan;
chan = CR_CHAN(insn->chanspec);
- data[0] = ((lsampl_t *) dev->private)[chan];
+ data[0] = ((unsigned int *) dev->private)[chan];
return 1;
}
#define DAC02_MSB(a) (2 * a + 1)
static int dac02_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int temp;
int chan;
int output;
chan = CR_CHAN(insn->chanspec);
- ((lsampl_t *) dev->private)[chan] = data[0];
+ ((unsigned int *) dev->private)[chan] = data[0];
output = data[0];
#ifdef wrong
// convert to complementary binary if range is bipolar
}
static int pcl733_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int pcl734_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
while (!((status = inb(dev->iobase + DAQP_STATUS))
& DAQP_STATUS_FIFO_EMPTY)) {
- sampl_t data;
+ short data;
if (status & DAQP_STATUS_DATA_LOST) {
s->async->events |=
/* One-shot analog data acquisition routine */
static int daqp_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
int i;
/* Single-shot analog output routine */
static int daqp_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
int d;
/* Digital input routine */
static int daqp_di_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
/* Digital output routine */
static int daqp_do_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
local_info_t *local = (local_info_t *) s->private;
unsigned char chanBipolar[RTD_MAX_CHANLIST / 8]; /* bit array */
/* read back data */
- lsampl_t aoValue[2]; /* Used for AO read back */
+ unsigned int aoValue[2]; /* Used for AO read back */
/* timer gate (when enabled) */
u8 utcGate[4]; /* 1 extra allows simple range check */
};
static int rtd_ai_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int rtd_ao_winsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int rtd_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int rtd_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int rtd_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int rtd_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
static int rtd_ai_cmd(comedi_device *dev, comedi_subdevice *s);
empty status flag clears */
static int rtd520_probe_fifo_depth(comedi_device *dev)
{
- lsampl_t chanspec = CR_PACK(0, 0, AREF_GROUND);
+ unsigned int chanspec = CR_PACK(0, 0, AREF_GROUND);
unsigned i;
static const unsigned limit = 0x2000;
unsigned fifo_size = 0;
select, delay, then read.
*/
static int rtd_ai_rinsn(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int n, ii;
int stat;
int ii;
for (ii = 0; ii < count; ii++) {
- sampl_t sample;
+ short sample;
s16 d;
if (0 == devpriv->aiCount) { /* done */
static int ai_read_dregs(comedi_device *dev, comedi_subdevice *s)
{
while (RtdFifoStatus(dev) & FS_ADC_NOT_EMPTY) { /* 1 -> not empty */
- sampl_t sample;
+ short sample;
s16 d = RtdAdcFifoGet(dev); /* get 2s comp value */
if (0 == devpriv->aiCount) { /* done */
dp = devpriv->dma0Buff[devpriv->dma0Offset];
for (ii = 0; ii < devpriv->fifoLen / 2;) { /* convert samples */
- sampl_t sample;
+ short sample;
if (CHAN_ARRAY_TEST(devpriv->chanBipolar, s->async->cur_chan)) {
sample = (*dp >> 3) + 2048; /* convert to comedi unsigned data */
Output one (or more) analog values to a single port as fast as possible.
*/
static int rtd_ao_winsn(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int rtd_ao_rinsn(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* comedi core can convert between insn_bits and insn_read/write
*/
static int rtd_dio_insn_bits(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
if (insn->n != 2)
return -EINVAL;
Configure one bit on a IO port as Input or Output (hence the name :-).
*/
static int rtd_dio_insn_config(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
dac_2comp, dac_straight
} dac0_coding, dac1_coding;
const comedi_lrange *ao_range_type_list[2];
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
int muxgain_bits;
} rti800_private;
static const int gaindelay[] = { 10, 20, 40, 80 };
static int rti800_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, t;
int status;
}
static int rti800_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int rti800_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
int d;
}
static int rti800_di_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int rti800_do_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
dac_2comp, dac_straight
} dac_coding[8];
const comedi_lrange *range_type_list[8];
- lsampl_t ao_readback[8];
+ unsigned int ao_readback[8];
} rti802_private;
#define devpriv ((rti802_private *)dev->private)
static int rti802_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
}
static int rti802_ao_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i, d;
int chan = CR_CHAN(insn->chanspec);
struct pci_dev *pci_dev;
/* Used for AO readback */
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
s526_gpct_config_t s526_gpct_config[4];
unsigned short s526_ai_config;
};
static int s526_gpct_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_gpct_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int s526_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
/*
* Attach is called by the Comedi core to configure the driver
comedi_subdevice *s;
int iobase;
int i, n;
-// sampl_t value;
+// short value;
// int subdev_channel = 0;
printk("comedi%d: s526: ", dev->minor);
printk("Read back mode reg=0x%04x\n", inw(ADDR_CHAN_REG(REG_C0M, n)));
// Load the pre-laod register high word
-// value = (sampl_t) (0x55);
+// value = (short) (0x55);
// outw(value, ADDR_CHAN_REG(REG_C0H, n));
// Load the pre-laod register low word
-// value = (sampl_t)(0xaa55);
+// value = (short)(0xaa55);
// outw(value, ADDR_CHAN_REG(REG_C0L, n));
// Write the Counter Control Register
}
static int s526_gpct_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i; // counts the Data
int counter_channel = CR_CHAN(insn->chanspec);
}
static int s526_gpct_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int subdev_channel = CR_CHAN(insn->chanspec); // Unpack chanspec
int i;
- sampl_t value;
+ short value;
// printk("s526: GPCT_INSN_CONFIG: Configuring Channel %d\n", subdev_channel);
cmReg.reg.autoLoadResetRcap = 4; // Auto load with INDEX^
// Set Counter Mode Register
- cmReg.value = (sampl_t) (insn->data[1] & 0xFFFF);
+ cmReg.value = (short) (insn->data[1] & 0xFFFF);
outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, subdev_channel));
// Load the pre-laod register high word
- value = (sampl_t) ((insn->data[2] >> 16) & 0xFFFF);
+ value = (short) ((insn->data[2] >> 16) & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0H, subdev_channel));
// Load the pre-laod register low word
- value = (sampl_t) (insn->data[2] & 0xFFFF);
+ value = (short) (insn->data[2] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0L, subdev_channel));
// Write the Counter Control Register
if (insn->data[3] != 0) {
- value = (sampl_t) (insn->data[3] & 0xFFFF);
+ value = (short) (insn->data[3] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0C, subdev_channel));
}
// Reset the counter if it is software preload
SinglePulseGeneration;
// Set Counter Mode Register
- cmReg.value = (sampl_t) (insn->data[1] & 0xFFFF);
+ cmReg.value = (short) (insn->data[1] & 0xFFFF);
cmReg.reg.preloadRegSel = 0; // PR0
outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, subdev_channel));
// Load the pre-laod register 0 high word
- value = (sampl_t) ((insn->data[2] >> 16) & 0xFFFF);
+ value = (short) ((insn->data[2] >> 16) & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0H, subdev_channel));
// Load the pre-laod register 0 low word
- value = (sampl_t) (insn->data[2] & 0xFFFF);
+ value = (short) (insn->data[2] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0L, subdev_channel));
// Set Counter Mode Register
- cmReg.value = (sampl_t) (insn->data[1] & 0xFFFF);
+ cmReg.value = (short) (insn->data[1] & 0xFFFF);
cmReg.reg.preloadRegSel = 1; // PR1
outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, subdev_channel));
// Load the pre-laod register 1 high word
- value = (sampl_t) ((insn->data[3] >> 16) & 0xFFFF);
+ value = (short) ((insn->data[3] >> 16) & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0H, subdev_channel));
// Load the pre-laod register 1 low word
- value = (sampl_t) (insn->data[3] & 0xFFFF);
+ value = (short) (insn->data[3] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0L, subdev_channel));
// Write the Counter Control Register
if (insn->data[3] != 0) {
- value = (sampl_t) (insn->data[3] & 0xFFFF);
+ value = (short) (insn->data[3] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0C, subdev_channel));
}
break;
PulseTrainGeneration;
// Set Counter Mode Register
- cmReg.value = (sampl_t) (insn->data[1] & 0xFFFF);
+ cmReg.value = (short) (insn->data[1] & 0xFFFF);
cmReg.reg.preloadRegSel = 0; // PR0
outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, subdev_channel));
// Load the pre-laod register 0 high word
- value = (sampl_t) ((insn->data[2] >> 16) & 0xFFFF);
+ value = (short) ((insn->data[2] >> 16) & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0H, subdev_channel));
// Load the pre-laod register 0 low word
- value = (sampl_t) (insn->data[2] & 0xFFFF);
+ value = (short) (insn->data[2] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0L, subdev_channel));
// Set Counter Mode Register
- cmReg.value = (sampl_t) (insn->data[1] & 0xFFFF);
+ cmReg.value = (short) (insn->data[1] & 0xFFFF);
cmReg.reg.preloadRegSel = 1; // PR1
outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, subdev_channel));
// Load the pre-laod register 1 high word
- value = (sampl_t) ((insn->data[3] >> 16) & 0xFFFF);
+ value = (short) ((insn->data[3] >> 16) & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0H, subdev_channel));
// Load the pre-laod register 1 low word
- value = (sampl_t) (insn->data[3] & 0xFFFF);
+ value = (short) (insn->data[3] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0L, subdev_channel));
// Write the Counter Control Register
if (insn->data[3] != 0) {
- value = (sampl_t) (insn->data[3] & 0xFFFF);
+ value = (short) (insn->data[3] & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0C, subdev_channel));
}
break;
}
static int s526_gpct_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int subdev_channel = CR_CHAN(insn->chanspec); // Unpack chanspec
- sampl_t value;
+ short value;
printk("s526: GPCT_INSN_WRITE on channel %d\n", subdev_channel);
cmReg.value = inw(ADDR_CHAN_REG(REG_C0M, subdev_channel));
return -EINVAL;
}
- value = (sampl_t) ((*data >> 16) & 0xFFFF);
+ value = (short) ((*data >> 16) & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0H, subdev_channel));
- value = (sampl_t) (*data & 0xFFFF);
+ value = (short) (*data & 0xFFFF);
outw(value, ADDR_CHAN_REG(REG_C0L, subdev_channel));
break;
default: // Impossible
#define ISR_ADC_DONE 0x4
static int s526_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int result = -EINVAL;
* mode.
*/
static int s526_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i;
int chan = CR_CHAN(insn->chanspec);
}
static int s526_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int s526_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int s526_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int s526_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
- sampl_t value;
+ short value;
printk("S526 DIO insn_config\n");
uint32_t I2CAdrs;
/* I2C device address for onboard EEPROM (board rev dependent). */
/* short I2Cards; */
- lsampl_t ao_readback[S626_DAC_CHANNELS];
+ unsigned int ao_readback[S626_DAC_CHANNELS];
};
struct dio_private {
/* ioctl routines */
static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
-/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data); */
+ comedi_insn *insn, unsigned int *data);
+/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data); */
static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_ai_cmd(comedi_device *dev, comedi_subdevice *s);
static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
comedi_cmd *cmd);
static int s626_ai_cancel(comedi_device *dev, comedi_subdevice *s);
static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_dio_set_irq(comedi_device *dev, unsigned int chan);
static int s626_dio_reset_irq(comedi_device *dev, unsigned int gruop,
unsigned int mask);
static int s626_dio_clear_irq(comedi_device *dev);
static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data);
+ comedi_insn *insn, unsigned int *data);
static int s626_ns_to_timer(int *nanosec, int round_mode);
static int s626_ai_load_polllist(uint8_t *ppl, comedi_cmd *cmd);
static int s626_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
unsigned int trignum);
static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG);
-static lsampl_t s626_ai_reg_to_uint(int data);
-/* static lsampl_t s626_uint_to_reg(comedi_subdevice *s, int data); */
+static unsigned int s626_ai_reg_to_uint(int data);
+/* static unsigned int s626_uint_to_reg(comedi_subdevice *s, int data); */
/* end ioctl routines */
return 1;
}
-static lsampl_t s626_ai_reg_to_uint(int data)
+static unsigned int s626_ai_reg_to_uint(int data)
{
- lsampl_t tempdata;
+ unsigned int tempdata;
tempdata = (data >> 18);
if (tempdata & 0x2000)
return tempdata;
}
-/* static lsampl_t s626_uint_to_reg(comedi_subdevice *s, int data){ */
+/* static unsigned int s626_uint_to_reg(comedi_subdevice *s, int data){ */
/* return 0; */
/* } */
int32_t *readaddr;
uint32_t irqtype, irqstatus;
int i = 0;
- sampl_t tempdata;
+ short tempdata;
uint8_t group;
uint16_t irqbit;
/* TO COMPLETE, IF NECESSARY */
static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
return -EINVAL;
}
-/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data) */
+/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,unsigned int *data) */
/* { */
/* register uint8_t i; */
/* register int32_t *readaddr; */
/* } */
static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
uint16_t chan = CR_CHAN(insn->chanspec);
uint16_t range = CR_RANGE(insn->chanspec);
}
static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i;
}
static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i;
* core can convert between insn_bits and insn_read/write */
static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
/* Length of data must be 2 (mask and new data, see below) */
}
static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
switch (data[0]) {
and set the subdevice. To complete with trigger and interrupt
configuration */
static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */
/* index. */
}
static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int n;
}
static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
struct enc_private *k = &encpriv[CR_CHAN(insn->chanspec)];
int port; // /dev/ttyS<port>
int speed; // baudrate
struct file *tty;
- lsampl_t ao_readback[32];
+ unsigned int ao_readback[32];
unsigned char digital_in_mapping[32];
unsigned char digital_out_mapping[32];
unsigned char analog_in_mapping[32];
};
static int serial2002_di_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int serial2002_do_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int serial2002_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int serial2002_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int serial2002_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
struct serial_data {
enum { is_invalid, is_digital, is_channel } kind;
kfree(s->maxdata_list);
}
s->maxdata_list = maxdata_list =
- kmalloc(sizeof(lsampl_t) * s->n_chan,
+ kmalloc(sizeof(unsigned int) * s->n_chan,
GFP_KERNEL);
if (s->range_table_list) {
kfree(s->range_table_list);
}
static int serial2002_di_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan;
}
static int serial2002_do_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan;
}
static int serial2002_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan;
}
static int serial2002_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan;
}
static int serial2002_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan = CR_CHAN(insn->chanspec);
}
static int serial2002_ei_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n;
int chan;
struct pci_dev *pci_dev;
/* Used for AO readback */
- lsampl_t ao_readback[2];
+ unsigned int ao_readback[2];
} skel_private;
/*
* most drivers define the following macro to make it easy to
};
static int skel_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int skel_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int skel_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int skel_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int skel_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int skel_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd);
static int skel_ns_to_timer(unsigned int *ns, int round);
* mode.
*/
static int skel_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int n, i;
unsigned int d;
}
static int skel_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int skel_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int skel_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
return -EINVAL;
}
static int skel_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int chan = CR_CHAN(insn->chanspec);
COMEDI_INITCLEANUP(driver_dnp);
static int dnp_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
static int dnp_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data);
/* ------------------------------------------------------------------------- */
/* Attach is called by comedi core to configure the driver for a particular */
/* ------------------------------------------------------------------------- */
static int dnp_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
if (insn->n != 2)
/* ------------------------------------------------------------------------- */
static int dnp_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+ comedi_subdevice * s, comedi_insn * insn, unsigned int * data)
{
u8 register_buffer;
static int unioxx5_attach(comedi_device * dev, comedi_devconfig * it);
static int unioxx5_subdev_write(comedi_device * dev, comedi_subdevice * subdev,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int unioxx5_subdev_read(comedi_device * dev, comedi_subdevice * subdev,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int unioxx5_insn_config(comedi_device * dev, comedi_subdevice * subdev,
- comedi_insn * insn, lsampl_t * data);
+ comedi_insn * insn, unsigned int * data);
static int unioxx5_detach(comedi_device * dev);
static int __unioxx5_subdev_init(comedi_subdevice * subdev, int subdev_iobase,
int minor);
-static int __unioxx5_digital_write(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_digital_write(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor);
-static int __unioxx5_digital_read(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_digital_read(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor);
//static void __unioxx5_digital_config(unioxx5_subd_priv* usp, int mode);
-static int __unioxx5_analog_write(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_analog_write(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor);
-static int __unioxx5_analog_read(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_analog_read(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor);
static int __unioxx5_define_chan_offset(int chan_num);
static void __unioxx5_analog_config(unioxx5_subd_priv * usp, int channel);
}
static int unioxx5_subdev_read(comedi_device * dev, comedi_subdevice * subdev,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unioxx5_subd_priv *usp = subdev->private;
int channel, type;
}
static int unioxx5_subdev_write(comedi_device * dev, comedi_subdevice * subdev,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
unioxx5_subd_priv *usp = subdev->private;
int channel, type;
/* for digital modules only */
static int unioxx5_insn_config(comedi_device * dev, comedi_subdevice * subdev,
- comedi_insn * insn, lsampl_t * data)
+ comedi_insn * insn, unsigned int * data)
{
int channel_offset, flags, channel = CR_CHAN(insn->chanspec), type;
unioxx5_subd_priv *usp = subdev->private;
return 0;
}
-static int __unioxx5_digital_write(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_digital_write(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor)
{
int channel_offset, val;
}
/* function for digital reading */
-static int __unioxx5_digital_read(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_digital_read(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor)
{
int channel_offset, mask = 1 << (channel & 0x07);
}
#endif
-static int __unioxx5_analog_write(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_analog_write(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor)
{
int module, i;
return 1;
}
-static int __unioxx5_analog_read(unioxx5_subd_priv * usp, lsampl_t * data,
+static int __unioxx5_analog_read(unioxx5_subd_priv * usp, unsigned int * data,
int channel, int minor)
{
int module_no, read_ch;
/* pwm-transfer handling */
struct urb *urbPwm;
/* PWM period */
- lsampl_t pwmPeriod;
+ unsigned int pwmPeriod;
/* PWM internal delay for the GPIF in the FX2 */
int8_t pwmDelay;
/* size of the PWM buffer which holds the bit pattern */
((uint8_t *) (urb->transfer_buffer))[0] =
s->async->cmd.chanlist_len;
for (i = 0; i < s->async->cmd.chanlist_len; i++) {
- sampl_t temp;
+ short temp;
if (i >= NUMOUTCHANNELS)
break;
/* Mode 0 is used to get a single conversion on demand */
static int usbdux_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i;
- lsampl_t one = 0;
+ unsigned int one = 0;
int chan, range;
int err;
struct usbduxsub *this_usbduxsub = dev->private;
/* analog out */
static int usbdux_ao_insn_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
}
static int usbdux_ao_insn_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int i, err;
int chan = CR_CHAN(insn->chanspec);
}
static int usbdux_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
}
static int usbdux_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
/* reads the 4 counters, only two are used just now */
static int usbdux_counter_read(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
int chan = insn->chanspec;
}
static int usbdux_counter_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
int err;
}
static int usbdux_counter_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
/* nothing to do so far */
return 2;
}
static int usbdux_pwm_period(comedi_device *dev, comedi_subdevice *s,
- lsampl_t period)
+ unsigned int period)
{
struct usbduxsub *this_usbduxsub = dev->private;
int fx2delay = 255;
/* generates the bit pattern for PWM with the optional sign bit */
static int usbdux_pwm_pattern(comedi_device *dev, comedi_subdevice *s,
- int channel, lsampl_t value, lsampl_t sign)
+ int channel, unsigned int value, unsigned int sign)
{
struct usbduxsub *this_usbduxsub = dev->private;
int i, szbuf;
}
static int usbdux_pwm_write(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
}
static int usbdux_pwm_read(comedi_device *x1, comedi_subdevice *x2,
- comedi_insn *x3, lsampl_t *x4)
+ comedi_insn *x3, unsigned int *x4)
{
/* not needed */
return -EINVAL;
/* switches on/off PWM */
static int usbdux_pwm_config(comedi_device *dev, comedi_subdevice *s,
- comedi_insn *insn, lsampl_t *data)
+ comedi_insn *insn, unsigned int *data)
{
struct usbduxsub *this_usbduxsub = dev->private;
switch (data[0]) {
* Mode 0 is used to get a single conversion on demand.
*/
static int usbduxfast_ai_insn_read(comedi_device *dev,
- comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
+ comedi_subdevice *s, comedi_insn *insn, unsigned int *data)
{
int i, j, n, actual_length;
int chan, range, rngmask;
#include <linux/string.h>
int comedi_data_write(void *dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t data)
+ unsigned int range, unsigned int aref, unsigned int data)
{
comedi_insn insn;
}
int comedi_data_read(void *dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t *data)
+ unsigned int range, unsigned int aref, unsigned int *data)
{
comedi_insn insn;
unsigned int chan, unsigned int range, unsigned int aref)
{
comedi_insn insn;
- lsampl_t dummy_data;
+ unsigned int dummy_data;
memset(&insn, 0, sizeof(insn));
insn.insn = INSN_READ;
int comedi_data_read_delayed(void *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref,
- lsampl_t *data, unsigned int nano_sec)
+ unsigned int *data, unsigned int nano_sec)
{
int retval;
unsigned int *bits)
{
comedi_insn insn;
- lsampl_t data[2];
+ unsigned int data[2];
int ret;
memset(&insn, 0, sizeof(insn));
return s->len_chanlist;
}
-lsampl_t comedi_get_maxdata(void *d, unsigned int subdevice,
+unsigned int comedi_get_maxdata(void *d, unsigned int subdevice,
unsigned int chan)
{
comedi_device *dev = (comedi_device *) d;