49 #include "../comedidev.h"
55 static const struct comedi_lrange range_dt2811_pgh_ai_5_unipolar = {
64 static const struct comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = {
69 RANGE(-0.3125, 0.3125)
73 static const struct comedi_lrange range_dt2811_pgh_ai_5_bipolar = {
82 static const struct comedi_lrange range_dt2811_pgl_ai_5_unipolar = {
91 static const struct comedi_lrange range_dt2811_pgl_ai_2_5_bipolar = {
100 static const struct comedi_lrange range_dt2811_pgl_ai_5_bipolar = {
178 #define TIMEOUT 10000
180 #define DT2811_SIZE 8
182 #define DT2811_ADCSR 0
183 #define DT2811_ADGCR 1
184 #define DT2811_ADDATLO 2
185 #define DT2811_ADDATHI 3
186 #define DT2811_DADAT0LO 2
187 #define DT2811_DADAT0HI 3
188 #define DT2811_DADAT1LO 4
189 #define DT2811_DADAT1HI 5
191 #define DT2811_TMRCTR 7
199 #define DT2811_ADDONE 0x80
200 #define DT2811_ADERROR 0x40
201 #define DT2811_ADBUSY 0x20
202 #define DT2811_CLRERROR 0x10
203 #define DT2811_INTENB 0x04
204 #define DT2811_ADMODE 0x03
229 #define devpriv ((struct dt2811_private *)dev->private)
237 #define DT2811_TIMEOUT 5
254 data = lo + (hi << 8);
258 s->async->events |= COMEDI_SB_EOA;
272 for (i = 0; i < insn->
n; i++) {
292 int dt2811_adtrig(kdev_t
minor, comedi_adtrig *adtrig)
298 dev->curadchan = adtrig->chan;
299 switch (dev->i_admode) {
301 dev->ntrig = adtrig->n - 1;
310 dev->ntrig = adtrig->n;
326 for (i = 0; i < insn->
n; i++) {
328 outb((data[i] >> 8) & 0xff,
330 devpriv->ao_readback[chan] = data[
i];
345 for (i = 0; i < insn->
n; i++)
346 data[i] =
devpriv->ao_readback[chan];
364 s->
state &= ~data[0];
365 s->
state |= data[0] & data[1];
437 restore_flags(
flags);
454 }
else if (irq == 0) {
472 devpriv->adc_mux = adc_singleended;
478 devpriv->adc_mux = adc_pseudo_diff;
481 devpriv->adc_mux = adc_singleended;
486 devpriv->dac_range[0] = dac_bipolar_5;
489 devpriv->dac_range[0] = dac_bipolar_2_5;
492 devpriv->dac_range[0] = dac_unipolar_5;
495 devpriv->dac_range[0] = dac_bipolar_5;
500 devpriv->dac_range[1] = dac_bipolar_5;
503 devpriv->dac_range[1] = dac_bipolar_2_5;
506 devpriv->dac_range[1] = dac_unipolar_5;
509 devpriv->dac_range[1] = dac_bipolar_5;
542 devpriv->range_type_list[0] = dac_range_types[
devpriv->dac_range[0]];
543 devpriv->range_type_list[1] = dac_range_types[
devpriv->dac_range[1]];
577 .name =
"dt2811-pgh",
578 .bip_5 = &range_dt2811_pgh_ai_5_bipolar,
579 .bip_2_5 = &range_dt2811_pgh_ai_2_5_bipolar,
580 .unip_5 = &range_dt2811_pgh_ai_5_unipolar,
582 .name =
"dt2811-pgl",
583 .bip_5 = &range_dt2811_pgl_ai_5_bipolar,
584 .bip_2_5 = &range_dt2811_pgl_ai_2_5_bipolar,
585 .unip_5 = &range_dt2811_pgl_ai_5_unipolar,
590 .driver_name =
"dt2811",
592 .attach = dt2811_attach,
593 .detach = dt2811_detach,
594 .board_name = &boardtypes[0].
name,