The Peripheral EVent Controller (PEVC) offers a set of features that allows peripherals to interact without intervention from the CPU.
The PEVC connects Event Generators to Event Users.
|
struct | pevc_evs_opt_t |
| Parameters of a channel Event Shaper (for channels with asynchronous and external inputs). More...
|
|
|
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...
|
|
#define | PEVC_IGFD_SET(pevc, igfd) (pevc)->igfdr = ((igfd)<<AVR32_PEVC_IGFDR_IGFDR_OFFSET) & AVR32_PEVC_IGFDR_IGFDR_MASK; |
|
#define PEVC_CHANNEL_BUSY 1 |
#define PEVC_CHANNEL_IDLE 0 |
#define PEVC_CHANNEL_SEV_DISABLE |
( |
|
pevc, |
|
|
|
chan_id |
|
) |
| ((pevc)->CHMX[(chan_id)].smx = DISABLE) |
#define PEVC_CHANNEL_SEV_ENABLE |
( |
|
pevc, |
|
|
|
chan_id |
|
) |
| ((pevc)->CHMX[(chan_id)].smx = ENABLE) |
#define PEVC_CHANNELS_DISABLE |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
Value:if((chan_mask)<=0x80000000) (pevc)->chdr0 = (chan_mask);
\
else (pevc)->chdr1 = (chan_mask);
else
Definition: lwip-1.4.1/src/core/memp.c:418
Referenced by pevc_channels_disable().
#define PEVC_CHANNELS_DISABLE_OVERRUN_INTERRUPT |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
#define PEVC_CHANNELS_DISABLE_TRIGGER_INTERRUPT |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
#define PEVC_CHANNELS_ENABLE |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
#define PEVC_CHANNELS_ENABLE_OVERRUN_INTERRUPT |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
#define PEVC_CHANNELS_ENABLE_TRIGGER_INTERRUPT |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
#define PEVC_CHANNELS_TRIGGER_SEV |
( |
|
pevc, |
|
|
|
chan_mask |
|
) |
| |
Value:if((chan_mask)<=0x80000000) (pevc)->sev0 = (chan_mask);
\
else (pevc)->sev1 = (chan_mask);
else
Definition: lwip-1.4.1/src/core/memp.c:418
Referenced by pevc_channels_trigger_sev().
#define PEVC_EVS_EVF_OFF false |
#define PEVC_EVS_EVF_ON true |
#define PEVC_EVS_EVR_OFF false |
#define PEVC_EVS_EVR_ON true |
#define PEVC_EVS_IGF_OFF false |
#define PEVC_EVS_IGF_ON true |
#define PEVC_IGFD_SET |
( |
|
pevc, |
|
|
|
igfd |
|
) |
| (pevc)->igfdr = ((igfd)<<AVR32_PEVC_IGFDR_IGFDR_OFFSET) & AVR32_PEVC_IGFDR_IGFDR_MASK; |
#define PEVC_NUMBER_OF_EVENT_GENERATORS AVR32_PEVC_EVIN_BITS |
#define PEVC_NUMBER_OF_EVENT_USERS AVR32_PEVC_TRIGOUT_BITS |
Number of event users.
Referenced by ISR(), pevc_channel_clear_overrun_interrupt(), pevc_channel_clear_trigger_interrupt(), pevc_channel_configure(), pevc_channel_is_overrun_interrupt_enabled(), pevc_channel_is_overrun_interrupt_raised(), pevc_channel_is_trigger_interrupt_enabled(), pevc_channel_is_trigger_interrupt_raised(), pevc_channel_sev_disable(), pevc_channel_sev_enable(), pevc_get_channel_state(), and pevc_get_channel_status().
void pevc_channel_clear_overrun_interrupt |
( |
volatile avr32_pevc_t * |
pevc, |
|
|
unsigned short int |
chan_id |
|
) |
| |
void pevc_channel_clear_trigger_interrupt |
( |
volatile avr32_pevc_t * |
pevc, |
|
|
unsigned short int |
chan_id |
|
) |
| |
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 |
|
) |
| |
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.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel id |
- Returns
- bool true if the channel trigger interrupt is enabled false if the channel trigger interrupt is disabled
References Assert, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
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.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel id |
- Returns
- bool true if the channel trigger interrupt was raised false otherwise
References Assert, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
Referenced by ISR().
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.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel id |
- Returns
- bool true if the channel trigger interrupt is enabled false if the channel trigger interrupt is disabled
References Assert, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
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.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel id |
- Returns
- bool true if the channel trigger interrupt was raised false otherwise
References Assert, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
Referenced by ISR().
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.
- Note
- When the sev is disabled, the event generator is the input event for the channel.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel to configure |
References Assert, DISABLE, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
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.
- Note
- When the sev is enabled, the event generator is ignored.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel to configure |
References Assert, ENABLE, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
void pevc_channels_disable |
( |
volatile avr32_pevc_t * |
pevc, |
|
|
unsigned long long int |
chan_mask |
|
) |
| |
Disable one or more channels.
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_DISABLE.
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.
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_DISABLE_OVERRUN_INTERRUPT.
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.
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_DISABLE_TRIGGER_INTERRUPT.
void pevc_channels_enable |
( |
volatile avr32_pevc_t * |
pevc, |
|
|
unsigned long long int |
chan_mask |
|
) |
| |
Enable one or more channels.
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_ENABLE.
Referenced by init_pevc().
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.
- Note
- An overrun interrupt is raised when an event could not be forwarded to a channel user (if the channel state is busy or if the previous event is still being processed).
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_ENABLE_OVERRUN_INTERRUPT.
Referenced by init_pevc().
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.
- Note
- A trigger interrupt is raised when an event trigger is forwarded to a channel user (if the channel state is ready).
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_ENABLE_TRIGGER_INTERRUPT.
Referenced by init_pevc().
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.
- Note
- the channel must have previously been enabled.
- Parameters
-
*pevc | Base address of the PEVC |
chan_mask | bitmask of channel masks to enable (1 bit per channel, up to 64 channels, actual number of channels depending on the part, chan_mask being (1 << chan_id)) |
References Assert, NULL, and PEVC_CHANNELS_TRIGGER_SEV.
bool pevc_get_channel_state |
( |
volatile avr32_pevc_t * |
pevc, |
|
|
unsigned short int |
chan_id |
|
) |
| |
Get the state of a channel (idle or busy)
- Note
- the channel must have previously been enabled.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel id |
- Returns
- bool PEVC_CHANNEL_BUSY if the channel is busy (i.e. it is not ready to accept an event) PEVC_CHANNEL_IDLE if the channel is idle
References Assert, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
bool pevc_get_channel_status |
( |
volatile avr32_pevc_t * |
pevc, |
|
|
unsigned short int |
chan_id |
|
) |
| |
Get the status of a channel.
- Parameters
-
*pevc | Base address of the PEVC |
chan_id | channel id |
- Returns
- bool true if channel is enabled false if channel is disabled
References Assert, NULL, and PEVC_NUMBER_OF_EVENT_USERS.
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).
- Parameters
-
*pevc | Base address of the PEVC |
igfd | Input Glitch Filter divider [0,15] |
- Note
- as stated in the datasheet, there is one divider value for all EVS instance.
References Assert, NULL, and PEVC_IGFD_SET.