Microchip® Advanced Software Framework

events.c File Reference
#include <events.h>
#include <system.h>
#include <system_interrupt.h>
#include <status_codes.h>

Macros

#define EVENTS_INVALID_CHANNEL   0xff
 

Functions

uint32_t _events_find_bit_position (uint8_t channel, uint8_t start_offset)
 
static uint8_t _events_find_first_free_channel_and_allocate (void)
 
static void _events_release_channel (uint8_t channel)
 
void _system_events_init (void)
 
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 ()
 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...
 

Variables

struct _events_module _events_inst
 

#define EVENTS_INVALID_CHANNEL   0xff

void _system_events_init ( void  )

struct _events_module _events_inst
Initial value:
= {
.allocated_channels = 0,
.free_channels = EVSYS_CHANNELS,
.interrupt_flag_buffer = 0,
.interrupt_flag_ack_buffer = 0,
.hook_list = NULL,
}
#define NULL
Definition: nm_bsp.h:64

Referenced by events_ack_interrupt(), events_add_hook(), events_del_hook(), events_is_interrupt_set(), and EVSYS_Handler().