const char *name;
unsigned char id;
int ai_speed; /* max conversion period in nanoseconds */
- int resolution; /* bits of ai resolution */
int qram_len; /* length of card's channel / gain queue */
int do_n_chan; /* number of digital output channels */
int ao_ability; /* 0 == no analog out, 1 == basic analog out, 2 == waveform analog out */
.name = "das-1701st",
.id = DAS1800_ID_ST,
.ai_speed = 6250,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 0,
.name = "das-1701st-da",
.id = DAS1800_ID_ST_DA,
.ai_speed = 6250,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 1,
.name = "das-1702st",
.id = DAS1800_ID_ST,
.ai_speed = 6250,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 0,
.name = "das-1702st-da",
.id = DAS1800_ID_ST_DA,
.ai_speed = 6250,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 1,
.name = "das-1702hr",
.id = DAS1800_ID_HR,
.ai_speed = 20000,
- .resolution = 16,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 0,
.name = "das-1702hr-da",
.id = DAS1800_ID_HR_DA,
.ai_speed = 20000,
- .resolution = 16,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 1,
.name = "das-1701ao",
.id = DAS1800_ID_AO,
.ai_speed = 6250,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 2,
.name = "das-1702ao",
.id = DAS1800_ID_AO,
.ai_speed = 6250,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 2,
.name = "das-1801st",
.id = DAS1800_ID_ST,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 0,
.name = "das-1801st-da",
.id = DAS1800_ID_ST_DA,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 1,
.name = "das-1802st",
.id = DAS1800_ID_ST,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 0,
.name = "das-1802st-da",
.id = DAS1800_ID_ST_DA,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 1,
.name = "das-1802hr",
.id = DAS1800_ID_HR,
.ai_speed = 10000,
- .resolution = 16,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 0,
.name = "das-1802hr-da",
.id = DAS1800_ID_HR_DA,
.ai_speed = 10000,
- .resolution = 16,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 1,
.name = "das-1801hc",
.id = DAS1800_ID_HC,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 64,
.do_n_chan = 8,
.ao_ability = 1,
.name = "das-1802hc",
.id = DAS1800_ID_HC,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 64,
.do_n_chan = 8,
.ao_ability = 1,
.name = "das-1801ao",
.id = DAS1800_ID_AO,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 2,
.name = "das-1802ao",
.id = DAS1800_ID_AO,
.ai_speed = 3000,
- .resolution = 12,
.qram_len = 256,
.do_n_chan = 4,
.ao_ability = 2,
struct das1800_private *devpriv;
struct comedi_subdevice *s;
unsigned int irq = it->options[1];
+ bool is_16bit;
int ret;
devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
return ret;
board = dev->board_ptr;
+ is_16bit = board->id == DAS1800_ID_HR || board->id == DAS1800_ID_HR_DA;
+
/* if it is an 'ao' board with fancy analog out then we need extra io ports */
if (board->ao_ability == 2) {
unsigned long iobase2 = dev->iobase + IOBASE2;
if (board->id != DAS1800_ID_HC)
s->subdev_flags |= SDF_COMMON;
s->n_chan = board->qram_len;
- s->maxdata = (1 << board->resolution) - 1;
+ s->maxdata = is_16bit ? 0xffff : 0x0fff;
s->range_table = board->range_ai;
s->insn_read = das1800_ai_insn_read;
if (dev->irq) {
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = board->ao_n_chan;
- s->maxdata = (1 << board->resolution) - 1;
+ s->maxdata = is_16bit ? 0xffff : 0x0fff;
s->range_table = &range_bipolar10;
s->insn_write = das1800_ao_insn_write;
} else {