예제 #1
0
 internal SpiSlaveSelectionContext(SpiConnection connection)
 {
     this.connection = connection;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Mcp3208SpiConnection"/> class.
 /// </summary>
 /// <param name="clockPin">The clock pin.</param>
 /// <param name="slaveSelectPin">The slave select pin.</param>
 /// <param name="misoPin">The miso pin.</param>
 /// <param name="mosiPin">The mosi pin.</param>
 public Mcp3208SpiConnection(IOutputBinaryPin clockPin, IOutputBinaryPin slaveSelectPin, IInputBinaryPin misoPin, IOutputBinaryPin mosiPin)
 {
     spiConnection = new SpiConnection(clockPin, slaveSelectPin, misoPin, mosiPin, Endianness.LittleEndian);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Mcp3202SpiConnection"/> class.
 /// </summary>
 /// <param name="clockPin">The clock pin.</param>
 /// <param name="slaveSelectPin">The slave select pin.</param>
 /// <param name="misoPin">The miso pin.</param>
 /// <param name="mosiPin">The mosi pin.</param>
 public Mcp3202SpiConnection(IOutputBinaryPin clockPin, IOutputBinaryPin slaveSelectPin, IInputBinaryPin misoPin, IOutputBinaryPin mosiPin, decimal maxValue = 1m)
 {
     _spiConnection = new SpiConnection(clockPin, slaveSelectPin, misoPin, mosiPin, Endianness.LittleEndian);
     _maxValue = maxValue;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Mcp4822SpiConnection" /> class.
 /// </summary>
 /// <param name="clockPin">The clock pin.</param>
 /// <param name="slaveSelectPin">The slave select pin.</param>
 /// <param name="mosiPin">The mosi pin.</param>
 public Mcp4822SpiConnection(IOutputBinaryPin clockPin, IOutputBinaryPin slaveSelectPin, IOutputBinaryPin mosiPin)
 {
     spiConnection = new SpiConnection(clockPin, slaveSelectPin, null, mosiPin, Endianness.LittleEndian);
 }
 public Mcp3008SpiConnection(ProcessorPin clock, ProcessorPin cs, ProcessorPin miso, ProcessorPin mosi, decimal scale)
 {
     this.scale = scale;
     spiConnection = new SpiConnection(clock, cs, miso, mosi, Endianness.LittleEndian);
 }
 public Mcp4822SpiConnection(ProcessorPin clock, ProcessorPin ss, ProcessorPin mosi, decimal scale)
 {
     spiConnection = new SpiConnection(clock, ss, null, mosi, Endianness.LittleEndian);
     this.scale = scale;
 }