Ejemplo n.º 1
0
 /// <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;
 }
Ejemplo n.º 2
0
 /// <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();
 }
Ejemplo n.º 3
0
 /// <summary>Selects the input channel to be read</summary>
 /// <param name='Ch'>Channel Number</param>
 public void SetInputChannel(MCP342xChannel Ch)
 {
     channel = Ch;
     configDirty = true;
 }
Ejemplo n.º 4
0
 /// <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;
 }
Ejemplo n.º 5
0
 /// <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;
 }
Ejemplo n.º 6
0
 /// <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;
 }
Ejemplo n.º 7
0
 /// <summary>Selects the input channel to be read</summary>
 /// <param name='Ch'>Channel Number</param>
 public void SetInputChannel(MCP342xChannel Ch)
 {
     channel     = Ch;
     configDirty = true;
 }
Ejemplo n.º 8
0
 /// <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());
 }