59 #include "../comedidev.h"
65 range_dt2815_ao_32_current = {1, {
RANGE_mA(0, 32)} };
68 range_dt2815_ao_20_current = {1, {
RANGE_mA(4, 20)} };
73 #define DT2815_STATUS 1
81 #define devpriv ((struct dt2815_private *)dev->private)
87 for (i = 0; i < 100; i++) {
101 for (i = 0; i < insn->
n; i++)
102 data[i] =
devpriv->ao_readback[chan];
115 for (i = 0; i < insn->
n; i++) {
116 lo = ((data[
i] & 0x0f) << 4) | (chan << 1) | 0x01;
117 hi = (data[
i] & 0xff0) >> 4;
119 status = dt2815_wait_for_status(dev, 0x00);
122 "on %d reason %x\n", chan, status);
128 status = dt2815_wait_for_status(dev, 0x10);
129 if (status != 0x10) {
131 "on %d reason %x\n", chan, status);
134 devpriv->ao_readback[chan] = data[
i];
167 const struct comedi_lrange *current_range_type, *voltage_range_type;
198 current_range_type = (it->
options[3])
199 ? &range_dt2815_ao_20_current : &range_dt2815_ao_32_current;
200 voltage_range_type = (it->
options[2])
202 for (i = 0; i < 8; i++) {
204 ? current_range_type : voltage_range_type;
209 for (i = 0; i < 100; i++) {
216 unsigned int program;
217 program = (it->
options[4] & 0x3) << 3 | 0x7;
222 }
else if (status != 0x00) {
224 "(@t=%d)\n", status, i);
240 .driver_name =
"dt2815",
242 .attach = dt2815_attach,
243 .detach = dt2815_detach,