public void SetDirection(XGpioDirection direction) { GpioPinDriveMode mode; if (direction == XGpioDirection.Input) { mode = GpioPinDriveMode.Input; } else { mode = GpioPinDriveMode.Output; } if (!_pin.IsDriveModeSupported(mode)) { throw new NotSupportedException($"Drive mode {mode} not supported on pin {_pinNumber}"); } _pin.SetDriveMode(mode); _driveMode = mode; }
public void SetDirection(XGpioDirection direction) { _i2CDevice.SetGPIODirection((byte)_pin, direction == XGpioDirection.Input ? (byte)0 : (byte)1); }
public void SetDirection(XGpioDirection direction) { _i2CDevice.SetGPIODirection((byte)_pin, direction == XGpioDirection.Input ? (byte) 0 : (byte) 1); }
public void SetDirection(XGpioDirection direction) { _gpio.SetDirection(direction); }