[][src]Function mynewt::hw::hal::hal_gpio_irq_init

pub unsafe extern "C" fn hal_gpio_irq_init(
    pin: c_int,
    handler: hal_gpio_irq_handler_t,
    arg: *mut c_void,
    trig: hal_gpio_irq_trig_t,
    pull: hal_gpio_pull_t
) -> c_int

Initialize a given pin to trigger a GPIO IRQ callback.

  • pin: The pin to trigger GPIO interrupt on
  • handler: The handler function to call
  • arg: The argument to provide to the IRQ handler
  • trig: The trigger mode (e.g. rising, falling)
  • pull: The mode of the pin (e.g. pullup, pulldown)

Return: 0 on success, non-zero error code on failure.