예제 #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);
 }