Lines Matching +full:c +full:- +full:22
1 // SPDX-License-Identifier: GPL-2.0+
3 * dac02.c
5 * Copyright (C) 2014 H Hartley Sweeten <hsweeten@visionengravers.com>
8 * Copyright (C) 2000 Frank Mori Hess <fmhess@users.sourceforge.net>
9 * Copyright (C) 2001 David A. Schleef <ds@schleef.org>
11 * COMEDI - Linux Control and Measurement Device Interface
12 * Copyright (C) 1998 David A. Schleef <ds@schleef.org>
18 * Devices: [Keithley Metrabyte] DAC-02 (dac02)
20 * Updated: Tue, 11 Mar 2014 11:27:19 -0700
24 * [0] - I/O port base
34 * ------------- ------ ------------- -----------------
35 * 0 to 5V 0 21 to 22 24
37 * 0 to 10V 0 20 to 22 24
39 * +/-5V 0 21 to 22 23
41 * +/-10V 0 20 to 22 23
43 * 4 to 20mA 0 21 to 22 25
45 * AC reference 0 In on pin 22 24 (2-quadrant)
46 * In on pin 22 23 (4-quadrant)
47 * 1 In on pin 16 18 (2-quadrant)
48 * In on pin 16 17 (4-quadrant)
72 unsigned int chan = CR_CHAN(insn->chanspec); in dac02_ao_insn_write()
73 unsigned int range = CR_RANGE(insn->chanspec); in dac02_ao_insn_write()
77 for (i = 0; i < insn->n; i++) { in dac02_ao_insn_write()
80 s->readback[chan] = val; in dac02_ao_insn_write()
85 * (that is, 0 = +full scale, maxdata = -full scale). in dac02_ao_insn_write()
88 val = s->maxdata - val; in dac02_ao_insn_write()
91 * DACs are double-buffered. in dac02_ao_insn_write()
94 outb((val << 4) & 0xf0, dev->iobase + DAC02_AO_LSB(chan)); in dac02_ao_insn_write()
95 outb((val >> 4) & 0xff, dev->iobase + DAC02_AO_MSB(chan)); in dac02_ao_insn_write()
98 return insn->n; in dac02_ao_insn_write()
106 ret = comedi_request_region(dev, it->options[0], 0x08); in dac02_attach()
115 s = &dev->subdevices[0]; in dac02_attach()
116 s->type = COMEDI_SUBD_AO; in dac02_attach()
117 s->subdev_flags = SDF_WRITABLE; in dac02_attach()
118 s->n_chan = 2; in dac02_attach()
119 s->maxdata = 0x0fff; in dac02_attach()
120 s->range_table = &das02_ao_ranges; in dac02_attach()
121 s->insn_write = dac02_ao_insn_write; in dac02_attach()