px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_exti.h : External interrupt peripheral driver

Description

Driver for external interrupts.

File(s):

The driver must be configured by supplying a project specific "px_exti_cfg.h". "px_exti_cfg_template.h" can be copied, renamed and modified to supply compile time options.

There are only 16 external interrupts (0 to 15). If Port A pin 0 is configured as external interrupt 0 for example, then Port B pin 0 can not be configured too, because it has already been assigned to A0.

When an external interrupt is disabled, it will not detect an interrupt condition and will not set the interrupt pending flag.

Typedefs

typedef void(* px_exti_handler_t) (void)
 Definition for a pointer to a function that will be called when the external interrupt triggers. More...
 

Enumerations

enum  px_exti_line_t
 External Interupt line. More...
 
enum  px_exti_port_t
 External interrupt port. More...
 
enum  px_exti_type_t
 External interrupt type. More...
 

Functions

void px_exti_init (void)
 Initialise External Interrupt driver. More...
 
void px_exti_open (px_exti_port_t exti_port, px_exti_line_t exti_line, px_exti_handler_t exti_handler)
 Configure External Interrupt. More...
 
void px_exti_type_set (px_exti_line_t exti_line, px_exti_type_t exti_type)
 Set External Interrupt type (fallig or rising edge or both) More...
 
void px_exti_enable (px_exti_line_t exti_line)
 Enable External Interrupt. More...
 
void px_exti_disable (px_exti_line_t exti_line)
 Disable External Interrupt. More...
 

Individual enable/disable of each external interrupt (0 to 15)

#define PX_EXTI_CFG_INT0_EN   1
 
#define PX_EXTI_CFG_INT1_EN   1
 
#define PX_EXTI_CFG_INT2_EN   1
 
#define PX_EXTI_CFG_INT3_EN   1
 
#define PX_EXTI_CFG_INT4_EN   1
 
#define PX_EXTI_CFG_INT5_EN   1
 
#define PX_EXTI_CFG_INT6_EN   1
 
#define PX_EXTI_CFG_INT7_EN   1
 
#define PX_EXTI_CFG_INT8_EN   1
 
#define PX_EXTI_CFG_INT9_EN   1
 
#define PX_EXTI_CFG_INT10_EN   1
 
#define PX_EXTI_CFG_INT11_EN   1
 
#define PX_EXTI_CFG_INT12_EN   1
 
#define PX_EXTI_CFG_INT13_EN   1
 
#define PX_EXTI_CFG_INT14_EN   1
 
#define PX_EXTI_CFG_INT15_EN   1
 

Typedef Documentation

◆ px_exti_handler_t

typedef void(* px_exti_handler_t) (void)

Definition for a pointer to a function that will be called when the external interrupt triggers.

Definition at line 142 of file px_exti.h.

Enumeration Type Documentation

◆ px_exti_line_t

External Interupt line.

Definition at line 98 of file px_exti.h.

◆ px_exti_port_t

External interrupt port.

Definition at line 119 of file px_exti.h.

◆ px_exti_type_t

External interrupt type.

Definition at line 130 of file px_exti.h.

Function Documentation

◆ px_exti_init()

void px_exti_init ( void  )

Initialise External Interrupt driver.

Definition at line 221 of file px_exti.c.

◆ px_exti_open()

void px_exti_open ( px_exti_port_t  exti_port,
px_exti_line_t  exti_line,
px_exti_handler_t  exti_handler 
)

Configure External Interrupt.

Parameters
exti_portPort (A, B,C, D, E or H)
exti_lineLine (0, 1, 2, ... or 15)
exti_handlerHandler function to be called when interrupt is triggered

Definition at line 237 of file px_exti.c.

◆ px_exti_type_set()

void px_exti_type_set ( px_exti_line_t  exti_line,
px_exti_type_t  exti_type 
)

Set External Interrupt type (fallig or rising edge or both)

Parameters
exti_lineLine (0, 1, 2, ... or 15)
exti_typeFalling or Rising Edge or Both

Definition at line 344 of file px_exti.c.

◆ px_exti_enable()

void px_exti_enable ( px_exti_line_t  exti_line)

Enable External Interrupt.

Parameters
exti_lineLine (0, 1, 2, ... or 15)

Definition at line 369 of file px_exti.c.

◆ px_exti_disable()

void px_exti_disable ( px_exti_line_t  exti_line)

Disable External Interrupt.

Parameters
exti_lineLine (0, 1, 2, ... or 15)

Definition at line 376 of file px_exti.c.