linux/drivers/comedi/drivers/dt2811.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Comedi driver for Data Translation DT2811
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) David A. Schleef <[email protected]>
 */

/*
 * Driver: dt2811
 * Description: Data Translation DT2811
 * Author: ds
 * Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh)
 * Status: works
 *
 * Configuration options:
 *   [0] - I/O port base address
 *   [1] - IRQ (optional, needed for async command support)
 *   [2] - A/D reference (# of analog inputs)
 *	   0 = single-ended (16 channels)
 *	   1 = differential (8 channels)
 *	   2 = pseudo-differential (16 channels)
 *   [3] - A/D range (deprecated, see below)
 *   [4] - D/A 0 range (deprecated, see below)
 *   [5] - D/A 1 range (deprecated, see below)
 *
 * Notes:
 *   - A/D ranges are not programmable but the gain is. The AI subdevice has
 *     a range_table containing all the possible analog input range/gain
 *     options for the dt2811-pgh or dt2811-pgl. Use the range that matches
 *     your board configuration and the desired gain to correctly convert
 *     between data values and physical units and to set the correct output
 *     gain.
 *   - D/A ranges are not programmable. The AO subdevice has a range_table
 *     containing all the possible analog output ranges. Use the range
 *     that matches your board configuration to convert between data
 *     values and physical units.
 */

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/comedi/comedidev.h>

/*
 * Register I/O map
 */
#define DT2811_ADCSR_REG
#define DT2811_ADCSR_ADDONE
#define DT2811_ADCSR_ADERROR
#define DT2811_ADCSR_ADBUSY
#define DT2811_ADCSR_CLRERROR
#define DT2811_ADCSR_DMAENB
#define DT2811_ADCSR_INTENB
#define DT2811_ADCSR_ADMODE(x)

#define DT2811_ADGCR_REG
#define DT2811_ADGCR_GAIN(x)
#define DT2811_ADGCR_CHAN(x)

#define DT2811_ADDATA_LO_REG
#define DT2811_ADDATA_HI_REG

#define DT2811_DADATA_LO_REG(x)
#define DT2811_DADATA_HI_REG(x)

#define DT2811_DI_REG
#define DT2811_DO_REG

#define DT2811_TMRCTR_REG
#define DT2811_TMRCTR_MANTISSA(x)
#define DT2811_TMRCTR_EXPONENT(x)

#define DT2811_OSC_BASE

/*
 * Timer frequency control:
 *   DT2811_TMRCTR_MANTISSA	DT2811_TMRCTR_EXPONENT
 *   val  divisor  frequency	val  multiply divisor/divide frequency by
 *    0      1      600 kHz	 0   1
 *    1     10       60 kHz	 1   10
 *    2      2      300 kHz	 2   100
 *    3      3      200 kHz	 3   1000
 *    4      4      150 kHz	 4   10000
 *    5      5      120 kHz	 5   100000
 *    6      6      100 kHz	 6   1000000
 *    7     12       50 kHz	 7   10000000
 */
static const unsigned int dt2811_clk_dividers[] =;

static const unsigned int dt2811_clk_multipliers[] =;

/*
 * The Analog Input range is set using jumpers on the board.
 *
 * Input Range		W9  W10
 * -5V to +5V		In  Out
 * -2.5V to +2.5V	In  In
 * 0V to +5V		Out In
 *
 * The gain may be set to 1, 2, 4, or 8 (on the dt2811-pgh) or to
 * 1, 10, 100, 500 (on the dt2811-pgl).
 */
static const struct comedi_lrange dt2811_pgh_ai_ranges =;

static const struct comedi_lrange dt2811_pgl_ai_ranges =;

/*
 * The Analog Output range is set per-channel using jumpers on the board.
 *
 *			DAC0 Jumpers		DAC1 Jumpers
 * Output Range		W5  W6  W7  W8		W1  W2  W3  W4
 * -5V to +5V		In  Out In  Out		In  Out In  Out
 * -2.5V to +2.5V	In  Out Out In		In  Out Out In
 * 0 to +5V		Out In  Out In		Out In  Out In
 */
static const struct comedi_lrange dt2811_ao_ranges =;

struct dt2811_board {};

static const struct dt2811_board dt2811_boards[] =;

struct dt2811_private {};

static unsigned int dt2811_ai_read_sample(struct comedi_device *dev,
					  struct comedi_subdevice *s)
{}

static irqreturn_t dt2811_interrupt(int irq, void *d)
{}

static int dt2811_ai_cancel(struct comedi_device *dev,
			    struct comedi_subdevice *s)
{}

static void dt2811_ai_set_chanspec(struct comedi_device *dev,
				   unsigned int chanspec)
{}

static int dt2811_ai_cmd(struct comedi_device *dev,
			 struct comedi_subdevice *s)
{}

static unsigned int dt2811_ns_to_timer(unsigned int *nanosec,
				       unsigned int flags)
{}

static int dt2811_ai_cmdtest(struct comedi_device *dev,
			     struct comedi_subdevice *s,
			     struct comedi_cmd *cmd)
{}

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

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

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

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

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

static void dt2811_reset(struct comedi_device *dev)
{}

static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{}

static struct comedi_driver dt2811_driver =;
module_comedi_driver();

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