コード例 #1
0
ファイル: IO60P16_43.cs プロジェクト: valoni/NETMF-Gadgeteer
            public DigitalInput(byte pin, GTI.GlitchFilterMode glitchFilter, GTI.ResistorMode resistorMode, IO60P16 io60)
            {
                this.io60 = io60;
                this.pin  = pin;

                this.io60.SetIOMode(this.pin, IO60P16.IOState.Input, resistorMode);
            }
コード例 #2
0
ファイル: HubAP5_43.cs プロジェクト: valoni/NETMF-Gadgeteer
 public DigitalIOImplementation(byte pin, bool initialState, GTI.GlitchFilterMode glitchFilter, GTI.ResistorMode resistorMode, IO60P16 io60)
 {
     this.io60         = io60;
     this.pin          = pin;
     this.resistorMode = resistorMode;
     this.Mode         = GTI.IOMode.Input;
     this.io60.WriteDigital(this.pin, initialState);
 }
コード例 #3
0
ファイル: IO60P16_43.cs プロジェクト: valoni/NETMF-Gadgeteer
            public InterruptInput(byte pin, GTI.GlitchFilterMode glitchFilter, GTI.ResistorMode resistorMode, GTI.InterruptMode interruptMode, IO60P16 io60)
            {
                this.io60 = io60;
                this.pin  = pin;

                this.io60.SetIOMode(this.pin, IO60P16.IOState.InputInterrupt, resistorMode);
                this.io60.RegisterInterruptHandler(this.pin, interruptMode, this.RaiseInterrupt);
            }
コード例 #4
0
ファイル: HubAP5_43.cs プロジェクト: valoni/NETMF-Gadgeteer
            public void SetIOMode(byte pin, IOState state, GTI.ResistorMode resistorMode)
            {
                switch (resistorMode)
                {
                case GTI.ResistorMode.Disabled: this.SetIOMode(pin, state, ResistorMode.Floating); break;

                case GTI.ResistorMode.PullDown: this.SetIOMode(pin, state, ResistorMode.PullDown); break;

                case GTI.ResistorMode.PullUp: this.SetIOMode(pin, state, ResistorMode.PullUp); break;
                }
            }
コード例 #5
0
ファイル: IO60P16_43.cs プロジェクト: valoni/NETMF-Gadgeteer
        private void SetIOMode(byte pin, IOState state, GTI.ResistorMode resistorMode)
        {
            switch (resistorMode)
            {
            case GTI.ResistorMode.Disabled: this.SetIOMode(pin, state, ResistorMode.HighImpedence); break;

            case GTI.ResistorMode.PullDown: this.SetIOMode(pin, state, ResistorMode.ResistivePullDown); break;

            case GTI.ResistorMode.PullUp: this.SetIOMode(pin, state, ResistorMode.ResistivePullUp); break;
            }
        }
コード例 #6
0
		/// <summary>Creates an interrupt input on the given pin.</summary>
		/// <param name="pin">The pin to create the interface on.</param>
		/// <param name="glitchFilterMode">The glitch filter mode for the interface.</param>
		/// <param name="resistorMode">The resistor mode for the interface.</param>
		/// <param name="interruptMode">The interrupt mode for the interface.</param>
		/// <returns>The new interface.</returns>
		public GTI.InterruptInput CreateInterruptInput(Socket.Pin pin, GTI.GlitchFilterMode glitchFilterMode, GTI.ResistorMode resistorMode, GTI.InterruptMode interruptMode) {
			return GTI.InterruptInputFactory.Create(this.socket, pin, glitchFilterMode, resistorMode, interruptMode, this);
		}
コード例 #7
0
		/// <summary>Creates a digital input/output on the given pin.</summary>
		/// <param name="pin">The pin to create the interface on.</param>
		/// <param name="initialState">The initial state for the interface.</param>
		/// <param name="glitchFilterMode">The glitch filter mode for the interface.</param>
		/// <param name="resistorMode">The resistor mode for the interface.</param>
		/// <returns>The new interface.</returns>
		public GTI.DigitalIO CreateDigitalIO(Socket.Pin pin, bool initialState, GTI.GlitchFilterMode glitchFilterMode, GTI.ResistorMode resistorMode) {
			return GTI.DigitalIOFactory.Create(this.socket, pin, initialState, glitchFilterMode, resistorMode, this);
		}
コード例 #8
0
		/// <summary>Creates a digital input on the given pin.</summary>
		/// <param name="pin">The pin to create the interface on.</param>
		/// <param name="glitchFilterMode">The glitch filter mode for the interface.</param>
		/// <param name="resistorMode">The resistor mode for the interface.</param>
		/// <returns>The new interface.</returns>
		public GTI.DigitalInput CreateDigitalInput(Socket.Pin pin, GTI.GlitchFilterMode glitchFilterMode, GTI.ResistorMode resistorMode) {
			return GTI.DigitalInputFactory.Create(this.socket, pin, glitchFilterMode, resistorMode, this);
		}
コード例 #9
0
 /// <summary>Creates an interrrupt input on the input port on the module.</summary>
 /// <param name="glitchFilterMode">The glitch filter mode for the input.</param>
 /// <param name="resistorMode">The resistor mode for the input.</param>
 /// <param name="interruptMode">The interrupt mode for the input.</param>
 /// <returns>The new input.</returns>
 public GTI.InterruptInput CreateInterruptInput(GTI.GlitchFilterMode glitchFilterMode, GTI.ResistorMode resistorMode, GTI.InterruptMode interruptMode)
 {
     return(GTI.InterruptInputFactory.Create(this.socket, Socket.Pin.Three, glitchFilterMode, resistorMode, interruptMode, this));
 }
コード例 #10
0
ファイル: IO60P16_43.cs プロジェクト: valoni/NETMF-Gadgeteer
        /// <summary>Creates an interrupt input on the given pin.</summary>
        /// <param name="port">The port to create the interface on.</param>
        /// <param name="pin">The pin to create the interface on.</param>
        /// <param name="glitchFilterMode">The glitch filter mode for the interface.</param>
        /// <param name="resistorMode">The resistor mode for the interface.</param>
        /// <param name="interruptMode">The interrupt mode for the interface.</param>
        /// <returns>The new interface.</returns>
        public GTI.InterruptInput CreateInterruptInput(int port, int pin, GTI.GlitchFilterMode glitchFilterMode, GTI.ResistorMode resistorMode, GTI.InterruptMode interruptMode)
        {
            if (port < 0 || port > 7)
            {
                throw new ArgumentOutOfRangeException("port", "port must be between 0 and 7.");
            }
            if (pin < 0 || pin > 7)
            {
                throw new ArgumentOutOfRangeException("pin", "pin must be between 0 and 7.");
            }

            return(new InterruptInput((byte)((port << 4) | pin), glitchFilterMode, resistorMode, interruptMode, this));
        }
コード例 #11
0
ファイル: IO60P16_43.cs プロジェクト: valoni/NETMF-Gadgeteer
        /// <summary>Creates a digital input/output on the given pin.</summary>
        /// <param name="port">The port to create the interface on.</param>
        /// <param name="pin">The pin to create the interface on.</param>
        /// <param name="initialState">The initial state for the interface.</param>
        /// <param name="glitchFilterMode">The glitch filter mode for the interface.</param>
        /// <param name="resistorMode">The resistor mode for the interface.</param>
        /// <returns>The new interface.</returns>
        public GTI.DigitalIO CreateDigitalIO(int port, int pin, bool initialState, GTI.GlitchFilterMode glitchFilterMode, GTI.ResistorMode resistorMode)
        {
            if (port < 0 || port > 7)
            {
                throw new ArgumentOutOfRangeException("port", "port must be between 0 and 7.");
            }
            if (pin < 0 || pin > 7)
            {
                throw new ArgumentOutOfRangeException("pin", "pin must be between 0 and 7.");
            }

            return(new DigitalIO((byte)((port << 4) | pin), initialState, glitchFilterMode, resistorMode, this));
        }