Microchip® Advanced Software Framework

pio_handler.h File Reference

Parallel Input/Output (PIO) interrupt handler for SAM.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

Functions

void pio_handler_process (Pio *p_pio, uint32_t ul_id)
 Process an interrupt request on the given PIO controller. More...
 
uint32_t pio_handler_set (Pio *p_pio, uint32_t ul_id, uint32_t ul_mask, uint32_t ul_attr, void(*p_handler)(uint32_t, uint32_t))
 Set an interrupt handler for the provided pins. More...
 
uint32_t pio_handler_set_pin (uint32_t ul_pin, uint32_t ul_flag, void(*p_handler)(uint32_t, uint32_t))
 
void pio_handler_set_priority (Pio *p_pio, IRQn_Type ul_irqn, uint32_t ul_priority)
 Initialize PIO interrupt management logic. More...
 

void pio_handler_process ( Pio *  p_pio,
uint32_t  ul_id 
)

Process an interrupt request on the given PIO controller.

Parameters
p_pioPIO controller base address.
ul_idPIO controller ID.

References gs_interrupt_sources, s_interrupt_source::handler, s_interrupt_source::mask, MAX_INTERRUPT_SOURCES, pio_get_interrupt_mask(), and pio_get_interrupt_status().

uint32_t pio_handler_set ( Pio *  p_pio,
uint32_t  ul_id,
uint32_t  ul_mask,
uint32_t  ul_attr,
void(*)(uint32_t, uint32_t)  p_handler 
)

Set an interrupt handler for the provided pins.

The provided handler will be called with the triggering pin as its parameter as soon as an interrupt is detected.

Parameters
p_pioPIO controller base address.
ul_idPIO ID.
ul_maskPins (bit mask) to configure.
ul_attrPins attribute to configure.
p_handlerInterrupt handler function pointer.
Returns
0 if successful, 1 if the maximum number of sources has been defined.

References s_interrupt_source::attr, gs_interrupt_sources, gs_ul_nb_sources, s_interrupt_source::handler, s_interrupt_source::id, s_interrupt_source::mask, MAX_INTERRUPT_SOURCES, and pio_configure_interrupt().

Referenced by configure_button().

uint32_t pio_handler_set_pin ( uint32_t  ul_pin,
uint32_t  ul_flag,
void(*)(uint32_t, uint32_t)  p_handler 
)
void pio_handler_set_priority ( Pio *  p_pio,
IRQn_Type  ul_irqn,
uint32_t  ul_priority 
)

Initialize PIO interrupt management logic.

Parameters
p_pioPIO controller base address.
ul_irqnNVIC line number.
ul_priorityPIO controller interrupts priority.

References pio_disable_interrupt(), pio_enable_interrupt(), pio_get_interrupt_mask(), and pio_get_interrupt_status().

Referenced by init_specific_board().