APM:Libraries
Classes | Macros | Typedefs | Functions | Variables
exti.c File Reference
#include "exti.h"
#include "hal.h"
#include "util.h"
#include "nvic.h"
Include dependency graph for exti.c:

Go to the source code of this file.

Classes

struct  exti_channel
 

Macros

#define NUM_IRQ   (sizeof(exti_channels)/sizeof(exti_channel))
 

Typedefs

typedef struct exti_channel exti_channel
 

Functions

void exti_init ()
 
static EXTITrigger_TypeDef get_exti_mode (exti_trigger_mode mode)
 
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 void exti_serv (uint32_t extline, uint8_t num)
 
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)
 

Variables

static const exti_channel exti_channels []
 
static Handler handlers [NUM_IRQIN_CCM
 

Macro Definition Documentation

◆ NUM_IRQ

#define NUM_IRQ   (sizeof(exti_channels)/sizeof(exti_channel))

Definition at line 41 of file exti.c.

Typedef Documentation

◆ exti_channel

typedef struct exti_channel exti_channel

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_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:

◆ exti_serv()

static void exti_serv ( uint32_t  extline,
uint8_t  num 
)
static

Definition at line 178 of file exti.c.

Referenced by EXTI0_IRQHandler(), EXTI15_10_IRQHandler(), EXTI1_IRQHandler(), EXTI2_IRQHandler(), EXTI3_IRQHandler(), EXTI4_IRQHandler(), and EXTI9_5_IRQHandler().

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

◆ get_exti_mode()

static EXTITrigger_TypeDef get_exti_mode ( exti_trigger_mode  mode)
inlinestatic

Definition at line 51 of file exti.c.

Referenced by exti_attach_interrupt(), and exti_attach_interrupt_pri().

Here is the caller graph for this function:

Variable Documentation

◆ exti_channels

const exti_channel exti_channels[]
static
Initial value:
= {
{ .irq_line = EXTI_Line0, .irq_type = EXTI0_IRQn },
{ .irq_line = EXTI_Line1, .irq_type = EXTI1_IRQn },
{ .irq_line = EXTI_Line2, .irq_type = EXTI2_IRQn },
{ .irq_line = EXTI_Line3, .irq_type = EXTI3_IRQn },
{ .irq_line = EXTI_Line4, .irq_type = EXTI4_IRQn },
{ .irq_line = EXTI_Line5, .irq_type = EXTI9_5_IRQn },
{ .irq_line = EXTI_Line6, .irq_type = EXTI9_5_IRQn },
{ .irq_line = EXTI_Line7, .irq_type = EXTI9_5_IRQn },
{ .irq_line = EXTI_Line8, .irq_type = EXTI9_5_IRQn },
{ .irq_line = EXTI_Line9, .irq_type = EXTI9_5_IRQn },
{ .irq_line = EXTI_Line10, .irq_type = EXTI15_10_IRQn },
{ .irq_line = EXTI_Line11, .irq_type = EXTI15_10_IRQn },
{ .irq_line = EXTI_Line12, .irq_type = EXTI15_10_IRQn },
{ .irq_line = EXTI_Line13, .irq_type = EXTI15_10_IRQn },
{ .irq_line = EXTI_Line14, .irq_type = EXTI15_10_IRQn },
{ .irq_line = EXTI_Line15, .irq_type = EXTI15_10_IRQn },
}

Definition at line 22 of file exti.c.

◆ IN_CCM

Handler handlers [NUM_IRQ] IN_CCM
static

Definition at line 43 of file exti.c.