#define DUMMY_BIT 0x40 #define CB_DDA_DA_DATA_REG(x) (0x08 + ((x) * 2)) /* Offsets for the caldac channels */ #define CB_DDA_CALDAC_FINE_GAIN 0 #define CB_DDA_CALDAC_COURSE_GAIN 1 #define CB_DDA_CALDAC_COURSE_OFFSET 2 #define CB_DDA_CALDAC_FINE_OFFSET 3 static const struct comedi_lrange cb_pcidda_ranges = { 6, { BIP_RANGE(10), BIP_RANGE(5), BIP_RANGE(2.5), UNI_RANGE(10), UNI_RANGE(5), UNI_RANGE(2.5) } }; enum cb_pcidda_boardid { BOARD_DDA02_12, BOARD_DDA04_12, BOARD_DDA08_12, BOARD_DDA02_16, BOARD_DDA04_16, BOARD_DDA08_16, }; struct cb_pcidda_board {
static int das08jr_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); static int das08ao_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data); static void i8254_set_mode_low(unsigned int base, int channel, unsigned int mode); static const struct comedi_lrange range_das08_pgl = { 9, { BIP_RANGE(10), BIP_RANGE(5), BIP_RANGE(2.5), BIP_RANGE(1.25), BIP_RANGE(0.625), UNI_RANGE(10), UNI_RANGE(5), UNI_RANGE(2.5), UNI_RANGE(1.25) } }; static const struct comedi_lrange range_das08_pgh = { 12, { BIP_RANGE(10), BIP_RANGE(5), BIP_RANGE(1), BIP_RANGE(0.5), BIP_RANGE(0.1), BIP_RANGE(0.05), BIP_RANGE(0.01), BIP_RANGE(0.005),
#define DAQBOARD2000_EEPROM_PRESENT 0x10000000 /* CPLD status bits */ #define DAQBOARD2000_CPLD_INIT 0x0002 #define DAQBOARD2000_CPLD_DONE 0x0004 static const struct comedi_lrange range_daqboard2000_ai = { 13, { BIP_RANGE(10), BIP_RANGE(5), BIP_RANGE(2.5), BIP_RANGE(1.25), BIP_RANGE(0.625), BIP_RANGE(0.3125), BIP_RANGE(0.156), UNI_RANGE(10), UNI_RANGE(5), UNI_RANGE(2.5), UNI_RANGE(1.25), UNI_RANGE(0.625), UNI_RANGE(0.3125) } }; /* * Register Memory Map */ #define acqControl 0x00 /* u16 */ #define acqScanListFIFO 0x02 /* u16 */ #define acqPacerClockDivLow 0x04 /* u32 */ #define acqScanCounter 0x08 /* u16 */
#include "../comedidev.h" #include "comedi_fc.h" #define CONV_UNIT_NS (1 << 0) #define CONV_UNIT_US (1 << 1) #define CONV_UNIT_MS (1 << 2) static const struct comedi_lrange apci3xxx_ai_range = { 8, { BIP_RANGE(10), BIP_RANGE(5), BIP_RANGE(2), BIP_RANGE(1), UNI_RANGE(10), UNI_RANGE(5), UNI_RANGE(2), UNI_RANGE(1) } }; static const struct comedi_lrange apci3xxx_ao_range = { 2, { BIP_RANGE(10), UNI_RANGE(10) } }; enum apci3xxx_boardid { BOARD_APCI3000_16,
#define EEPROM_ANALOGINPUT 2 #define EEPROM_ANALOGOUTPUT 3 #define EEPROM_TIMER 4 #define EEPROM_WATCHDOG 5 #define EEPROM_TIMER_WATCHDOG_COUNTER 10 struct apci3501_private { int i_IobaseAmcc; struct task_struct *tsk_Current; unsigned char b_TimerSelectMode; }; static struct comedi_lrange apci3501_ao_range = { 2, { BIP_RANGE(10), UNI_RANGE(10) } }; static int apci3501_wait_for_dac(struct comedi_device *dev) { unsigned int status; do { status = inl(dev->iobase + APCI3501_AO_CTRL_STATUS_REG); } while (!(status & APCI3501_AO_STATUS_READY)); return 0; } static int apci3501_ao_insn_write(struct comedi_device *dev,
#define ME_DAC_DATA_C 0x0018 /* - | W */ #define ME_DAC_DATA_D 0x001A /* - | W */ #define ME_COUNTER_ENDDATA_A 0x001C /* - | W */ #define ME_COUNTER_ENDDATA_B 0x001E /* - | W */ #define ME_COUNTER_STARTDATA_A 0x0020 /* - | W */ #define ME_COUNTER_VALUE_A 0x0020 /* R | - */ #define ME_COUNTER_STARTDATA_B 0x0022 /* - | W */ #define ME_COUNTER_VALUE_B 0x0022 /* R | - */ static const struct comedi_lrange me_ai_range = { 8, { 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) } }; static const struct comedi_lrange me_ao_range = { 3, { BIP_RANGE(10), BIP_RANGE(5), UNI_RANGE(10) } }; enum me_boardid {
/* +-5V input range gain steps */ BIP_RANGE(5.0), BIP_RANGE(5.0 / 2), BIP_RANGE(5.0 / 4), BIP_RANGE(5.0 / 8), BIP_RANGE(5.0 / 16), BIP_RANGE(5.0 / 32), /* +-10V input range gain steps */ BIP_RANGE(10.0), BIP_RANGE(10.0 / 2), BIP_RANGE(10.0 / 4), BIP_RANGE(10.0 / 8), BIP_RANGE(10.0 / 16), BIP_RANGE(10.0 / 32), /* +10V input range gain steps */ UNI_RANGE(10.0), UNI_RANGE(10.0 / 2), UNI_RANGE(10.0 / 4), UNI_RANGE(10.0 / 8), UNI_RANGE(10.0 / 16), UNI_RANGE(10.0 / 32), } }; /* PCI4520 has two more gains (6 more entries) */ static const struct comedi_lrange rtd_ai_4520_range = { 24, { /* +-5V input range gain steps */ BIP_RANGE(5.0), BIP_RANGE(5.0 / 2), BIP_RANGE(5.0 / 4),
#include <linux/ioport.h> #define FL512_SIZE 16 /* the size of the used memory */ struct fl512_private { short ao_readback[2]; }; #define devpriv ((struct fl512_private *) dev->private) static const struct comedi_lrange range_fl512 = { 4, { BIP_RANGE(0.5), BIP_RANGE(1), BIP_RANGE(5), BIP_RANGE(10), UNI_RANGE(1), UNI_RANGE(5), UNI_RANGE(10), } }; /* * fl512_ai_insn : this is the analog input function */ static int fl512_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { int n; unsigned int lo_byte, hi_byte; char chan = CR_CHAN(insn->chanspec);
}; static const struct comedi_lrange range_rti800_ai_5_bipolar = { 4, { BIP_RANGE (5), BIP_RANGE (0.5), BIP_RANGE (0.05), BIP_RANGE (0.01) } }; static const struct comedi_lrange range_rti800_ai_unipolar = { 4, { UNI_RANGE (10), UNI_RANGE(1), UNI_RANGE (0.1), UNI_RANGE (0.02) } }; struct rti800_board { const char *name; int has_ao; }; static const struct rti800_board boardtypes[] = {
#define INT_TYPE_AI1_DMA_RTC 9 #define INT_TYPE_AI3_DMA_RTC 10 #define RTC_IRQ 8 #define RTC_IO_EXTENT 0x10 #endif #define MAGIC_DMA_WORD 0x5a5a static const struct comedi_lrange range_pcl818h_ai = { 9, { BIP_RANGE(5), BIP_RANGE(2.5), BIP_RANGE(1.25), BIP_RANGE(0.625), UNI_RANGE(10), UNI_RANGE(5), UNI_RANGE(2.5), UNI_RANGE(1.25), BIP_RANGE(10), } }; static const struct comedi_lrange range_pcl818hg_ai = { 10, { BIP_RANGE(5), BIP_RANGE(0.5), BIP_RANGE(0.05), BIP_RANGE(0.005), UNI_RANGE(10), UNI_RANGE(1), UNI_RANGE(0.1),
1 = differential 2 = pseudo-differential (common reference) [3] - A/D range 0 = [-5, 5] 1 = [-2.5, 2.5] 2 = [0, 5] [4] - D/A 0 range (same choices) [4] - D/A 1 range (same choices) */ #include <linux/module.h> #include "../comedidev.h" static const struct comedi_lrange range_dt2811_pgh_ai_5_unipolar = { 4, { UNI_RANGE(5), UNI_RANGE(2.5), UNI_RANGE(1.25), UNI_RANGE(0.625) } }; static const struct comedi_lrange range_dt2811_pgh_ai_2_5_bipolar = { 4, { BIP_RANGE(2.5), BIP_RANGE(1.25), BIP_RANGE(0.625), BIP_RANGE(0.3125) } };
/* mask of the bit at STINR to check end of conversion */ #define ADQ12B_EOC 0x20 #define TIMEOUT 20 /* available ranges through the PGA gains */ static const struct comedi_lrange range_adq12b_ai_bipolar = { 4, { BIP_RANGE(5), BIP_RANGE(2), BIP_RANGE(1), BIP_RANGE(0.5) } }; static const struct comedi_lrange range_adq12b_ai_unipolar = { 4, { UNI_RANGE(5), UNI_RANGE(2), UNI_RANGE(1), UNI_RANGE (0.5) } }; struct adq12b_board { const char *name; int ai_se_chans; int ai_diff_chans; int ai_bits; int di_chans; int do_chans; };