Interface.
Analog Comparator Interface is able to control a number of Analog Comparators (AC) with identical behavior.
Data Structures | |
struct | acifb_channel_t |
AC channel configuration. More... | |
struct | acifb_t |
ACIFB configuration. More... | |
struct | acifb_window_t |
AC Window configuration. More... | |
Macros | |
#define | ACIFB_POLL_TIMEOUT 10000 |
The timeguard used for polling. More... | |
Functions | |
void | acifb_channels_setup (volatile avr32_acifb_t *acifb, const acifb_channel_t *ac_chan, uint32_t nb_chan) |
Configure a set of AC channels in normal mode. More... | |
static void | acifb_clear_all_interrupt_flags (volatile avr32_acifb_t *acifb) |
Clear ACIFB all interrupt flags. More... | |
static void | acifb_clear_comparison_interrupt_flag (volatile avr32_acifb_t *acifb, uint8_t ac_channel) |
Clear ACIFB comparison complete interrupt flags. More... | |
static void | acifb_clear_interrupt_flag (volatile avr32_acifb_t *acifb, uint32_t interrupt_mask) |
Clear ACIFB interrupt flags. More... | |
static void | acifb_clear_startup_interrupt_flag (volatile avr32_acifb_t *acifb, uint8_t ac_channel) |
Clear ACIFB startup interrupt flags. More... | |
static void | acifb_clear_window_interrupt_flag (volatile avr32_acifb_t *acifb, uint8_t ac_combination) |
Clear ACIFB comparison window mode interrupt flags. More... | |
static void | acifb_disable (volatile avr32_acifb_t *acifb) |
Disable ACIFB. More... | |
static void | acifb_disable_all_interrupts (volatile avr32_acifb_t *acifb) |
Disable all ACIFB interrupts. More... | |
static void | acifb_disable_comparison_interrupt (volatile avr32_acifb_t *acifb, uint8_t ac_channel) |
Disable ACIFB comparison complete interrupt. More... | |
static void | acifb_disable_interrupt (volatile avr32_acifb_t *acifb, uint32_t interrupt_mask) |
Disable ACIFB interrupts. More... | |
static void | acifb_disable_startup_interrupt (volatile avr32_acifb_t *acifb, uint8_t ac_channel) |
Disable ACIFB startup interrupt. More... | |
static void | acifb_disable_window_interrupt (volatile avr32_acifb_t *acifb, uint8_t ac_combination) |
Disable ACIFB comparison window mode interrupt. More... | |
static void | acifb_enable_comparison_interrupt (volatile avr32_acifb_t *acifb, uint8_t ac_channel) |
Enable ACIFB comparison complete interrupt. More... | |
static void | acifb_enable_interrupt (volatile avr32_acifb_t *acifb, uint32_t interrupt_mask) |
Enable ACIFB interrupts. More... | |
static void | acifb_enable_startup_interrupt (volatile avr32_acifb_t *acifb, uint8_t ac_channel) |
Enable ACIFB startup interrupt. More... | |
static void | acifb_enable_window_interrupt (volatile avr32_acifb_t *acifb, uint8_t ac_combination) |
Enable ACIFB comparison window mode interrupt. More... | |
void | acifb_setup_and_enable (volatile avr32_acifb_t *acifb, const acifb_t *ac) |
Configure and enable the ACIFB module. More... | |
static void | acifb_test_event_trigger_single_comparison (volatile avr32_acifb_t *acifb) |
Test event trigger for single analog comparison. More... | |
static void | acifb_user_trigger_single_comparison (volatile avr32_acifb_t *acifb) |
Trigger a Analog comparison. More... | |
bool | acifb_wait_channels_ready (volatile avr32_acifb_t *acifb, const uint32_t acrdy_mask) |
Wait for channels to be ready. More... | |
void | acifb_windows_setup (volatile avr32_acifb_t *acifb, const acifb_window_t *ac_window, uint32_t nb_combinations) |
Configure a set of AC channels in Window mode. More... | |
#define ACIFB_POLL_TIMEOUT 10000 |
The timeguard used for polling.
Referenced by acifb_wait_channels_ready().
void acifb_channels_setup | ( | volatile avr32_acifb_t * | acifb, |
const acifb_channel_t * | ac_chan, | ||
uint32_t | nb_chan | ||
) |
Configure a set of AC channels in normal mode.
acifb | Base address of the ACIFB |
ac_chan | Array of channels configuration [INPUT] |
nb_chan | The size of the ac_chan[] array [INPUT] |
References acifb_channel_t::event_negative, acifb_channel_t::filter_len, acifb_channel_t::hysteresis_value, acifb_channel_t::interrupt_settings, acifb_channel_t::mode, acifb_channel_t::negative_input, and acifb_channel_t::positive_input.
Referenced by ac_init().
|
inlinestatic |
Clear ACIFB all interrupt flags.
acifb | Base address of the ACIFB module |
|
inlinestatic |
Clear ACIFB comparison complete interrupt flags.
acifb | Base address of the ACIFB module |
ac_channel | ACIFB Channel Used |
Referenced by ISR().
|
inlinestatic |
Clear ACIFB interrupt flags.
*acifb | Base address of the ACIFB module |
interrupt_mask | Bitmask of interrupts to clear |
|
inlinestatic |
Clear ACIFB startup interrupt flags.
acifb | Base address of the ACIFB module |
ac_channel | ACIFB Channel Used |
|
inlinestatic |
Clear ACIFB comparison window mode interrupt flags.
acifb | Base address of the ACIFB module |
ac_combination | ACIFB Channel combination Used |
|
inlinestatic |
Disable ACIFB.
acifb | Base address of the ACIFB module |
|
inlinestatic |
Disable all ACIFB interrupts.
acifb | Base address of the ACIFB module |
|
inlinestatic |
Disable ACIFB comparison complete interrupt.
*acifb | Base address of the ACIFB module |
ac_channel | ACIFB Channel Used |
|
inlinestatic |
Disable ACIFB interrupts.
acifb | Base address of the ACIFB module |
interrupt_mask | Bitmask of interrupts to disable |
|
inlinestatic |
Disable ACIFB startup interrupt.
acifb | Base address of the ACIFB module |
ac_channel | ACIFB Channel Used |
|
inlinestatic |
Disable ACIFB comparison window mode interrupt.
acifb | Base address of the ACIFB module |
ac_combination | ACIFB Channel combination Used |
|
inlinestatic |
Enable ACIFB comparison complete interrupt.
acifb | Base address of the ACIFB module |
ac_channel | ACIFB Channel Used |
Referenced by ac_init().
|
inlinestatic |
Enable ACIFB interrupts.
acifb | Base address of the ACIFB module |
interrupt_mask | Bitmask of interrupts to enable |
|
inlinestatic |
Enable ACIFB startup interrupt.
acifb | Base address of the ACIFB module |
ac_channel | ACIFB Channel Used |
|
inlinestatic |
Enable ACIFB comparison window mode interrupt.
acifb | Base address of the ACIFB module |
ac_combination | ACIFB Channel combination Used |
void acifb_setup_and_enable | ( | volatile avr32_acifb_t * | acifb, |
const acifb_t * | ac | ||
) |
Configure and enable the ACIFB module.
acifb | Base address of the ACIFB |
ac | ACIFB configuration [INPUT] |
References acifb_t::actest, acifb_t::eventen, and acifb_t::sut.
Referenced by ac_init().
|
inlinestatic |
Test event trigger for single analog comparison.
acifb | Base address of the ACIFB module |
|
inlinestatic |
Trigger a Analog comparison.
acifb | Base address of the ACIFB module |
bool acifb_wait_channels_ready | ( | volatile avr32_acifb_t * | acifb, |
const uint32_t | acrdy_mask | ||
) |
Wait for channels to be ready.
acifb | Base address of the ACIFB |
acrdy_mask | Mask of several AVR32_ACIFB_SR_ACRDYn_MASK [INPUT] |
false | Timeout on ACIFB configuration |
true | ACIFB channels are ready |
References ACIFB_POLL_TIMEOUT.
void acifb_windows_setup | ( | volatile avr32_acifb_t * | acifb, |
const acifb_window_t * | ac_window, | ||
uint32_t | nb_combinations | ||
) |
Configure a set of AC channels in Window mode.
acifb | Base address of the ACIFB |
ac_window | Array of Windows configuration [INPUT] |
nb_combinations | The size of the ac_window[] array [INPUT] |
References acifb_window_t::interrupt_settings, acifb_window_t::window_event, and acifb_window_t::window_mode.