Esempio n. 1
0
            public void RegisterInterruptHandler(byte pin, GTI.InterruptMode mode, InterruptHandler handler)
            {
                InterruptRegistraton reg = new InterruptRegistraton();

                reg.handler = handler;
                reg.mode    = mode;
                reg.pin     = pin;

                lock (this.interruptHandlers)
                    this.interruptHandlers.Add(reg);
            }
Esempio n. 2
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);
		}
Esempio n. 3
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));
 }
Esempio n. 4
0
            public InterruptInputImplementation(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);
            }
Esempio n. 5
0
        /// <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));
        }