Inheritance: SocketInterfaces.DigitalIO
Esempio n. 1
0
        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);
        }
Esempio n. 2
0
		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;
		}