/// <summary> /// Sets the pin direction. /// </summary> /// <param name="pinNumber">Pin number.</param> /// <param name="direction">Pin Direction.</param> public override void SetPinDirection(int pinNumber, GpioPinDirection direction) { this.SendPackage( "Failed to send package to remote when setting pin direction. Number of bytes get sent:{0}", (byte)Command.SetPinDirection, (byte)this.GetTargetPinNumber(pinNumber), (byte)direction); }
internal GpioPin(RaspberryPi parentPi, int index, GpioPinDirection direction) { _parentPi = parentPi; Index = index; Direction = direction; SetupPin(); }
public GpioPin GetPin(int index, GpioPinDirection direction) { if (_pins.ContainsKey(index)) { var pin = _pins[index]; if (pin.Direction != direction) { throw new InvalidOperationException("Pin " + index.ToString() + " is already configured for a different direction"); } return(pin); } _pins[index] = new GpioPin(this, index, direction); return(_pins[index]); }
/// <summary> /// Sets the pin direction. /// </summary> /// <param name="pinNumber">Pin number.</param> /// <param name="direction">Pin Direction.</param> public override void SetPinDirection(int pinNumber, GpioPinDirection direction) { pinMode(this.GetTargetPinNumber(pinNumber), (int)direction); }
/// <summary> /// Sets the pin direction. /// </summary> /// <param name="pinNumber">Pin number.</param> /// <param name="direction">Pin Direction.</param> public abstract void SetPinDirection(int pinNumber, GpioPinDirection direction);
/// <summary> /// Sets the pin direction. /// </summary> /// <param name="pinNumber">Pin number.</param> /// <param name="direction">Pin Direction.</param> public void SetPinDirection(int pinNumber, GpioPinDirection direction) { this.implementation.SetPinDirection(pinNumber, direction); }