linux/drivers/comedi/drivers/dt2801.c

// SPDX-License-Identifier: GPL-2.0
/*
 * comedi/drivers/dt2801.c
 * Device Driver for DataTranslation DT2801
 *
 */
/*
 * Driver: dt2801
 * Description: Data Translation DT2801 series and DT01-EZ
 * Author: ds
 * Status: works
 * Devices: [Data Translation] DT2801 (dt2801), DT2801-A, DT2801/5716A,
 * DT2805, DT2805/5716A, DT2808, DT2818, DT2809, DT01-EZ
 *
 * This driver can autoprobe the type of board.
 *
 * Configuration options:
 * [0] - I/O port base address
 * [1] - unused
 * [2] - A/D reference 0=differential, 1=single-ended
 * [3] - A/D range
 *	  0 = [-10, 10]
 *	  1 = [0,10]
 * [4] - D/A 0 range
 *	  0 = [-10, 10]
 *	  1 = [-5,5]
 *	  2 = [-2.5,2.5]
 *	  3 = [0,10]
 *	  4 = [0,5]
 * [5] - D/A 1 range (same choices)
 */

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

#define DT2801_TIMEOUT

/* Hardware Configuration */
/* ====================== */

#define DT2801_MAX_DMA_SIZE

/* define's */
/* ====================== */

/* Commands */
#define DT_C_RESET
#define DT_C_CLEAR_ERR
#define DT_C_READ_ERRREG
#define DT_C_SET_CLOCK

#define DT_C_TEST
#define DT_C_STOP

#define DT_C_SET_DIGIN
#define DT_C_SET_DIGOUT
#define DT_C_READ_DIG
#define DT_C_WRITE_DIG

#define DT_C_WRITE_DAIM
#define DT_C_SET_DA
#define DT_C_WRITE_DA

#define DT_C_READ_ADIM
#define DT_C_SET_AD
#define DT_C_READ_AD

/*
 * Command modifiers (only used with read/write), EXTTRIG can be
 * used with some other commands.
 */
#define DT_MOD_DMA
#define DT_MOD_CONT
#define DT_MOD_EXTCLK
#define DT_MOD_EXTTRIG

/* Bits in status register */
#define DT_S_DATA_OUT_READY
#define DT_S_DATA_IN_FULL
#define DT_S_READY
#define DT_S_COMMAND
#define DT_S_COMPOSITE_ERROR

/* registers */
#define DT2801_DATA
#define DT2801_STATUS
#define DT2801_CMD

#if 0
/* ignore 'defined but not used' warning */
static const struct comedi_lrange range_dt2801_ai_pgh_bipolar = {
	4, {
		BIP_RANGE(10),
		BIP_RANGE(5),
		BIP_RANGE(2.5),
		BIP_RANGE(1.25)
	}
};
#endif
static const struct comedi_lrange range_dt2801_ai_pgl_bipolar =;

#if 0
/* ignore 'defined but not used' warning */
static const struct comedi_lrange range_dt2801_ai_pgh_unipolar = {
	4, {
		UNI_RANGE(10),
		UNI_RANGE(5),
		UNI_RANGE(2.5),
		UNI_RANGE(1.25)
	}
};
#endif
static const struct comedi_lrange range_dt2801_ai_pgl_unipolar =;

struct dt2801_board {};

/*
 * Typeid's for the different boards of the DT2801-series
 * (taken from the test-software, that comes with the board)
 */
static const struct dt2801_board boardtypes[] =;

struct dt2801_private {};

/*
 * These are the low-level routines:
 * writecommand: write a command to the board
 * writedata: write data byte
 * readdata: read data byte
 */

/*
 * Only checks DataOutReady-flag, not the Ready-flag as it is done
 *  in the examples of the manual. I don't see why this should be
 *  necessary.
 */
static int dt2801_readdata(struct comedi_device *dev, int *data)
{}

static int dt2801_readdata2(struct comedi_device *dev, int *data)
{}

static int dt2801_writedata(struct comedi_device *dev, unsigned int data)
{}

static int dt2801_writedata2(struct comedi_device *dev, unsigned int data)
{}

static int dt2801_wait_for_ready(struct comedi_device *dev)
{}

static void dt2801_writecmd(struct comedi_device *dev, int command)
{}

static int dt2801_reset(struct comedi_device *dev)
{}

static int probe_number_of_ai_chans(struct comedi_device *dev)
{}

static const struct comedi_lrange *dac_range_table[] =;

static const struct comedi_lrange *dac_range_lkup(int opt)
{}

static const struct comedi_lrange *ai_range_lkup(int type, int opt)
{}

static int dt2801_error(struct comedi_device *dev, int stat)
{}

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

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

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

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

/*
 * options:
 *	[0] - i/o base
 *	[1] - unused
 *	[2] - a/d 0=differential, 1=single-ended
 *	[3] - a/d range 0=[-10,10], 1=[0,10]
 *	[4] - dac0 range 0=[-10,10], 1=[-5,5], 2=[-2.5,2.5] 3=[0,10], 4=[0,5]
 *	[5] - dac1 range 0=[-10,10], 1=[-5,5], 2=[-2.5,2.5] 3=[0,10], 4=[0,5]
 */
static int dt2801_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{}

static struct comedi_driver dt2801_driver =;
module_comedi_driver();

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