This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

pyb.ExtInt

Classes

ExtInt

Create an ExtInt object:

Module Contents

class pyb.ExtInt.ExtInt(pin, mode, pull, callback)

Create an ExtInt object:

  • pin is the pin on which to enable the interrupt (can be a pin object or any valid pin name).

  • mode can be one of: - ExtInt.IRQ_RISING - trigger on a rising edge; - ExtInt.IRQ_FALLING - trigger on a falling edge; - ExtInt.IRQ_RISING_FALLING - trigger on a rising or falling edge.

  • pull can be one of: - pyb.Pin.PULL_NONE - no pull up or down resistors; - pyb.Pin.PULL_UP - enable the pull-up resistor; - pyb.Pin.PULL_DOWN - enable the pull-down resistor.

  • callback is the function to call when the interrupt triggers. The callback function must accept exactly 1 argument, which is the line that triggered the interrupt.

disable() None

Disable the interrupt associated with the ExtInt object. This could be useful for debouncing.

enable() None

Enable a disabled interrupt.

line() int

Return the line number that the pin is mapped to.

classmethod regs() Incomplete

Dump the values of the EXTI registers.

swint() Incomplete

Trigger the callback from software.

IRQ_FALLING: Incomplete

interrupt on a falling edge

IRQ_RISING: Incomplete

interrupt on a rising edge

IRQ_RISING_FALLING: Incomplete

interrupt on a rising or falling edge