Inheritance: IBinaryOutput, IBinaryInput
        private Pi2Gpio OpenPort(int number, GpioPinDriveMode mode)
        {
            Pi2Gpio port;
            if (!_openPorts.TryGetValue(number, out port))
            {
                GpioPin pin = _gpioController.OpenPin(number, GpioSharingMode.Exclusive);
                pin.SetDriveMode(mode);

                port = new Pi2Gpio(pin);
                _openPorts.Add(number, port);
            }

            return port;
        }
Esempio n. 2
0
        private Pi2Gpio OpenPort(int number, GpioPinDriveMode mode)
        {
            Pi2Gpio port;

            if (!_openPorts.TryGetValue(number, out port))
            {
                GpioPin pin = _gpioController.OpenPin(number, GpioSharingMode.Exclusive);
                pin.SetDriveMode(mode);

                port = new Pi2Gpio(pin);
                _openPorts.Add(number, port);
            }

            return(port);
        }