예제 #1
0
 public GpioButtonHandler(GPIOButtonInputProvider Provider, ButtonDefinition ButtonDef)
 {
     this.Provider          = Provider;
     this.ButtonDef         = ButtonDef;
     this.State             = true;
     this.Port              = new InterruptPort(ButtonDef.Pin, true, ButtonDef.ResistorMode, InterruptPort.InterruptMode.InterruptEdgeBoth);
     this.Port.OnInterrupt += new NativeEventHandler(this.Interrupt);
 }
예제 #2
0
 /// <summary>Initializes a new application instance</summary>
 /// <param name="ButtonDefs">ButtonDefinition array to map GPIO pins to framework button ids for this application</param>
 /// <remarks>
 /// <para>This constructor is protected as it is an abstract class and cannot
 /// be created directly.</para>
 /// <para>
 /// This will create the input provider for the GPIO buttons based on the
 /// definitions provided in the ButtonDefs parameter. The ButtonDefs array 
 /// maps GPI pin values to button IDs and specifies if the button uses auto-repeat
 /// By keeping that information at the top application level it allows different
 /// applications on the same hardware platform to use the available physical buttons
 /// in different ways.
 /// </para>
 /// </remarks>
 protected Application(ButtonDefinition[] ButtonDefs)
 {
     this.InputProvider = new GPIOButtonInputProvider(null, ButtonDefs);
 }
 public GpioButtonHandler(GPIOButtonInputProvider Provider, ButtonDefinition ButtonDef)
 {
     this.Provider = Provider;
     this.ButtonDef = ButtonDef;
     this.State = true;
     this.Port = new InterruptPort(ButtonDef.Pin, true, ButtonDef.ResistorMode, InterruptPort.InterruptMode.InterruptEdgeBoth);
     this.Port.OnInterrupt += new NativeEventHandler(this.Interrupt);
 }