Exemplo n.º 1
0
 private void Init(SpiConnectionSettings settings)
 {
     this.SetSpiMode(settings.Mode);
     this.SetBitsPerWord(settings.BitsPerWord);
     this.SetMaxSpeed(settings.MaxSpeed);
     this.SetDelay(settings.Delay);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NativeSpiConnection"/> class.
 /// </summary>
 /// <param name="deviceFilePath">A control device (IOCTL) to the device file (e.g. /dev/spidev0.0).</param>
 /// <param name="settings">The settings.</param>
 public NativeSpiConnection(string deviceFilePath, SpiConnectionSettings settings)
     : this(new SpiControlDevice(new UnixFile(deviceFilePath, UnixFileMode.ReadWrite)), settings)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NativeSpiConnection"/> class.
 /// </summary>
 /// <param name="deviceFile">A control device (IOCTL) to the device file (e.g. /dev/spidev0.0).</param>
 /// <param name="settings">The settings.</param>
 public NativeSpiConnection(ISpiControlDevice deviceFile, SpiConnectionSettings settings)
     : this(deviceFile)
 {
     this.Init(settings);
 }