exti.h — Maple v0.0.12 Documentation

### Navigation

- next
- previous |
- LeafLabs |
- Index »
- `libmaple` »
- APIs »

# `exti.h`

External interrupt support.

Contents

- Types
- Devices
- Functions
- Register Map Base Pointers
- Register Bit Definitions

## Types

struct exti_reg_map

> EXTI register map type.

> Public Members

> > __io uint32 IMR

> >   Interrupt mask register.

> > __io uint32 EMR

> >   Event mask register.

> > __io uint32 RTSR

> >   Rising trigger selection register.

> > __io uint32 FTSR

> >   Falling trigger selection register.

> > __io uint32 SWIER

> >   Software interrupt event register.

> > __io uint32 PR

> >   Pending register.

exti_trigger_mode enum

  External interrupt trigger mode.

  Values:

  - `EXTI_RISING` -

    Trigger on the rising edge.

  - `EXTI_FALLING` -

    Trigger on the falling edge.

  - `EXTI_RISING_FALLING` -

    Trigger on both the rising and falling edges.

## Devices

None at this time.

## Functions

void exti_attach_interrupt(afio_exti_num num, afio_exti_port port, voidFuncPtr handler, exti_trigger_mode mode)

  Register a handler to run upon external interrupt.

  This function assumes that the interrupt request corresponding to the given external interrupt is masked.

  Parameters: | `num` - External interrupt line number. `port` - Port to use as source input for external interrupt. `handler` - Function handler to execute when interrupt is triggered. `mode` - Type of transition to trigger on, one of: EXTI_RISING, EXTI_FALLING, EXTI_RISING_FALLING.
  See: | afio_exti_num afio_exti_port voidFuncPtr exti_trigger_mode

void exti_detach_interrupt(afio_exti_num num)

  Unregister an external interrupt handler.

  Parameters: | `num` - Number of the external interrupt line to disable.
  See: | afio_exti_num

## Register Map Base Pointers

EXTI_BASE

  EXTI register map base pointer.

## Register Bit Definitions

None at this time.

### Navigation

- next
- previous |
- LeafLabs |
- Index »
- `libmaple` »
- APIs »