33 #include "../comedidev.h"
37 #define MULTIQ3_SIZE 16
42 #define MULTIQ3_DIGIN_PORT 0
43 #define MULTIQ3_DIGOUT_PORT 0
44 #define MULTIQ3_DAC_DATA 2
45 #define MULTIQ3_AD_DATA 4
46 #define MULTIQ3_AD_CS 4
47 #define MULTIQ3_STATUS 6
48 #define MULTIQ3_CONTROL 6
49 #define MULTIQ3_CLK_DATA 8
50 #define MULTIQ3_ENC_DATA 12
51 #define MULTIQ3_ENC_CONTROL 14
56 #define MULTIQ3_AD_MUX_EN 0x0040
57 #define MULTIQ3_AD_AUTOZ 0x0080
58 #define MULTIQ3_AD_AUTOCAL 0x0100
59 #define MULTIQ3_AD_SH 0x0200
60 #define MULTIQ3_AD_CLOCK_4M 0x0400
61 #define MULTIQ3_DA_LOAD 0x1800
63 #define MULTIQ3_CONTROL_MUST 0x0600
68 #define MULTIQ3_STATUS_EOC 0x008
69 #define MULTIQ3_STATUS_EOC_I 0x010
74 #define MULTIQ3_CLOCK_DATA 0x00
75 #define MULTIQ3_CLOCK_SETUP 0x18
76 #define MULTIQ3_INPUT_SETUP 0x41
77 #define MULTIQ3_QUAD_X4 0x38
78 #define MULTIQ3_BP_RESET 0x01
79 #define MULTIQ3_CNTR_RESET 0x02
80 #define MULTIQ3_TRSFRPR_CTR 0x08
81 #define MULTIQ3_TRSFRCNTR_OL 0x10
82 #define MULTIQ3_EFLAG_RESET 0x06
84 #define MULTIQ3_TIMEOUT 30
89 #define devpriv ((struct multiq3_private *)dev->private)
107 if (i == MULTIQ3_TIMEOUT)
110 for (n = 0; n < insn->
n; n++) {
117 if (i == MULTIQ3_TIMEOUT)
122 data[
n] = (((hi << 8) | lo) + 0x1000) & 0x1fff;
135 for (i = 0; i < insn->
n; i++)
136 data[i] =
devpriv->ao_readback[chan];
148 for (i = 0; i < insn->
n; i++) {
154 devpriv->ao_readback[chan] = data[
i];
173 s->
state &= ~data[0];
174 s->
state |= (data[0] & data[1]);
182 static int multiq3_encoder_insn_read(
struct comedi_device *dev,
191 for (n = 0; n < insn->
n; n++) {
199 data[
n] = (value + 0x800000) & 0xffffff;
210 for (chan = 0; chan < s->
n_chan; chan++) {
306 s->
insn_read = multiq3_encoder_insn_read;
324 .driver_name =
"multiq3",
326 .attach = multiq3_attach,
327 .detach = multiq3_detach,