public InterruptPort(IO60P16Module parentModule, IOPin pin, ResistorMode resistorMode, InterruptMode interruptMode) : base(parentModule, pin) { Resistor = resistorMode; Interrupt = interruptMode; EnableInterrupt(); }
public InterruptPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interrupt) : base(portId, glitchFilter, resistor, interrupt) { //m_threadSpawn = null; //m_callbacks = null; GPIOManager.Instance.SetPortType(portId, PortType.INTERRUPT); GPIOManager.Instance.SetEdge(portId, interrupt); }
public DigitalFrequencyInput(Cpu.Pin pin, bool glitchFilter, ResistorMode resistorMode, InterruptMode interruptMode) : base(pin, glitchFilter, resistorMode, interruptMode) { dataPoints = new System.Collections.Hashtable(20); base.EnableInterrupt(); base.OnInterrupt += new NativeEventHandler(DigitalFrequencyInput_OnInterrupt); loopThread = new Thread(new ThreadStart(ThreadLoop)); loopThread.Start(); }
public NativeDigitalInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module, Cpu.Pin cpuPin) { if (cpuPin == Cpu.Pin.GPIO_NONE) { // this is a mainboard error but should not happen since we check for this, but it doesnt hurt to double-check throw Socket.InvalidSocketException.FunctionalityException(socket, "DigitalInput"); } _port = new InputPort(cpuPin, glitchFilterMode == GlitchFilterMode.On, (Port.ResistorMode)resistorMode); }
// Note: A constructor summary is auto-generated by the doc builder. /// <summary></summary> /// <param name="socket">The socket for the digital input interface.</param> /// <param name="pin">The pin used by the digital input interface.</param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this digital input interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the digital input interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="module">The module using this interface, which can be null if unspecified.</param> public DigitalInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module) { this.port = new InputPort(socket.ReservePin(pin, module), glitchFilterMode == GlitchFilterMode.On, (Port.ResistorMode)resistorMode); if (this.port == null) { // this is a mainboard error but should not happen since we check for this, but it doesnt hurt to double-check throw new Socket.InvalidSocketException("Socket " + socket + " has an error with its Digital Input functionality. Please try a different socket."); } }
public NativeDigitalIO(Socket socket, Socket.Pin pin, bool initialState, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module, Hardware.Cpu.Pin cpuPin) { if (cpuPin == Hardware.Cpu.Pin.GPIO_NONE) { // this is a mainboard error but should not happen since we check for this, but it doesnt hurt to double-check throw Socket.InvalidSocketException.FunctionalityException(socket, "DigitalIO"); } _port = new Hardware.TristatePort(cpuPin, initialState, glitchFilterMode == GlitchFilterMode.On, (Hardware.Port.ResistorMode)resistorMode); }
// Note: A constructor summary is auto-generated by the doc builder. /// <summary></summary> /// <param name="socket">The socket for the digital input interface.</param> /// <param name="pin">The pin used by the digital input interface.</param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this digital input interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the digital input interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="module">The module using this interface, which can be null if unspecified.</param> public DigitalInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module) { Cpu.Pin reservedPin = socket.ReservePin(pin, module); // native implementation is preferred to an indirected one if (reservedPin == Cpu.Pin.GPIO_NONE && socket.DigitalInputIndirector != null) Interface = socket.DigitalInputIndirector(socket, pin, glitchFilterMode, resistorMode, module); else Interface = new NativeDigitalInput(socket, pin, glitchFilterMode, resistorMode, module, reservedPin); }
/// <summary> /// Creates an instance of <see cref="DigitalIO" /> for the given socket and pin number. /// </summary> /// <param name="socket">The socket for the digital input/output interface.</param> /// <param name="pin">The pin used by the digital input/output interface.</param> /// <param name="initialState"> /// The initial state to set on the digital input/output interface port. /// This value becomes effective as soon as the port is enabled as an output port. /// </param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this digital input/output interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the digital input/output interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="module">The module using this interface, which can be null if unspecified.</param> /// <returns>An instance of <see cref="DigitalIO" /> for the given socket and pin number.</returns> public static DigitalIO Create(Socket socket, Socket.Pin pin, bool initialState, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module) { Cpu.Pin reservedPin = socket.ReservePin(pin, module); // native implementation is preferred to an indirected one if (reservedPin == Cpu.Pin.GPIO_NONE && socket.DigitalIOIndirector != null) return socket.DigitalIOIndirector(socket, pin, initialState, glitchFilterMode, resistorMode, module); else return new NativeDigitalIO(socket, pin, initialState, glitchFilterMode, resistorMode, module, reservedPin); }
/// <summary> /// Creates an instance of <see cref="InterruptInput" /> for the given socket and pin number. /// </summary> /// <param name="socket">The socket for the interrupt input interface.</param> /// <param name="pin">The pin used by the interrupt input interface.</param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this interrupt input interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the interrupt input interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="interruptMode"> /// A value from the <see cref="InterruptMode"/> enumeration that establishes the requisite conditions /// for the interface port to generate an interrupt. /// </param> /// <param name="module">The module using this interrupt input interface, which can be null if unspecified.</param> /// <returns>An instance of <see cref="InterruptInput" /> for the given socket and pin number.</returns> public static InterruptInput Create(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, InterruptMode interruptMode, Module module) { Cpu.Pin reservedPin = socket.ReservePin(pin, module); // native implementation is preferred to an indirected one if (reservedPin == Cpu.Pin.GPIO_NONE && socket.InterruptIndirector != null) return socket.InterruptIndirector(socket, pin, glitchFilterMode, resistorMode, interruptMode, module); else return new NativeInterruptInput(socket, pin, glitchFilterMode, resistorMode, interruptMode, module, reservedPin); }
// Note: A constructor summary is auto-generated by the doc builder. /// <summary></summary> /// <param name="socket">The socket for the interrupt input interface.</param> /// <param name="pin">The pin used by the interrupt input interface.</param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this interrupt input interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the interrupt input interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="interruptMode"> /// A value from the <see cref="InterruptMode"/> enumeration that establishes the requisite conditions /// for the interface port to generate an interrupt. /// </param> /// <param name="module">The module using this interrupt input interface, which can be null if unspecified.</param> public InterruptInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, InterruptMode interruptMode, Module module) { this.port = new InterruptPort(socket.ReservePin(pin, module), glitchFilterMode == GlitchFilterMode.On, (Port.ResistorMode)resistorMode, (Port.InterruptMode)interruptMode); if (this.port == null) { // this is a mainboard error but should not happen since we check for this, but it doesnt hurt to double-check throw new Socket.InvalidSocketException("Socket " + socket + " has an error with its Interrupt Input functionality. Please try a different socket."); } this.SynchronousUnsafeEventInvocation = false; this.port.OnInterrupt += new NativeEventHandler(this._port_OnInterrupt); }
/// <summary> /// Create a new Parallax PIR object connected to an input pin and IO Device. /// </summary> /// <param name="device"></param> /// <param name="inputPin"></param> public ParallaxPir(IIODevice device, IPin pin, InterruptMode interruptMode, ResistorMode resistorMode, int debounceDuration = 20, int glitchFilterCycleCount = 0) : this(device.CreateDigitalInputPort(pin, interruptMode, resistorMode, debounceDuration, glitchFilterCycleCount)) { }
public InputPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor) : base(portId, glitchFilter, resistor, InterruptMode.InterruptNone) { }
protected InputPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interruptMode) : base(portId, glitchFilter, resistor, interruptMode) { GPIOManager.Instance.SetPortType(portId, PortType.INPUT); }
protected Port(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) { this.Id = portId; throw new NotImplementedException(); }
extern protected Port(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interruptMode);
public InputPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor) : base(portId, glitchFilter, resistor, InterruptMode.InterruptNone) { GPIOManager.GetInstance().SetPortType(portId, PortType.INPUT); }
protected Port(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) { this.Id = portId; //throw new NotImplementedException(); GPIOManager.Instance.Export(portId); }
protected InputPort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) : base(portId, initialState, glitchFilter, resistor) { }
public NativeDigitalIO(Socket socket, Socket.Pin pin, bool initialState, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module, Cpu.Pin cpuPin) { if (cpuPin == Cpu.Pin.GPIO_NONE) { // this is a mainboard error but should not happen since we check for this, but it doesnt hurt to double-check throw Socket.InvalidSocketException.FunctionalityException(socket, "DigitalIO"); } _port = new TristatePort(cpuPin, initialState, glitchFilterMode == GlitchFilterMode.On, (Port.ResistorMode)resistorMode); }
/// <summary> /// Constructor. /// </summary> /// <param name="parentModule">The module to which this port belongs.</param> /// <param name="pin">The pin ID that this port represents.</param> /// <param name="resistorMode">The resistor mode to assign to the pin.</param> protected Port(IO60P16Module parentModule, IOPin pin, ResistorMode resistorMode) : this(parentModule, pin) { Resistor = resistorMode; }
public CamPositionSensor(Cpu.Pin pin, bool glitchFilter, ResistorMode resistorMode, InterruptMode interruptMode) : base(pin, glitchFilter, resistorMode, interruptMode) { }
public TristatePort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) : base(portId, initialState, glitchFilter, resistor) { }
public Tachometer(Cpu.Pin pin, bool glitchFilter, ResistorMode resistorMode, InterruptMode interruptMode) : base(pin, glitchFilter, resistorMode, interruptMode) { }
public IDigitalInputPort CreateDigitalInputPort(IPin pin, InterruptMode interruptMode = InterruptMode.None, ResistorMode resistorMode = ResistorMode.Disabled, int debounceDuration = 0, int glitchFilterCycleCount = 0) { throw new NotImplementedException(); }
//--// protected Port(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interruptMode) { this.Id = portId; GPIOManager.GetInstance().Export(portId); }
/// <summary> /// Creates an instance of <see cref="DigitalIO" /> for the given socket and pin number. /// </summary> /// <param name="socket">The socket for the digital input/output interface.</param> /// <param name="pin">The pin used by the digital input/output interface.</param> /// <param name="initialState"> /// The initial state to set on the digital input/output interface port. /// This value becomes effective as soon as the port is enabled as an output port. /// </param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this digital input/output interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the digital input/output interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="module">The module using this interface, which can be null if unspecified.</param> /// <returns>An instance of <see cref="DigitalIO" /> for the given socket and pin number.</returns> public static DigitalIO Create(Socket socket, Socket.Pin pin, bool initialState, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, Module module) { Cpu.Pin reservedPin = socket.ReservePin(pin, module); // native implementation is preferred to an indirected one if (reservedPin == Cpu.Pin.GPIO_NONE && socket.DigitalIOIndirector != null) { return(socket.DigitalIOIndirector(socket, pin, initialState, glitchFilterMode, resistorMode, module)); } else { return(new NativeDigitalIO(socket, pin, initialState, glitchFilterMode, resistorMode, module, reservedPin)); } }
protected OutputPort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) : base(portId, initialState, glitchFilter, resistor) { throw new NotImplementedException(); }
public InterruptWrapper(Cpu.Pin pin, bool glitchFilter, ResistorMode resistorMode) : base(pin, glitchFilter, resistorMode, InterruptMode.InterruptEdgeBoth) { }
//--// protected Port(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interruptMode) { this.Id = portId; GPIOManager.Instance.Export(portId); }
protected InputPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interruptMode) : base(portId, glitchFilter, resistor, interruptMode) { }
public InputPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor) : base(portId, glitchFilter, resistor, InterruptMode.InterruptNone) { GPIOManager.Instance.SetPortType(portId, PortType.INPUT); }
protected LED(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistorMode) : base(portId, initialState, glitchFilter, resistorMode) { }
// Note: A constructor summary is auto-generated by the doc builder. /// <summary></summary> /// <param name="socket">The socket for the interrupt input interface.</param> /// <param name="pin">The pin used by the interrupt input interface.</param> /// <param name="glitchFilterMode"> /// A value from the <see cref="GlitchFilterMode"/> enumeration that specifies /// whether to enable the glitch filter on this interrupt input interface. /// </param> /// <param name="resistorMode"> /// A value from the <see cref="ResistorMode"/> enumeration that establishes a default state for the interrupt input interface. N.B. .NET Gadgeteer mainboards are only required to support ResistorMode.PullUp on interruptable GPIOs and are never required to support ResistorMode.PullDown; consider putting the resistor on the module itself. /// </param> /// <param name="interruptMode"> /// A value from the <see cref="InterruptMode"/> enumeration that establishes the requisite conditions /// for the interface port to generate an interrupt. /// </param> /// <param name="module">The module using this interrupt input interface, which can be null if unspecified.</param> public InterruptInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, InterruptMode interruptMode, Module module) { Cpu.Pin reservedPin = socket.ReservePin(pin, module); // native implementation is preferred to an indirected one if (reservedPin == Cpu.Pin.GPIO_NONE && socket.InterruptIndirector != null) { Interface = socket.InterruptIndirector(socket, pin, glitchFilterMode, resistorMode, interruptMode, module); } else { Interface = new NativeInterruptInput(socket, pin, glitchFilterMode, resistorMode, interruptMode, module, reservedPin); } }
extern protected Port(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor);
//--// public InterruptPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interrupt) : base(portId, glitchFilter, resistor, interrupt) { m_threadSpawn = null; m_callbacks = null; }
/// <summary> /// Instantiates a new RotaryEncoder on the specified pins that has an integrated button. /// </summary> /// <param name="aPhasePin"></param> /// <param name="bPhasePin"></param> /// <param name="buttonPin"></param> /// <param name="resistor"></param> /// <param name="debounceDuration"></param> public RotaryEncoderWithButton(IIODevice device, IPin aPhasePin, IPin bPhasePin, IPin buttonPin, ResistorMode resistor = ResistorMode.PullDown, int debounceDuration = 20) : base(device, aPhasePin, bPhasePin) { _button = new PushButton(device, buttonPin, resistor, debounceDuration); _button.Clicked += ButtonClicked; _button.PressEnded += ButtonPressEnded; _button.PressStarted += ButtonPressStarted; }
public NativeInterruptInput(Socket socket, Socket.Pin pin, GlitchFilterMode glitchFilterMode, ResistorMode resistorMode, InterruptMode interruptMode, Module module, Cpu.Pin cpuPin) { if (cpuPin == Cpu.Pin.GPIO_NONE) { // this is a mainboard error but should not happen since we check for this, but it doesnt hurt to double-check throw Socket.InvalidSocketException.FunctionalityException(socket, "InterruptInput"); } _port = new InterruptPort(cpuPin, glitchFilterMode == GlitchFilterMode.On, (Port.ResistorMode)resistorMode, (Port.InterruptMode)interruptMode); }
protected OutputPort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) : base(portId, initialState, glitchFilter, resistor) { }
/// <summary> /// Creates a new DipSwitch connected to the specified switchPins, with the InterruptMode and ResisterMode specified by the type parameters. /// </summary> /// <param name="device"></param> /// <param name="switchPins"></param> /// <param name="interruptMode"></param> /// <param name="resistorMode"></param> /// <param name="debounceDuration"></param> /// <param name="glitchFilterCycleCount"></param> public DipSwitch(IIODevice device, IPin[] switchPins, InterruptMode interruptMode, ResistorMode resistorMode, int debounceDuration = 20, int glitchFilterCycleCount = 0) { Switches = new ISwitch[switchPins.Length]; for (int i = 0; i < switchPins.Length; i++) { Switches[i] = new SpstSwitch(device, switchPins[i], interruptMode, resistorMode, debounceDuration, glitchFilterCycleCount); int index = i; Switches[i].Changed += (s, e) => HandleSwitchChanged(index); } }
public IBiDirectionalPort CreateBiDirectionalPort(IPin pin, bool initialState = false, bool glitchFilter = false, InterruptMode interruptMode = InterruptMode.None, ResistorMode resistorMode = ResistorMode.Disabled, PortDirectionType initialDirection = PortDirectionType.Input) { throw new NotImplementedException(); }
protected LED(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistorMode) :base(portId, initialState, glitchFilter, resistorMode) { }
protected OutputPort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) : base(portId, initialState, glitchFilter, resistor) { //throw new NotImplementedException(); GPIOManager.Instance.SetPortType(portId, PortType.OUTPUT); }
protected OutputPort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) { }
public InterruptPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interrupt) : base(portId, glitchFilter, resistor) { }
protected InputPort(Cpu.Pin portId, bool glitchFilter, ResistorMode resistor, InterruptMode interruptMode) : base(portId, glitchFilter, resistor, interruptMode) { GPIOManager.GetInstance().SetPortType(portId, PortType.INPUT); }
public TristatePort(Cpu.Pin portId, bool initialState, bool glitchFilter, ResistorMode resistor) : base(portId, initialState, glitchFilter, resistor) { GPIOManager.GetInstance().SetPortType(portId, PortType.INPUT); active = false; this.InitialState = initialState; this.firstTimeOutput = true; }