static int cb_pcidas_ai_cmdtest(comedi_device *dev,comedi_subdevice *s,
comedi_cmd *cmd);
static int cb_pcidas_ao_cmd(comedi_device *dev,comedi_subdevice *s);
+static int cb_pcidas_ao_inttrig(comedi_device *dev, comedi_subdevice *subdev, unsigned int trig_num);
static int cb_pcidas_ao_cmdtest(comedi_device *dev,comedi_subdevice *s,
comedi_cmd *cmd);
static void cb_pcidas_interrupt(int irq, void *d, struct pt_regs *regs);
}
// 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)
{
/* step 1: make sure trigger sources are trivially valid */
tmp = cmd->start_src;
- cmd->start_src &= TRIG_NOW;
+ cmd->start_src &= TRIG_INT;
if(!cmd->start_src || tmp != cmd->start_src)
err++;
// clear fifo
outw(0, devpriv->ao_registers + DACFIFOCLR);
- // next time we send these bits, we want aquisiton to actually start
- ao_control_bits |= DAC_START | DACEN | DAC_EMPTY;
-
// load counters
if(cmd->scan_begin_src == TRIG_TIMER)
{
break;
}
+ // next time we send these bits, we want aquisiton to actually start
+ ao_control_bits |= DAC_START | DACEN | DAC_EMPTY;
+ devpriv->ao_control_bits = ao_control_bits;
+ async->inttrig = cb_pcidas_ao_inttrig;
+
+ return 0;
+}
+
+static int cb_pcidas_ao_inttrig(comedi_device *dev, comedi_subdevice *s, unsigned int trig_num)
+{
+ if(trig_num != 0)
+ return -EINVAL;
+
// enable dac half-full and empty interrupts
devpriv->adc_fifo_bits |= DAEMIE | DAHFIE;
#ifdef CB_PCIDAS_DEBUG
outl(devpriv->s5933_intcsr_bits, devpriv->s5933_config + INTCSR);
// start dac
- devpriv->ao_control_bits = ao_control_bits;
outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR);
#ifdef CB_PCIDAS_DEBUG
- rt_printk("comedi: sent 0x%x to dac control\n", ao_control_bits);
+ rt_printk("comedi: sent 0x%x to dac control\n", devpriv->ao_control_bits);
#endif
+ s->async->inttrig = NULL;
+
return 0;
}