// Construct the object. Set this class to handle the emulated // hardware's button interrupts. public ButtonPad(GPIOButtonInputProvider sink, Button button, Cpu.Pin pin) { this.sink = sink; this.button = button; // When this GPIO pin is true, call the Interrupt method. port = new InterruptPort(pin, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth); port.OnInterrupt += new NativeEventHandler(this.Interrupt); }