// SPDX-License-Identifier: GPL-2.0+ /* * adq12b.c * Driver for MicroAxial ADQ12-B data acquisition and control card * written by jeremy theler <[email protected]> * instituto balseiro * commission nacional de energia atomica * universidad nacional de cuyo * argentina * * COMEDI - Linux Control and Measurement Device Interface * Copyright (C) 2000 David A. Schleef <[email protected]> */ /* * Driver: adq12b * Description: Driver for MicroAxial ADQ12-B data acquisition and control card * Devices: [MicroAxial] ADQ12-B (adq12b) * Author: jeremy theler <[email protected]> * Updated: Thu, 21 Feb 2008 02:56:27 -0300 * Status: works * * Configuration options: * [0] - I/O base address (set with hardware jumpers) * address jumper JADR * 0x300 1 (factory default) * 0x320 2 * 0x340 3 * 0x360 4 * 0x380 5 * 0x3A0 6 * [1] - Analog Input unipolar/bipolar selection * selection option JUB * bipolar 0 2-3 (factory default) * unipolar 1 1-2 * [2] - Analog Input single-ended/differential selection * selection option JCHA JCHB * single-ended 0 1-2 1-2 (factory default) * differential 1 2-3 2-3 * * Driver for the acquisition card ADQ12-B (without any add-on). * * - Analog input is subdevice 0 (16 channels single-ended or 8 differential) * - Digital input is subdevice 1 (5 channels) * - Digital output is subdevice 1 (8 channels) * - The PACER is not supported in this version */ #include <linux/module.h> #include <linux/delay.h> #include <linux/comedi/comedidev.h> /* address scheme (page 2.17 of the manual) */ #define ADQ12B_CTREG … #define ADQ12B_CTREG_MSKP … #define ADQ12B_CTREG_GTP … #define ADQ12B_CTREG_RANGE(x) … #define ADQ12B_CTREG_CHAN(x) … #define ADQ12B_STINR … #define ADQ12B_STINR_OUT2 … #define ADQ12B_STINR_OUTP … #define ADQ12B_STINR_EOC … #define ADQ12B_STINR_IN_MASK … #define ADQ12B_OUTBR … #define ADQ12B_ADLOW … #define ADQ12B_ADHIG … #define ADQ12B_TIMER_BASE … /* available ranges through the PGA gains */ static const struct comedi_lrange range_adq12b_ai_bipolar = …; static const struct comedi_lrange range_adq12b_ai_unipolar = …; struct adq12b_private { … }; static int adq12b_ai_eoc(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned long context) { … } static int adq12b_ai_insn_read(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { … } static int adq12b_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { … } static int adq12b_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { … } static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) { … } static struct comedi_driver adq12b_driver = …; module_comedi_driver(…); MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …;