/// <summary>Standard Constructor</summary> /// <param name='Ch'>Channel Number</param> /// <param name='res'>Bits of resolution required</param> /// <param name='cm'>Conversion Mode</param> /// <param name='Gain'>Gain multiplier of the pre-ADC amplifier</param> public Mcp342x(MCP342xChannel ch, MCP324xResolution res, MCP342xConversionMode cm, MCP342xGain g) { channel = ch; resolution = res; conversionMode = cm; gain = g; }
/// <summary> /// Reads a channel from the device. /// </summary> /// <param name="channel"></param> /// <returns>Value in mV from a 2.048V reference.</returns> public double ReadChannel(MCP342xChannel channel) { Channel = channel; return ReadValue(); }
/// <summary>Selects the input channel to be read</summary> /// <param name='Ch'>Channel Number</param> public void SetInputChannel(MCP342xChannel Ch) { channel = Ch; configDirty = true; }
/// <summary>Extended Constructor</summary> /// <param name='Ch'>Channel Number</param> /// <param name='res'>Bits of resolution required</param> /// <param name='cm'>Conversion Mode</param> /// <param name='Gain'>Gain multiplier of the pre-ADC amplifier</param> /// <param name='Offset'>See datasheet, only required for MCP3423/4 or MCP3422 where Address-Option is NOT A0</param> public Mcp342x(MCP342xChannel ch, MCP324xResolution res, MCP342xConversionMode cm, MCP342xGain g, ushort addrOffset) : this(ch, res, cm, g) { baseAddressOffset = addrOffset; }
/// <summary> /// Reads a channel from the device. /// </summary> /// <param name="channel"></param> /// <returns>Value in mV from a 2.048V reference.</returns> public double ReadChannel(MCP342xChannel channel) { Channel = channel; return(ReadValue()); }