public void SetCutOffFrequencyAndGain(AnalogInChannelsEnum channelName, FilterCutOffFrequencies cutoff, FilterGain gain) { if (cutoff < FilterCutOffFrequencies.Freq_0kHz || cutoff > FilterCutOffFrequencies.Freq_150kHz) { throw new ArgumentException("Frequency out of range"); } if (gain < FilterGain.gain1 || gain > FilterGain.gain16) { throw new ArgumentException("Gain out of range"); } var valForLatch = (int)cutoff | (int)gain; _channel.WriteByte(valForLatch); CutoffFrequency = cutoff; Gain = gain; }
private void SetFilter_Gain(FilterGain gain) { SetParams(ChannelFilter.CutoffFrequency, gain, ChannelPGA.Gain); }
public void SetParams(FilterCutOffFrequencies cutoff, FilterGain filter_gain, PGA_GainsEnum pga_gain) { ChannelFilter.SetCutOffFrequencyAndGain(_channelName, cutoff, filter_gain); ChannelPGA.SetAmplification(pga_gain); CommonLatch.PulseLatchForChannel(_channelName); }
public void SetFilter_Gain(FilterGain gain) { SetParams(ChannelFilter.CutoffFrequency, gain, ChannelPGA.Gain); }