/*
* PCI BAR4 Register map (devpriv->pcibar4)
*/
-
-/* analog output registers for 100x, 1200 series */
-static inline unsigned int DAC_DATA_REG(unsigned int channel)
-{
- return 2 * (channel & 0x1);
-}
-
-/* analog output registers for 1602 series*/
-#define DACDATA 0 /* DAC DATA register */
-#define DACFIFOCLR 2 /* DAC FIFO CLEAR */
+#define PCIDAS_AO_DATA_REG(x) (0x00 + ((x) * 2))
+#define PCIDAS_AO_FIFO_REG 0x00
+#define PCIDAS_AO_FIFO_CLR_REG 0x02
#define IS_UNIPOLAR 0x4 /* unipolar range mask */
s->readback[chan] = data[0];
/* send data */
- outw(data[0], devpriv->pcibar4 + DAC_DATA_REG(chan));
+ outw(data[0], devpriv->pcibar4 + PCIDAS_AO_DATA_REG(chan));
return insn->n;
}
unsigned long flags;
/* clear dac fifo */
- outw(0, devpriv->pcibar4 + DACFIFOCLR);
+ outw(0, devpriv->pcibar4 + PCIDAS_AO_FIFO_CLR_REG);
/* set channel and range */
spin_lock_irqsave(&dev->spinlock, flags);
s->readback[chan] = data[0];
/* send data */
- outw(data[0], devpriv->pcibar4 + DACDATA);
+ outw(data[0], devpriv->pcibar4 + PCIDAS_AO_FIFO_REG);
return insn->n;
}
nbytes = comedi_buf_read_samples(s, devpriv->ao_buffer, nsamples);
nsamples = comedi_bytes_to_samples(s, nbytes);
- outsw(devpriv->pcibar4 + DACDATA, devpriv->ao_buffer, nsamples);
+ outsw(devpriv->pcibar4 + PCIDAS_AO_FIFO_REG,
+ devpriv->ao_buffer, nsamples);
}
static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
spin_unlock_irqrestore(&dev->spinlock, flags);
/* clear fifo */
- outw(0, devpriv->pcibar4 + DACFIFOCLR);
+ outw(0, devpriv->pcibar4 + PCIDAS_AO_FIFO_CLR_REG);
/* load counters */
if (cmd->scan_begin_src == TRIG_TIMER) {