public async Task <DigitalIO> CreateDigitalIOAsync(SocketPinNumber pinNumber) { DigitalIO result; if (this.nativePins.ContainsKey(pinNumber)) { result = new NativeInterfaces.DigitalIO(await NativeInterfaces.DigitalIO.CreateInterfaceAsync(this.nativePins[pinNumber])); } else if (this.DigitalIOCreator != null) { result = await this.DigitalIOCreator(this, pinNumber); } else { throw new UnsupportedPinModeException(); } result.DriveMode = WD.Gpio.GpioPinDriveMode.Input; return(result); }
public async Task<DigitalIO> CreateDigitalIOAsync(SocketPinNumber pinNumber) { DigitalIO result; if (this.nativePins.ContainsKey(pinNumber)) { result = new NativeInterfaces.DigitalIO(await NativeInterfaces.DigitalIO.CreateInterfaceAsync(this.nativePins[pinNumber])); } else if (this.DigitalIOCreator != null) { result = await this.DigitalIOCreator(this, pinNumber); } else { throw new UnsupportedPinModeException(); } result.DriveMode = WD.Gpio.GpioPinDriveMode.Input; return result; }