Microchip® Advanced Software Framework

pevc.h File Reference
#include <avr32/io.h>
#include "compiler.h"
#include "uc3c_pevc_ids.h"

Data Structures

struct  pevc_evs_opt_t
 Parameters of a channel Event Shaper (for channels with asynchronous and external inputs). More...
 

Macros

Number of Event Generator and number of Event users
#define PEVC_NUMBER_OF_EVENT_GENERATORS   AVR32_PEVC_EVIN_BITS
 
#define PEVC_NUMBER_OF_EVENT_USERS   AVR32_PEVC_TRIGOUT_BITS
 Number of event users. More...
 
Channel state (Idle or Busy)
#define PEVC_CHANNEL_IDLE   0
 
#define PEVC_CHANNEL_BUSY   1
 
Event Shaper configuration values
#define PEVC_EVS_IGF_ON   true
 
#define PEVC_EVS_IGF_OFF   false
 
#define PEVC_EVS_EVF_ON   true
 
#define PEVC_EVS_EVF_OFF   false
 
#define PEVC_EVS_EVR_ON   true
 
#define PEVC_EVS_EVR_OFF   false
 

Functions

Channels state (Idle/Busy) API
bool pevc_get_channel_state (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Get the state of a channel (idle or busy) More...
 

Channels configuration API

#define PEVC_IGFD_SET(pevc, igfd)   (pevc)->igfdr = ((igfd)<<AVR32_PEVC_IGFDR_IGFDR_OFFSET) & AVR32_PEVC_IGFDR_IGFDR_MASK;
 
bool pevc_channel_configure (volatile avr32_pevc_t *pevc, unsigned short int chan_id, unsigned short int gen_id, const pevc_evs_opt_t *pevs)
 Configure a channel. More...
 
void pevc_igfd_set (volatile avr32_pevc_t *pevc, unsigned char igfd)
 Set a value for the Input Glitch Filter Divider (used by the Event Shaper). More...
 

Channels Enable/Disable API

#define PEVC_CHANNELS_ENABLE(pevc, chan_mask)
 
#define PEVC_CHANNELS_DISABLE(pevc, chan_mask)
 
void pevc_channels_enable (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Enable one or more channels. More...
 
void pevc_channels_disable (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Disable one or more channels. More...
 
bool pevc_get_channel_status (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Get the status of a channel. More...
 

Channels Software Event API

#define PEVC_CHANNEL_SEV_ENABLE(pevc, chan_id)   ((pevc)->CHMX[(chan_id)].smx = ENABLE)
 
#define PEVC_CHANNELS_TRIGGER_SEV(pevc, chan_mask)
 
#define PEVC_CHANNEL_SEV_DISABLE(pevc, chan_id)   ((pevc)->CHMX[(chan_id)].smx = DISABLE)
 
void pevc_channel_sev_enable (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Enable the Software Event as the event source for a channel. More...
 
void pevc_channels_trigger_sev (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Trigger a software event to one or more channels. More...
 
void pevc_channel_sev_disable (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Disable the Software Event as the event source for a channel. More...
 

Channels trigger interrupt API

#define PEVC_CHANNELS_ENABLE_TRIGGER_INTERRUPT(pevc, chan_mask)
 
#define PEVC_CHANNELS_DISABLE_TRIGGER_INTERRUPT(pevc, chan_mask)
 
void pevc_channels_enable_trigger_interrupt (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Enable the event trigger interrupt of one or more channels. More...
 
void pevc_channels_disable_trigger_interrupt (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Disable the event trigger interrupt of one or more channels. More...
 
bool pevc_channel_is_trigger_interrupt_enabled (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Check if the event trigger interrupt for a given channel is enabled. More...
 
bool pevc_channel_is_trigger_interrupt_raised (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Check if the event trigger interrupt was raised for a given channel. More...
 
void pevc_channel_clear_trigger_interrupt (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Clear the event trigger interrupt for a given channel. More...
 

Channels overrun interrupt API

#define PEVC_CHANNELS_ENABLE_OVERRUN_INTERRUPT(pevc, chan_mask)
 
#define PEVC_CHANNELS_DISABLE_OVERRUN_INTERRUPT(pevc, chan_mask)
 
void pevc_channels_enable_overrun_interrupt (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Enable the event overrun interrupt of one or more channels. More...
 
void pevc_channels_disable_overrun_interrupt (volatile avr32_pevc_t *pevc, unsigned long long int chan_mask)
 Disable the event overrun interrupt of one or more channels. More...
 
bool pevc_channel_is_overrun_interrupt_enabled (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Check if the event overrun interrupt for a given channel is enabled. More...
 
bool pevc_channel_is_overrun_interrupt_raised (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Check if the event overrun interrupt was raised for a given channel. More...
 
void pevc_channel_clear_overrun_interrupt (volatile avr32_pevc_t *pevc, unsigned short int chan_id)
 Clear the event overrun interrupt for a given channel. More...