コード例 #1
0
        private static PinMode GpioDriveModeToPinMode(WinGpio.GpioPinDriveMode mode)
        {
            switch (mode)
            {
            case WinGpio.GpioPinDriveMode.Input:
                return(PinMode.Input);

            case WinGpio.GpioPinDriveMode.Output:
                return(PinMode.Output);

            case WinGpio.GpioPinDriveMode.InputPullDown:
                return(PinMode.InputPullDown);

            case WinGpio.GpioPinDriveMode.InputPullUp:
                return(PinMode.InputPullUp);

            default:
                throw new NotSupportedException($"GPIO pin mode not supported: {mode}");
            }
        }
コード例 #2
0
        private static PinMode GpioDriveModeToPinMode(WinGpio.GpioPinDriveMode mode)
        {
            switch (mode)
            {
            case WinGpio.GpioPinDriveMode.Input:
                return(PinMode.Input);

            case WinGpio.GpioPinDriveMode.Output:
                return(PinMode.Output);

            case WinGpio.GpioPinDriveMode.InputPullDown:
                return(PinMode.InputPullDown);

            case WinGpio.GpioPinDriveMode.InputPullUp:
                return(PinMode.InputPullUp);

            default:
                throw new ArgumentException($"GPIO pin mode {mode} not supported.", nameof(mode));
            }
        }