public PinMode GetPinMode(int pinNumber) { int logicalPinNumber = ConvertToLogicalPinNumber(pinNumber); if (!_openPins.Contains(logicalPinNumber)) { throw new InvalidOperationException("Can not set a mode to a pin that is not yet opened."); } return(_driver.GetPinMode(logicalPinNumber)); }
/// <summary> /// Gets the mode of a pin. /// </summary> /// <param name="pinNumber">The pin number in the controller's numbering scheme.</param> /// <returns>The mode of the pin.</returns> public PinMode GetPinMode(int pinNumber) { int logicalPinNumber = GetLogicalPinNumber(pinNumber); if (!_openPins.Contains(logicalPinNumber)) { throw new InvalidOperationException("Can not get the mode of a pin that is not open."); } return(_driver.GetPinMode(logicalPinNumber)); }
/// <summary> /// Gets the mode of a pin. /// </summary> /// <param name="pinNumber">The pin number in the controller's numbering scheme.</param> /// <returns>The mode of the pin.</returns> public virtual PinMode GetPinMode(int pinNumber) { if (!IsPinOpen(pinNumber)) { throw new InvalidOperationException($"Can not get the mode of pin {pinNumber} because it is not open."); } int logicalPinNumber = GetLogicalPinNumber(pinNumber); return(_driver.GetPinMode(logicalPinNumber)); }