Inheritance: SocketInterfaces.DigitalIO
Exemplo 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);
        }
Exemplo 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;
		}