Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Asfdoc_sam0_events_group

Modules

 

Enumerations

enum  events_interrupt_source {
  EVENTS_INTERRUPT_OVERRUN,
  EVENTS_INTERRUPT_DETECT
}
 Interrupt source enumerator. More...
 

Functions

enum status_code events_ack_interrupt (struct events_resource *resource, enum events_interrupt_source source)
 Acknowledge an interrupt source. More...
 
enum status_code events_add_hook (struct events_resource *resource, struct events_hook *hook)
 Insert hook into the event drivers interrupt hook queue. More...
 
enum status_code events_create_hook (struct events_hook *hook, events_interrupt_hook hook_func)
 Initializes an interrupt hook for insertion in the event interrupt hook queue. More...
 
enum status_code events_del_hook (struct events_resource *resource, struct events_hook *hook)
 Remove hook from the event drivers interrupt hook queue. More...
 
enum status_code events_disable_interrupt_source (struct events_resource *resource, enum events_interrupt_source source)
 Disable interrupt source. More...
 
enum status_code events_enable_interrupt_source (struct events_resource *resource, enum events_interrupt_source source)
 Enable interrupt source. More...
 
bool events_is_interrupt_set (struct events_resource *resource, enum events_interrupt_source source)
 Check if interrupt source is set. More...
 

Interrupt source enumerator.

Interrupt source selector definitions.

Enumerator
EVENTS_INTERRUPT_OVERRUN 

Overrun in event channel detected interrupt.

EVENTS_INTERRUPT_DETECT 

Event signal propagation in event channel detected interrupt.

enum status_code events_ack_interrupt ( struct events_resource *  resource,
enum events_interrupt_source  source 
)

Acknowledge an interrupt source.

Acknowledge an interrupt source so the interrupt state is cleared in hardware.

Parameters
[in]resourcePointer to an events_resource struct instance
[in]sourceOne of the members in the events_interrupt_source enumerator
Returns
Status of the interrupt source.
Return values
STATUS_OKInterrupt source was acknowledged successfully

References _events_inst, Assert, EVENTS_INTERRUPT_DETECT, EVENTS_INTERRUPT_OVERRUN, _events_module::interrupt_flag_ack_buffer, STATUS_ERR_INVALID_ARG, and STATUS_OK.

Referenced by event_counter().

enum status_code events_add_hook ( struct events_resource *  resource,
struct events_hook *  hook 
)

Insert hook into the event drivers interrupt hook queue.

Inserts a hook into the event drivers interrupt hook queue.

Parameters
[in]resourcePointer to an events_resource struct instance
[in]hookPointer to an events_hook struct instance
Returns
Status of the insertion procedure.
Return values
STATUS_OKInsertion of hook went successful

References _events_inst, _events_module::hook_list, NULL, resource, STATUS_OK, system_interrupt_enable(), system_interrupt_is_enabled(), and SYSTEM_INTERRUPT_MODULE_EVSYS.

Referenced by configure_event_interrupt().

enum status_code events_create_hook ( struct events_hook *  hook,
events_interrupt_hook  hook_func 
)

Initializes an interrupt hook for insertion in the event interrupt hook queue.

Initializes a hook structure so it is ready for insertion in the interrupt hook queue.

Parameters
[out]hookPointer to an events_hook struct instance
[in]hook_funcPointer to a function containing the interrupt hook code
Returns
Status of the hook creation procedure.
Return values
STATUS_OKCreation and initialization of interrupt hook went successful

References NULL, and STATUS_OK.

Referenced by configure_event_interrupt().

enum status_code events_del_hook ( struct events_resource *  resource,
struct events_hook *  hook 
)

Remove hook from the event drivers interrupt hook queue.

Removes a hook from the event drivers interrupt hook queue.

Parameters
[in]resourcePointer to an events_resource struct instance
[in]hookPointer to an events_hook struct instance
Returns
Status of the removal procedure.
Return values
STATUS_OKRemoval of hook went successful
STATUS_ERR_NO_MEMORYThere are no hooks instances in the event driver interrupt hook list
STATUS_ERR_NOT_FOUNDInterrupt hook not found in the event drivers interrupt hook list

References _events_inst, _events_module::hook_list, NULL, STATUS_ERR_NO_MEMORY, STATUS_ERR_NOT_FOUND, and STATUS_OK.

enum status_code events_disable_interrupt_source ( struct events_resource *  resource,
enum events_interrupt_source  source 
)

Disable interrupt source.

Disable an interrupt source so can trigger execution of an interrupt hook.

Parameters
[in]resourcePointer to an events_resource struct instance
[in]sourceOne of the members in the events_interrupt_source enumerator
Returns
Status of the interrupt source enable procedure.
Return values
STATUS_OKEnabling of the interrupt source went successful
STATUS_ERR_INVALID_ARGInterrupt source does not exist

References Assert, EVENTS_INTERRUPT_DETECT, EVENTS_INTERRUPT_OVERRUN, STATUS_ERR_INVALID_ARG, and STATUS_OK.

enum status_code events_enable_interrupt_source ( struct events_resource *  resource,
enum events_interrupt_source  source 
)

Enable interrupt source.

Enable an interrupt source so can trigger execution of an interrupt hook.

Parameters
[in]resourcePointer to an events_resource struct instance
[in]sourceOne of the members in the events_interrupt_source enumerator
Returns
Status of the interrupt source enable procedure.
Return values
STATUS_OKEnabling of the interrupt source was successful
STATUS_ERR_INVALID_ARGInterrupt source does not exist

References Assert, EVENTS_INTERRUPT_DETECT, EVENTS_INTERRUPT_OVERRUN, STATUS_ERR_INVALID_ARG, and STATUS_OK.

Referenced by configure_event_interrupt().

bool events_is_interrupt_set ( struct events_resource *  resource,
enum events_interrupt_source  source 
)

Check if interrupt source is set.

Check if an interrupt source is set and should be processed.

Parameters
[in]resourcePointer to an events_resource struct instance
[in]sourceOne of the members in the events_interrupt_source enumerator
Returns
Status of the interrupt source.
Return values
trueInterrupt source is set
falseInterrupt source is not set

References _events_inst, Assert, EVENTS_INTERRUPT_DETECT, EVENTS_INTERRUPT_OVERRUN, and _events_module::interrupt_flag_buffer.

Referenced by event_counter().