Ingmar Schoegl <ischoegl@mail.utexas.edu>.
break;
}
config_bits |= MSeries_AI_Config_Channel_Bits(chan);
- config_bits |= MSeries_AI_Config_Bank_Bits(chan);
+ config_bits |= MSeries_AI_Config_Bank_Bits(boardtype.reg_type, chan);
config_bits |= MSeries_AI_Config_Gain_Bits(range_code);
if(i == n_chan - 1) config_bits |= MSeries_AI_Config_Last_Channel_Bit;
if(dither) config_bits |= MSeries_AI_Config_Dither_Bit;
{
return channel & 0xf;
}
-static inline unsigned MSeries_AI_Config_Bank_Bits(unsigned channel)
+static inline unsigned MSeries_AI_Config_Bank_Bits(enum ni_reg_type reg_type, unsigned channel)
{
- return channel & 0x30;
+ unsigned bits = channel & 0x30;
+ if(reg_type == ni_reg_622x)
+ {
+ if(channel & 0x40)
+ bits |= 0x400;
+ }
+ return bits;
}
static inline unsigned MSeries_AI_Config_Gain_Bits(unsigned range)
{