linux/drivers/comedi/drivers/quatech_daqp_cs.c

// SPDX-License-Identifier: GPL-2.0
/*
 * quatech_daqp_cs.c
 * Quatech DAQP PCMCIA data capture cards COMEDI client driver
 * Copyright (C) 2000, 2003 Brent Baccala <[email protected]>
 * The DAQP interface code in this file is released into the public domain.
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 1998 David A. Schleef <[email protected]>
 * https://www.comedi.org/
 *
 * Documentation for the DAQP PCMCIA cards can be found on Quatech's site:
 *	ftp://ftp.quatech.com/Manuals/daqp-208.pdf
 *
 * This manual is for both the DAQP-208 and the DAQP-308.
 *
 * What works:
 * - A/D conversion
 *	- 8 channels
 *	- 4 gain ranges
 *	- ground ref or differential
 *	- single-shot and timed both supported
 * - D/A conversion, single-shot
 * - digital I/O
 *
 * What doesn't:
 * - any kind of triggering - external or D/A channel 1
 * - the card's optional expansion board
 * - the card's timer (for anything other than A/D conversion)
 * - D/A update modes other than immediate (i.e, timed)
 * - fancier timing modes
 * - setting card's FIFO buffer thresholds to anything but default
 */

/*
 * Driver: quatech_daqp_cs
 * Description: Quatech DAQP PCMCIA data capture cards
 * Devices: [Quatech] DAQP-208 (daqp), DAQP-308
 * Author: Brent Baccala <[email protected]>
 * Status: works
 */

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

/*
 * Register I/O map
 *
 * The D/A and timer registers can be accessed with 16-bit or 8-bit I/O
 * instructions. All other registers can only use 8-bit instructions.
 *
 * The FIFO and scanlist registers require two 8-bit instructions to
 * access the 16-bit data. Data is transferred LSB then MSB.
 */
#define DAQP_AI_FIFO_REG

#define DAQP_SCANLIST_REG
#define DAQP_SCANLIST_DIFFERENTIAL
#define DAQP_SCANLIST_GAIN(x)
#define DAQP_SCANLIST_CHANNEL(x)
#define DAQP_SCANLIST_START
#define DAQP_SCANLIST_EXT_GAIN(x)
#define DAQP_SCANLIST_EXT_CHANNEL(x)

#define DAQP_CTRL_REG
#define DAQP_CTRL_PACER_CLK(x)
#define DAQP_CTRL_PACER_CLK_EXT
#define DAQP_CTRL_PACER_CLK_5MHZ
#define DAQP_CTRL_PACER_CLK_1MHZ
#define DAQP_CTRL_PACER_CLK_100KHZ
#define DAQP_CTRL_EXPANSION
#define DAQP_CTRL_EOS_INT_ENA
#define DAQP_CTRL_FIFO_INT_ENA
#define DAQP_CTRL_TRIG_MODE
#define DAQP_CTRL_TRIG_SRC
#define DAQP_CTRL_TRIG_EDGE

#define DAQP_STATUS_REG
#define DAQP_STATUS_IDLE
#define DAQP_STATUS_RUNNING
#define DAQP_STATUS_DATA_LOST
#define DAQP_STATUS_END_OF_SCAN
#define DAQP_STATUS_FIFO_THRESHOLD
#define DAQP_STATUS_FIFO_FULL
#define DAQP_STATUS_FIFO_NEARFULL
#define DAQP_STATUS_FIFO_EMPTY
/* these bits clear when the status register is read */
#define DAQP_STATUS_EVENTS

#define DAQP_DI_REG
#define DAQP_DO_REG

#define DAQP_PACER_LOW_REG
#define DAQP_PACER_MID_REG
#define DAQP_PACER_HIGH_REG

#define DAQP_CMD_REG
/* the monostable bits are self-clearing after the function is complete */
#define DAQP_CMD_ARM
#define DAQP_CMD_RSTF
#define DAQP_CMD_RSTQ
#define DAQP_CMD_STOP
#define DAQP_CMD_LATCH
#define DAQP_CMD_SCANRATE(x)
#define DAQP_CMD_SCANRATE_100KHZ
#define DAQP_CMD_SCANRATE_50KHZ
#define DAQP_CMD_SCANRATE_25KHZ
#define DAQP_CMD_FIFO_DATA

#define DAQP_AO_REG

#define DAQP_TIMER_REG

#define DAQP_AUX_REG
/* Auxiliary Control register bits (write) */
#define DAQP_AUX_EXT_ANALOG_TRIG
#define DAQP_AUX_PRETRIG
#define DAQP_AUX_TIMER_INT_ENA
#define DAQP_AUX_TIMER_MODE(x)
#define DAQP_AUX_TIMER_MODE_RELOAD
#define DAQP_AUX_TIMER_MODE_PAUSE
#define DAQP_AUX_TIMER_MODE_GO
#define DAQP_AUX_TIMER_MODE_EXT
#define DAQP_AUX_TIMER_CLK_SRC_EXT
#define DAQP_AUX_DA_UPDATE(x)
#define DAQP_AUX_DA_UPDATE_DIRECT
#define DAQP_AUX_DA_UPDATE_OVERFLOW
#define DAQP_AUX_DA_UPDATE_EXTERNAL
#define DAQP_AUX_DA_UPDATE_PACER
/* Auxiliary Status register bits (read) */
#define DAQP_AUX_RUNNING
#define DAQP_AUX_TRIGGERED
#define DAQP_AUX_DA_BUFFER
#define DAQP_AUX_TIMER_OVERFLOW
#define DAQP_AUX_CONVERSION
#define DAQP_AUX_DATA_LOST
#define DAQP_AUX_FIFO_NEARFULL
#define DAQP_AUX_FIFO_EMPTY

#define DAQP_FIFO_SIZE

#define DAQP_MAX_TIMER_SPEED

struct daqp_private {};

static const struct comedi_lrange range_daqp_ai =;

static int daqp_clear_events(struct comedi_device *dev, int loops)
{}

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

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

static irqreturn_t daqp_interrupt(int irq, void *dev_id)
{}

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

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

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

/* This function converts ns nanoseconds to a counter value suitable
 * for programming the device.  We always use the DAQP's 5 MHz clock,
 * which with its 24-bit counter, allows values up to 84 seconds.
 * Also, the function adjusts ns so that it cooresponds to the actual
 * time that the device will use.
 */

static int daqp_ns_to_timer(unsigned int *ns, unsigned int flags)
{}

static void daqp_set_pacer(struct comedi_device *dev, unsigned int val)
{}

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

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

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

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

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

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

static int daqp_auto_attach(struct comedi_device *dev,
			    unsigned long context)
{}

static struct comedi_driver driver_daqp =;

static int daqp_cs_suspend(struct pcmcia_device *link)
{}

static int daqp_cs_resume(struct pcmcia_device *link)
{}

static int daqp_cs_attach(struct pcmcia_device *link)
{}

static const struct pcmcia_device_id daqp_cs_id_table[] =;
MODULE_DEVICE_TABLE(pcmcia, daqp_cs_id_table);

static struct pcmcia_driver daqp_cs_driver =;
module_comedi_pcmcia_driver();

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