linux/drivers/comedi/drivers/adv_pci1724.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * adv_pci1724.c
 * Comedi driver for the Advantech PCI-1724U card.
 *
 * Author:  Frank Mori Hess <[email protected]>
 * Copyright (C) 2013 GnuBIO Inc
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 1997-8 David A. Schleef <[email protected]>
 */

/*
 * Driver: adv_pci1724
 * Description: Advantech PCI-1724U
 * Devices: [Advantech] PCI-1724U (adv_pci1724)
 * Author: Frank Mori Hess <[email protected]>
 * Updated: 2013-02-09
 * Status: works
 *
 * Configuration Options: not applicable, uses comedi PCI auto config
 *
 * Subdevice 0 is the analog output.
 * Subdevice 1 is the offset calibration for the analog output.
 * Subdevice 2 is the gain calibration for the analog output.
 *
 * The calibration offset and gains have quite a large effect on the
 * analog output, so it is possible to adjust the analog output to
 * have an output range significantly different from the board's
 * nominal output ranges. For a calibrated +/-10V range, the analog
 * output's offset will be set somewhere near mid-range (0x2000) and
 * its gain will be near maximum (0x3fff).
 *
 * There is really no difference between the board's documented 0-20mA
 * versus 4-20mA output ranges. To pick one or the other is simply a
 * matter of adjusting the offset and gain calibration until the board
 * outputs in the desired range.
 */

#include <linux/module.h>
#include <linux/comedi/comedi_pci.h>

/*
 * PCI bar 2 Register I/O map (dev->iobase)
 */
#define PCI1724_DAC_CTRL_REG
#define PCI1724_DAC_CTRL_GX(x)
#define PCI1724_DAC_CTRL_CX(x)
#define PCI1724_DAC_CTRL_MODE(x)
#define PCI1724_DAC_CTRL_MODE_GAIN
#define PCI1724_DAC_CTRL_MODE_OFFSET
#define PCI1724_DAC_CTRL_MODE_NORMAL
#define PCI1724_DAC_CTRL_MODE_MASK
#define PCI1724_DAC_CTRL_DATA(x)
#define PCI1724_SYNC_CTRL_REG
#define PCI1724_SYNC_CTRL_DACSTAT
#define PCI1724_SYNC_CTRL_SYN
#define PCI1724_EEPROM_CTRL_REG
#define PCI1724_SYNC_TRIG_REG
#define PCI1724_BOARD_ID_REG
#define PCI1724_BOARD_ID_MASK

static const struct comedi_lrange adv_pci1724_ao_ranges =;

static int adv_pci1724_dac_idle(struct comedi_device *dev,
				struct comedi_subdevice *s,
				struct comedi_insn *insn,
				unsigned long context)
{}

static int adv_pci1724_insn_write(struct comedi_device *dev,
				  struct comedi_subdevice *s,
				  struct comedi_insn *insn,
				  unsigned int *data)
{}

static int adv_pci1724_auto_attach(struct comedi_device *dev,
				   unsigned long context_unused)
{}

static struct comedi_driver adv_pci1724_driver =;

static int adv_pci1724_pci_probe(struct pci_dev *dev,
				 const struct pci_device_id *id)
{}

static const struct pci_device_id adv_pci1724_pci_table[] =;
MODULE_DEVICE_TABLE(pci, adv_pci1724_pci_table);

static struct pci_driver adv_pci1724_pci_driver =;
module_comedi_pci_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();