示例#1
0
        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;
        }
示例#2
0
文件: XGpio.cs 项目: valoni/xIOT
        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;
        }
示例#3
0
文件: GPIODevice.cs 项目: valoni/xIOT
 public void SetDirection(XGpioDirection direction)
 {
     _i2CDevice.SetGPIODirection((byte)_pin, direction == XGpioDirection.Input ? (byte)0 : (byte)1);
 }
示例#4
0
 public void SetDirection(XGpioDirection direction)
 {
     _i2CDevice.SetGPIODirection((byte)_pin, direction == XGpioDirection.Input ? (byte) 0 : (byte) 1);
 }
示例#5
0
 public void SetDirection(XGpioDirection direction)
 {
     _gpio.SetDirection(direction);
 }
示例#6
0
 public void SetDirection(XGpioDirection direction)
 {
     _gpio.SetDirection(direction);
 }