public void Dispose() { myInputPort.Dispose(); myInterruptPort.Dispose(); myOutputPort.Dispose(); myI2CDevice.Dispose(); mySPI.Dispose(); myTristatePort.Dispose(); mySerialPort.Dispose(); Dispose(true); GC.SuppressFinalize(this); }
/// <summary> /// Release IO Pins /// </summary> public void Dispose() { try { DataPin.Dispose(); ClockPin.Dispose(); } catch { // Added by Slaven Brumec. throw new Exception("SHT11_GPIO_IOProvider: Failed to dispose IO pins."); } }
protected void Dispose(bool disposing) { if (!disposed) { try { portIn.Dispose(); portOut.Dispose(); } finally { disposed = true; } } }
/// <summary> /// Sends a reset pulse on the daisylink chain. This resets all DaisyLink nodes to INIT state, that is, waiting for a DaisyLink message. /// </summary> /// <remarks> /// It is recommended to reboot the mainboard after calling this method because communication to the DaisyLink nodes will fail. /// </remarks> internal void SendResetPulse() { lock (portLock) { if (daisyLinkInterruptPort != null) { daisyLinkInterruptPort.DisableInterrupt(); daisyLinkInterruptPort.Dispose(); // Ask hardware drivers to unreserve this pin daisyLinkInterruptPort = null; } if (daisyLinkResetPort == null) { daisyLinkResetPort = new TristatePort(daisyLinkCpuPin, false, false, Port.ResistorMode.PullUp); } daisyLinkResetPort.Active = true; // Should drive the neighbor bus high Thread.Sleep(2); // 2 milliseconds is definitely more than 1 ms daisyLinkResetPort.Active = false; // Pull-downs should take the neighbor bus back low daisyLinkResetPort.Dispose(); // Remove this pin from the hardware's reserved pin list daisyLinkResetPort = null; } }
public override void Dispose() { _port.Dispose(); }
public void Dispose() { _dht22out.Dispose(); _dht22in.Dispose(); }