Пример #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);
 }
        public GPIOButtonInputProvider(PresentationSource source, ButtonDefinition[] ButtonDefinitions)
        {
            this.RepeatDelay = 500;
            this.RepeatPeriod = 150;
            this.PresentationSource = source;
            this.InputSite = InputManager.CurrentInputManager.RegisterInputProvider(this);
            this.ReportInputFunc = new DispatcherOperationCallback( ReportInputCallback );

            this.Dispatcher = Microsoft.SPOT.Dispatcher.CurrentDispatcher;
            this.Buttons = new GpioButtonHandler[ButtonDefinitions.Length];
            for( int i = 0; i < ButtonDefinitions.Length; i++ )
            {
                ButtonDefinition btnDef = ButtonDefinitions[i];
                this.Buttons[i] = new GpioButtonHandler( this, btnDef);
            }
        }
Пример #3
0
        public GPIOButtonInputProvider(PresentationSource source, ButtonDefinition[] ButtonDefinitions)
        {
            this.RepeatDelay        = 500;
            this.RepeatPeriod       = 150;
            this.PresentationSource = source;
            this.InputSite          = InputManager.CurrentInputManager.RegisterInputProvider(this);
            this.ReportInputFunc    = new DispatcherOperationCallback(ReportInputCallback);

            this.Dispatcher = Microsoft.SPOT.Dispatcher.CurrentDispatcher;
            this.Buttons    = new GpioButtonHandler[ButtonDefinitions.Length];
            for (int i = 0; i < ButtonDefinitions.Length; i++)
            {
                ButtonDefinition btnDef = ButtonDefinitions[i];
                this.Buttons[i] = new GpioButtonHandler(this, btnDef);
            }
        }
Пример #4
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);
 }
Пример #5
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>
 /// <param name="Delay">Minimum time (in milliseconds) button must be down before auto repeat begins</param>
 /// <param name="Period">Period of time (in milliseconds) between auto repeated ButtonDown actions are sent</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 GPIO 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>
 /// <seealso cref="M:FusionWare.Application.GetButtonRepeatRate(System.Int32@,System.Int32@)"/>
 /// <seealso cref="M:FusionWare.Application.SetButtonRepeatRate(System.Int32,System.Int32)"/>
 protected Application(ButtonDefinition[] ButtonDefs, int Delay, int Period)
     : this(ButtonDefs)
 {
     this.InputProvider.SetButtonRepeatRate(Delay, Period);
 }
 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);
 }