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

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

            return port;
        }
        private Pi2Port OpenPort(int number, GpioPinDriveMode mode)
        {
            Pi2Port port;

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

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

            return(port);
        }