comedi_cmd *cmd = &async->cmd;
unsigned int byte;
unsigned long flags;
+ int range;
if(dev->irq == 0 || devpriv->dma_chan == 0)
{
devpriv->adc_count = cmd->stop_arg * cmd->chanlist_len;
+ // disable conversions for das1600 mode
+ if(thisboard->size > 0x400)
+ {
+ outb(DAS1600_CONV_DISABLE, dev->iobase + DAS1600_CONV);
+ }
+
// set scan limits
byte = CR_CHAN(cmd->chanlist[0]);
byte |= CR_CHAN(cmd->chanlist[cmd->chanlist_len - 1]) << 4;
outb(byte, dev->iobase + DAS16_MUX);
+ /* set gain (this is also burst rate register but according to
+ * computer boards manual, burst rate does nothing, even on keithley cards) */
+ if(thisboard->ai_pg != das16_pg_none){
+ range = CR_RANGE(cmd->chanlist[0]);
+ outb((das16_gainlists[thisboard->ai_pg])[range],
+ dev->iobase+DAS16_GAIN);
+ }
/* set counter mode and counts */
cmd->convert_arg = das16_set_pacer(dev, cmd->convert_arg, cmd->flags & TRIG_ROUND_MASK);
if(devpriv->dma_chan)
disable_dma(devpriv->dma_chan);
- // disable conversions for das1600 mode
+ /* disable burst mode */
if(thisboard->size > 0x400)
{
- outb(DAS1600_CONV_DISABLE, dev->iobase + DAS1600_CONV);
+ outb(0, dev->iobase + DAS1600_BURST);
}
return 0;
if(thisboard->size > 0x400)
{
outb(DAS1600_ENABLE_VAL, dev->iobase + DAS1600_ENABLE);
- outb(DAS1600_CONV_DISABLE, dev->iobase + DAS1600_CONV);
+ outb(0, dev->iobase + DAS1600_CONV);
outb(0, dev->iobase + DAS1600_BURST);
}
static int das16m1_cmd_exec(comedi_device *dev,comedi_subdevice *s)
{
- comedi_cmd *cmd = &s->async->cmd;
+ comedi_async *async = s->async;
+ comedi_cmd *cmd = &async->cmd;
unsigned int byte, i;
if(dev->irq == 0)
/* set counter mode and counts */
cmd->convert_arg = das16m1_set_pacer(dev, cmd->convert_arg, cmd->flags & TRIG_ROUND_MASK);
+ async->events = 0;
+
// set control & status register
byte = 0;
/* if we are using external start trigger (also board dislikes having
startChan = CR_CHAN(cmd->chanlist[0]);
for(i = 1; i < cmd->chanlist_len; i++)
{
- if(CR_CHAN(cmd->chanlist[i]) != (startChan + i) % N_CHAN_AI)
+ if(CR_CHAN(cmd->chanlist[i]) != (startChan + i) % N_CHAN_AI)
{
comedi_error(dev, "entries in chanlist must be consecutive channels, counting upwards\n");
err++;
outb(CONV_CONTROL, dev->iobase + DAS800_GAIN); /* select dev->iobase + 2 to be conversion control register */
outb(conv_bits, dev->iobase + DAS800_CONV_CONTROL);
comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
-
+ async->events = 0;
enable_das800(dev);
return 0;
}
int n_bits;
int (*winsn)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
int (*rinsn)(comedi_device *,comedi_subdevice *,comedi_insn *,lsampl_t *);
+ comedi_lrange* range;
};
static struct boarddef_struct boards[]={
{
n_bits: 12,
winsn: dac02_ao_winsn,
rinsn: readback_insn,
+ range: &range_unknown,
}
};
#define n_boards (sizeof(boards)/sizeof(boards[0]))
offset: sizeof(boards[0]),
};
-// analog output ranges
-static comedi_lrange range_dac02 = {
- 4,
- {
- RANGE( -5, 5 ),
- RANGE( -10, 10 ),
- RANGE( 0, 5 ),
- RANGE( 0, 10 ),
- }
-};
-
static int poc_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
s->type = this_board->type;
s->n_chan = this_board->n_chan;
s->maxdata = (1<<this_board->n_bits)-1;
- s->range_table = &range_dac02; // XXX
+ s->range_table = this_board->range;
s->insn_write = this_board->winsn;
s->insn_read = this_board->rinsn;
if(s->type==COMEDI_SUBD_AO || s->type==COMEDI_SUBD_DO){