Exemple #1
0
 private void Init(SpiConnectionSettings settings)
 {
     this.SetSpiMode(settings.Mode);
     this.SetBitsPerWord(settings.BitsPerWord);
     this.SetMaxSpeed(settings.MaxSpeed);
     this.SetDelay(settings.Delay);
 }
Exemple #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)
 {
 }
Exemple #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);
 }