Microchip® Advanced Software Framework

events.h File Reference

SAM Event System Driver.

Copyright (c) 2012-2020 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include "events_common.h"

Data Structures

struct  events_config
 Events configuration struct. More...
 
struct  events_hook
 Event hook. More...
 
struct  events_resource
 Event channel resource. More...
 

Macros

#define EVSYS_ID_GEN_NONE   0
 No event generator definition. More...
 

Typedefs

typedef void(* events_interrupt_hook )(struct events_resource *resource)
 

Enumerations

enum  events_edge_detect {
  EVENTS_EDGE_DETECT_NONE,
  EVENTS_EDGE_DETECT_RISING,
  EVENTS_EDGE_DETECT_FALLING,
  EVENTS_EDGE_DETECT_BOTH
}
 Edge detect enum. More...
 
enum  events_path_selection {
  EVENTS_PATH_SYNCHRONOUS,
  EVENTS_PATH_RESYNCHRONIZED,
  EVENTS_PATH_ASYNCHRONOUS
}
 Path selection enum. More...
 

Functions

enum status_code events_allocate (struct events_resource *resource, struct events_config *config)
 Allocate an event channel and set configuration. More...
 
enum status_code events_attach_user (struct events_resource *resource, uint8_t user_id)
 Attach user to the event channel. More...
 
enum status_code events_detach_user (struct events_resource *resource, uint8_t user_id)
 Detach a user peripheral from the event channel. More...
 
void events_get_config_defaults (struct events_config *config)
 Initializes an event configurations struct to defaults. More...
 
uint8_t events_get_free_channels (void)
 Get the number of free channels. More...
 
bool events_is_busy (struct events_resource *resource)
 Check if a channel is busy. More...
 
bool events_is_detected (struct events_resource *resource)
 Check if an event is detected on the event channel. More...
 
bool events_is_overrun (struct events_resource *resource)
 Check if there has been an overrun situation on this channel. More...
 
bool events_is_users_ready (struct events_resource *resource)
 Check if all users connected to the channel are ready. More...
 
enum status_code events_release (struct events_resource *resource)
 Release allocated channel back the the resource pool. More...
 
enum status_code events_trigger (struct events_resource *resource)
 Trigger software event. More...