APM:Libraries
Typedefs | Enumerations | Functions
exti.h File Reference
#include <string.h>
#include "hal_types.h"
Include dependency graph for exti.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum afio_exti_num afio_exti_num
 
typedef enum afio_exti_port afio_exti_port
 External interrupt line port selector. More...
 
typedef enum exti_trigger_mode exti_trigger_mode
 

Enumerations

enum  afio_exti_num {
  AFIO_EXTI_0, AFIO_EXTI_1, AFIO_EXTI_2, AFIO_EXTI_3,
  AFIO_EXTI_4, AFIO_EXTI_5, AFIO_EXTI_6, AFIO_EXTI_7,
  AFIO_EXTI_8, AFIO_EXTI_9, AFIO_EXTI_10, AFIO_EXTI_11,
  AFIO_EXTI_12, AFIO_EXTI_13, AFIO_EXTI_14, AFIO_EXTI_15
}
 
enum  afio_exti_port {
  AFIO_EXTI_PA, AFIO_EXTI_PB, AFIO_EXTI_PC, AFIO_EXTI_PD,
  AFIO_EXTI_PE, AFIO_EXTI_PF, AFIO_EXTI_PG
}
 External interrupt line port selector. More...
 
enum  exti_trigger_mode { EXTI_RISING, EXTI_FALLING, EXTI_RISING_FALLING }
 

Functions

void exti_init ()
 
void exti_attach_interrupt (afio_exti_num num, afio_exti_port port, Handler handler, exti_trigger_mode mode)
 Register a handler to run upon external interrupt. More...
 
void exti_attach_interrupt_pri (afio_exti_num num, afio_exti_port port, Handler handler, exti_trigger_mode mode, uint8_t priority)
 
void exti_detach_interrupt (afio_exti_num num)
 Unregister an external interrupt handler. More...
 
void exti_enable_interrupt (afio_exti_num num, bool e)
 
static INLINE void interrupts ()
 
static INLINE void noInterrupts ()
 
static void exti_clear_pending_bit (uint32_t EXTI_Line)
 
void EXTI0_IRQHandler (void)
 
void EXTI1_IRQHandler (void)
 
void EXTI2_IRQHandler (void)
 
void EXTI3_IRQHandler (void)
 
void EXTI4_IRQHandler (void)
 
void EXTI9_5_IRQHandler (void)
 
void EXTI15_10_IRQHandler (void)
 

Typedef Documentation

◆ afio_exti_num

External interrupt line numbers.

◆ afio_exti_port

External interrupt line port selector.

Used to determine which GPIO port to map an external interrupt line onto.

◆ exti_trigger_mode

External interrupt trigger mode

Enumeration Type Documentation

◆ afio_exti_num

External interrupt line numbers.

Enumerator
AFIO_EXTI_0 

External interrupt line 0.

AFIO_EXTI_1 

External interrupt line 1.

AFIO_EXTI_2 

External interrupt line 2.

AFIO_EXTI_3 

External interrupt line 3.

AFIO_EXTI_4 

External interrupt line 4.

AFIO_EXTI_5 

External interrupt line 5.

AFIO_EXTI_6 

External interrupt line 6.

AFIO_EXTI_7 

External interrupt line 7.

AFIO_EXTI_8 

External interrupt line 8.

AFIO_EXTI_9 

External interrupt line 9.

AFIO_EXTI_10 

External interrupt line 10.

AFIO_EXTI_11 

External interrupt line 11.

AFIO_EXTI_12 

External interrupt line 12.

AFIO_EXTI_13 

External interrupt line 13.

AFIO_EXTI_14 

External interrupt line 14.

AFIO_EXTI_15 

External interrupt line 15.

Definition at line 15 of file exti.h.

◆ afio_exti_port

External interrupt line port selector.

Used to determine which GPIO port to map an external interrupt line onto.

Enumerator
AFIO_EXTI_PA 

Use port A (PAx) pin.

AFIO_EXTI_PB 

Use port B (PBx) pin.

AFIO_EXTI_PC 

Use port C (PCx) pin.

AFIO_EXTI_PD 

Use port D (PDx) pin.

AFIO_EXTI_PE 

Use port E (PEx) pin.

AFIO_EXTI_PF 

Use port E (PEx) pin.

AFIO_EXTI_PG 

Use port E (PEx) pin.

Definition at line 40 of file exti.h.

◆ exti_trigger_mode

External interrupt trigger mode

Enumerator
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

Definition at line 51 of file exti.h.

Function Documentation

◆ EXTI0_IRQHandler()

void EXTI0_IRQHandler ( void  )

Definition at line 201 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI15_10_IRQHandler()

void EXTI15_10_IRQHandler ( void  )

Definition at line 235 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI1_IRQHandler()

void EXTI1_IRQHandler ( void  )

Definition at line 206 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI2_IRQHandler()

void EXTI2_IRQHandler ( void  )

Definition at line 211 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI3_IRQHandler()

void EXTI3_IRQHandler ( void  )

Definition at line 216 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI4_IRQHandler()

void EXTI4_IRQHandler ( void  )

Definition at line 221 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EXTI9_5_IRQHandler()

void EXTI9_5_IRQHandler ( void  )

Definition at line 226 of file exti.c.

Referenced by exti_clear_pending_bit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exti_attach_interrupt()

void exti_attach_interrupt ( afio_exti_num  num,
afio_exti_port  port,
Handler  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
numExternal interrupt line number.
portPort to use as source input for external interrupt.
handlerFunction handler to execute when interrupt is triggered.
modeType of transition to trigger on, one of: EXTI_RISING, EXTI_FALLING, EXTI_RISING_FALLING.
See also
afio_exti_num
afio_exti_port
voidFuncPtr
exti_trigger_mode

Definition at line 65 of file exti.c.

Here is the call graph for this function:

◆ exti_attach_interrupt_pri()

void exti_attach_interrupt_pri ( afio_exti_num  num,
afio_exti_port  port,
Handler  handler,
exti_trigger_mode  mode,
uint8_t  priority 
)

Definition at line 103 of file exti.c.

Referenced by F4Light::GPIO::_attach_interrupt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exti_clear_pending_bit()

static void exti_clear_pending_bit ( uint32_t  EXTI_Line)
inlinestatic

Definition at line 126 of file exti.h.

Referenced by exti_attach_interrupt(), exti_attach_interrupt_pri(), and exti_serv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exti_detach_interrupt()

void exti_detach_interrupt ( afio_exti_num  num)

Unregister an external interrupt handler.

Parameters
numNumber of the external interrupt line to disable.
See also
afio_exti_num

Definition at line 143 of file exti.c.

Referenced by F4Light::GPIO::detach_interrupt().

Here is the caller graph for this function:

◆ exti_enable_interrupt()

void exti_enable_interrupt ( afio_exti_num  num,
bool  e 
)

Definition at line 164 of file exti.c.

Referenced by F4Light::GPIO::enable_interrupt().

Here is the caller graph for this function:

◆ exti_init()

void exti_init ( )

Definition at line 46 of file exti.c.

Referenced by setupNVIC().

Here is the caller graph for this function:

◆ interrupts()

static INLINE void interrupts ( )
static

Re-enable interrupts.

Call this after noInterrupts() to re-enable interrupt handling, after you have finished with a timing-critical section of code.

See also
noInterrupts()

Definition at line 106 of file exti.h.

Referenced by F4Light::Scheduler::_micros64(), F4Light::Scheduler::dequeue_task(), F4Light::Scheduler::enqueue_task(), F4Light::_parser::get_last_change(), F4Light::_parser::get_last_signal(), F4Light::_parser::get_val(), F4Light::_parser::get_valid_channels(), init(), F4Light::Scheduler::init(), F4Light::AnalogSource::set_pin(), F4Light::Scheduler::stop_task(), F4Light::Scheduler::unregister_timer_task(), VCP_DataAvail(), VCP_DataAvailContig(), VCP_MarkRead(), VCP_MarkWritten(), VCP_SpaceAvail(), and VCP_SpaceAvailContig().

Here is the caller graph for this function:

◆ noInterrupts()

static INLINE void noInterrupts ( )
static

Disable interrupts.

After calling this function, all user-programmable interrupts will be disabled. You can call this function before a timing-critical section of code, then call interrupts() to re-enable interrupt handling.

See also
interrupts()

Definition at line 120 of file exti.h.

Referenced by F4Light::Scheduler::_micros64(), F4Light::Scheduler::dequeue_task(), F4Light::Scheduler::enqueue_task(), F4Light::_parser::get_last_change(), F4Light::_parser::get_last_signal(), F4Light::_parser::get_val(), F4Light::_parser::get_valid_channels(), F4Light::Scheduler::init(), F4Light::AnalogSource::set_pin(), F4Light::Scheduler::stop_task(), F4Light::Scheduler::unregister_timer_task(), VCP_DataAvail(), VCP_DataAvailContig(), VCP_MarkRead(), VCP_MarkWritten(), VCP_SpaceAvail(), and VCP_SpaceAvailContig().

Here is the caller graph for this function: