static const unsigned short hwrange_pci224_internal[8] = {
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_10,
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_5,
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_2_5,
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_1_25,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_10,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_5,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_2_5,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_1_25,
};

/* The software selectable external ranges for PCI224 (option[2] == 1). */
static const struct comedi_lrange range_pci224_external = {
	2,
	{
	 RANGE_ext(-1, 1),	/* bipolar [-Vref,+Vref] */
	 RANGE_ext(0, 1),	/* unipolar [0,+Vref] */
	 }
};

static const unsigned short hwrange_pci224_external[2] = {
	PCI224_DACCON_POLAR_BI,
	PCI224_DACCON_POLAR_UNI,
};

static const struct comedi_lrange range_pci234_ext2 = {
	1,
	{
	 RANGE_ext(-2, 2),
	 }
};
예제 #2
0
파일: dac02.c 프로젝트: AlexShiLucky/linux
 *	                 1        14 to 16      17
 *	  4 to 20mA      0        21 to 22      25
 *	                 1        15 to 16      19
 *	AC reference     0      In on pin 22    24 (2-quadrant)
 *	                        In on pin 22    23 (4-quadrant)
 *	                 1      In on pin 16    18 (2-quadrant)
 *	                        In on pin 16    17 (4-quadrant)
 */
static const struct comedi_lrange das02_ao_ranges = {
	6, {
		UNI_RANGE(5),
		UNI_RANGE(10),
		BIP_RANGE(5),
		BIP_RANGE(10),
		RANGE_mA(4, 20),
		RANGE_ext(0, 1)
	}
};

/*
 * Register I/O map
 */
#define DAC02_AO_LSB(x)		(0x00 + ((x) * 2))
#define DAC02_AO_MSB(x)		(0x01 + ((x) * 2))

static int dac02_ao_insn_write(struct comedi_device *dev,
			       struct comedi_subdevice *s,
			       struct comedi_insn *insn,
			       unsigned int *data)
{
	unsigned int chan = CR_CHAN(insn->chanspec);
예제 #3
0
 *
 * All channels share the same hardware range.
 */
static const struct comedi_lrange range_pci224 = {
	10, {
		/* jumper LK1 in position 1-2 (factory default) */
		BIP_RANGE(10),
		BIP_RANGE(5),
		BIP_RANGE(2.5),
		BIP_RANGE(1.25),
		UNI_RANGE(10),
		UNI_RANGE(5),
		UNI_RANGE(2.5),
		UNI_RANGE(1.25),
		/* jumper LK1 in position 2-3 */
		RANGE_ext(-1, 1),	/* bipolar [-Vext,+Vext] */
		RANGE_ext(0, 1),	/* unipolar [0,+Vext] */
	}
};

static const unsigned short hwrange_pci224[10] = {
	/* jumper LK1 in position 1-2 (factory default) */
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_10,
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_5,
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_2_5,
	PCI224_DACCON_POLAR_BI | PCI224_DACCON_VREF_1_25,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_10,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_5,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_2_5,
	PCI224_DACCON_POLAR_UNI | PCI224_DACCON_VREF_1_25,
	/* jumper LK1 in position 2-3 */
예제 #4
0
 be 10V, 5V, 2V, 1V, APFI<0,1>, AO<0...3>.  That's
 63 different possibilities.  An AO channel
 can not act as it's own OFFSET or REFERENCE.
*/

#if 0
static struct a4l_rngtab rng_ni_M_628x_ao = { 8, {
	RANGE(-10, 10),
	RANGE(-5, 5),
	RANGE(-2, 2),
	RANGE(-1, 1),
	RANGE(-5, 15),
	RANGE(0, 10),
	RANGE(3, 7),
	RANGE(4, 6),
	RANGE_ext(-1, 1)
}};
static struct a4l_rngdesc range_ni_M_628x_ao =
	RNG_GLOBAL(rng_ni_M_628x_ao);
#endif

static struct a4l_rngtab rng_ni_M_625x_ao = { 3, {
	RANGE(-10, 10),
	RANGE(-5, 5),
	RANGE_ext(-1, 1)
}};
static struct a4l_rngdesc range_ni_M_625x_ao =
	RNG_GLOBAL(rng_ni_M_625x_ao);

static struct a4l_rngtab rng_ni_M_622x_ao = { 1, {
	RANGE(-10, 10),