eliminate duplicate ao window register definitions, move some
authorFrank Mori Hess <fmhess@speakeasy.net>
Sun, 15 Feb 2004 21:57:25 +0000 (21:57 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sun, 15 Feb 2004 21:57:25 +0000 (21:57 +0000)
ao windowed registers into the proper enum, some fixes for ni 67xx
board definitions

comedi/drivers/ni_mio_common.c
comedi/drivers/ni_pcimio.c
comedi/drivers/ni_stc.h

index bdd580c7e8f159dd55b92708508ef3104dec56f3..38bf52878447bba2b8a3ca2f3cffab3c108c3ccc 100644 (file)
@@ -287,8 +287,8 @@ static inline void ni_ao_win_outw( comedi_device *dev, uint16_t data, int addr )
        unsigned long flags;
 
        comedi_spin_lock_irqsave(&dev->spinlock,flags);
-       ni_writew(addr,AO_Window_Address_671x);
-       ni_writew(data,AO_Window_Data_671x);
+       ni_writew(addr,AO_Window_Address_611x);
+       ni_writew(data,AO_Window_Data_611x);
        comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
 }
 
@@ -297,8 +297,8 @@ static inline void ni_ao_win_outl(comedi_device *dev, uint32_t data, int addr)
        unsigned long flags;
 
        comedi_spin_lock_irqsave(&dev->spinlock,flags);
-       ni_writew(addr,AO_Window_Address_671x);
-       ni_writel(data,AO_Window_Data_671x);
+       ni_writew(addr,AO_Window_Address_611x);
+       ni_writel(data,AO_Window_Data_611x);
        comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
 }
 
@@ -308,8 +308,8 @@ static inline unsigned short ni_ao_win_inw( comedi_device *dev, int addr )
        unsigned short data;
 
        comedi_spin_lock_irqsave(&dev->spinlock,flags);
-       ni_writew(addr, AO_Window_Address_671x);
-       data = ni_readw(AO_Window_Data_671x);
+       ni_writew(addr, AO_Window_Address_611x);
+       data = ni_readw(AO_Window_Data_611x);
        comedi_spin_unlock_irqrestore(&dev->spinlock,flags);
        return data;
 }
@@ -3834,7 +3834,7 @@ static int cs5529_ai_insn_read(comedi_device *dev,comedi_subdevice *s,comedi_ins
        channel = CR_CHAN(insn->chanspec);
        /* Set calibration adc source.  Docs lie, reference select bits 8 to 11
         * do nothing. */
-       ni_ao_win_outw(dev, channel, AO_Calibration_Channel_Select_67xx);
+       ni_ao_win_outw(dev, 0x100 | channel, AO_Calibration_Channel_Select_67xx);
 
        for(n = 0; n < insn->n; n++)
        {
index 6f07589e76f8aa482bd1861f387f88d5b1a90671..19ae2c8f47ac4c8646f26cbd9ebba4b8a661a1db 100644 (file)
@@ -490,7 +490,7 @@ static ni_board ni_boards[]={
                ao_unipolar:    0,
                ao_fifo_depth:  16384, /* data sheet says 8192, but fifo really holds 16384 samples */
                reg_type:       ni_reg_6711,
-               caldac:         {ad8804_debug,ad8804_debug},
+               caldac:         {ad8804_debug},
        },
        {       device_id:      0x2b90,
                name:           "pxi-6711",
@@ -500,7 +500,7 @@ static ni_board ni_boards[]={
                ao_unipolar:    0,
                ao_fifo_depth:  16384,
                reg_type:       ni_reg_6711,
-               caldac:         {ad8804_debug,ad8804_debug},
+               caldac:         {ad8804_debug},
        },
        {       device_id:      0x1870,
                name:           "pci-6713",
@@ -531,7 +531,17 @@ static ni_board ni_boards[]={
                ao_unipolar:    0,
                ao_fifo_depth:  8192,
                reg_type:       ni_reg_6711,
-               caldac:         {ad8804_debug,ad8804_debug},
+               caldac:         {ad8804_debug},
+       },
+       {       device_id:      0x0,
+               name:           "pxi-6731",
+               n_adchan:       0, /* no analog input */
+               n_aochan:       4,
+               aobits:         16,
+               ao_unipolar:    0,
+               ao_fifo_depth:  8192,
+               reg_type:       ni_reg_6711,
+               caldac:         {ad8804_debug},
        },
 #endif
        {       device_id:      0x2410,
index 3dddb8dfa18826a628142fa81a51d7135f2a1538..de8f70bc1a149806619f5a5d78f195a2eff96300 100644 (file)
@@ -646,28 +646,25 @@ static inline unsigned int AI_CONFIG_CHANNEL( unsigned int channel )
 #define Calibration_Channel_Select_611x        0x1a /* w16 (new) */
 #define ADC_FIFO_Data_611x             0x1c /* r32 (incompatible) */
 #define AI_FIFO_Offset_Load_611x       0x05 /* r8 (new) */
-#define AO_FIFO_Offset_Load_611x       0x13 /* W32 */
 #define DAC_FIFO_Data_611x             0x14 /* w32 (incompatible) */
-#define AO_Window_Addr_611x            0x18 /* w16 */
-#define AO_Window_Data_611x            0x1e /* w16 */
 #define Cal_Gain_Select_611x           0x05 /* w8 (new) */
 
-/* AO Windowed registers */
+#define AO_Window_Address_611x         0x18
+#define AO_Window_Data_611x            0x1e
 
 /* 671x, 611x registers */
 
-#define AO_Window_Address_671x         0x18 /* W 16 */
-#define AO_Window_Data_671x            0x1e /* W 16 */
-
 /* 671xi, 611x windowed ao registers */
 enum windowed_regs_67xx_61xx
 {
        AO_Immediate_671x = 0x11, /* W 16 */
        AO_Timed_611x = 0x10, /* W 16 */
+       AO_FIFO_Offset_Load_611x = 0x13, /* W32 */
        AO_Later_Single_Point_Updates = 0x14, /* W 16 */
        AO_Waveform_Generation_611x = 0x15, /* W 16 */
        AO_Misc_611x = 0x16, /* W 16 */
        AO_Calibration_Channel_Select_67xx = 0x17, /* W 16 */
+       AO_Configuration_2_67xx = 0x18, /* W 16 */
        CAL_ADC_Command_67xx = 0x19, /* W 8 */
        CAL_ADC_Status_67xx = 0x1a, /* R 8 */
        CAL_ADC_Data_67xx = 0x1b, /* R 16 */