Analog Comparator Interface is able to control two Analog Comparators (AC) with identical behavior.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the ACIFA - Analog Comparator Interface. | |
Functions | |
void | acifa_clear_flags (volatile avr32_acifa_t *acifa, uint32_t flag_mask) |
Clear Flags. More... | |
void | acifa_configure (volatile avr32_acifa_t *acifa, uint8_t comp_sel, uint8_t input_p, uint8_t input_n, uint32_t pb_hz) |
Configure ACIFA Normal Mode. More... | |
void | acifa_configure_hysteresis (volatile avr32_acifa_t *acifa, uint8_t comp_sel, uint8_t level) |
Configure Hysteresis on comparator. More... | |
void | acifa_configure_vccscale (volatile avr32_acifa_t *acifa, uint8_t vccscale_sel, uint8_t scale) |
Configure VCC Scale on comparator. More... | |
void | acifa_configure_window (volatile avr32_acifa_t *acifa, uint8_t input_p, uint8_t input_n, uint8_t common_input, uint32_t pb_hz) |
Configure ACIFA Window Mode. More... | |
void | acifa_enable_interrupt (volatile avr32_acifa_t *acifa, uint32_t flag_mask) |
Enable Interrupt Flags. More... | |
void | acifa_enable_interrupt_inp_higher (volatile avr32_acifa_t *acifa, uint8_t comp_sel) |
Enable AC Interrupt when Vinp>Vin. More... | |
void | acifa_enable_interrupt_inp_lower (volatile avr32_acifa_t *acifa, uint8_t comp_sel) |
Enable AC Interrupt when Vinp<Vin. More... | |
void | acifa_enable_interrupt_toggle (volatile avr32_acifa_t *acifa, uint8_t comp_sel) |
Enable AC Interrupt when a toggle of the comparator occurs. More... | |
void | acifa_enable_output (volatile avr32_acifa_t *acifa, uint8_t comp_sel) |
Enable Output on comparator. More... | |
bool | acifa_is_aca_inp_higher (volatile avr32_acifa_t *acifa) |
Return comparator A status. More... | |
bool | acifa_is_acb_inp_higher (volatile avr32_acifa_t *acifa) |
Return comparator B status. More... | |
bool | acifa_is_ci_inside_window (volatile avr32_acifa_t *acifa) |
Return Window status. More... | |
void | acifa_start (volatile avr32_acifa_t *acifa, uint8_t comp_sel) |
Start comparator in Normal Mode. More... | |
void | acifa_start_window (volatile avr32_acifa_t *acifa) |
Start comparator in Window Mode. More... | |
void | acifa_stop (volatile avr32_acifa_t *acifa, uint8_t comp_sel) |
Stops the comparators that are currently started. More... | |
Positive Inputs Comparator 0 Instance A used by the ACIFA | |
#define | AVR32_ACIFA_AC0A_INSELP_AC0AP0 0 |
#define | AVR32_ACIFA_AC0A_INSELP_AC0AP1 1 |
#define | AVR32_ACIFA_AC0A_INSELP_DAC0_INT 2 |
Negative Inputs Comparator 0 Instance A used by the ACIFA | |
#define | AVR32_ACIFA_AC0A_INSELN_AC0AN0 0 |
#define | AVR32_ACIFA_AC0A_INSELN_AC0AN1 1 |
#define | AVR32_ACIFA_AC0A_INSELN_AC0BP0 2 |
#define | AVR32_ACIFA_AC0A_INSELN_AC0BP1 3 |
#define | AVR32_ACIFA_AC0A_INSELN_VDDANA_SCALED 4 |
#define | AVR32_ACIFA_AC0A_INSELN_DAC1_INT 5 |
Positive Inputs Comparator 0 Instance B used by the ACIFA | |
#define | AVR32_ACIFA_AC0B_INSELP_AC0AN0 0 |
#define | AVR32_ACIFA_AC0B_INSELP_AC0AN1 1 |
#define | AVR32_ACIFA_AC0B_INSELP_AC0BP0 2 |
#define | AVR32_ACIFA_AC0B_INSELP_AC0BP1 3 |
#define | AVR32_ACIFA_AC0B_INSELP_DAC0_INT 4 |
#define | AVR32_ACIFA_AC0B_INSELP_VDDANA_SCALED 5 |
Negative Inputs Comparator 0 Instance B used by the ACIFA | |
#define | AVR32_ACIFA_AC0B_INSELN_AC0BN0 0 |
#define | AVR32_ACIFA_AC0B_INSELN_AC0BN1 1 |
#define | AVR32_ACIFA_AC0B_INSELN_DAC1_INT 2 |
Positive Inputs Comparator 1 Instance A used by the ACIFA | |
#define | AVR32_ACIFA_AC1A_INSELP_AC1AP0 0 |
#define | AVR32_ACIFA_AC1A_INSELP_AC1AP1 1 |
#define | AVR32_ACIFA_AC1A_INSELP_DAC0_INT 2 |
Negative Inputs Comparator 1 Instance A used by the ACIFA | |
#define | AVR32_ACIFA_AC1A_INSELN_AC1AN0 0 |
#define | AVR32_ACIFA_AC1A_INSELN_AC1AN1 1 |
#define | AVR32_ACIFA_AC1A_INSELN_AC1BP0 2 |
#define | AVR32_ACIFA_AC1A_INSELN_AC1BP1 3 |
#define | AVR32_ACIFA_AC1A_INSELN_VDDANA_SCALED 4 |
#define | AVR32_ACIFA_AC1A_INSELN_DAC1_INT 5 |
Positive Inputs Comparator 1 Instance B used by the ACIFA | |
#define | AVR32_ACIFA_AC1B_INSELP_AC1AN0 0 |
#define | AVR32_ACIFA_AC1B_INSELP_AC1AN1 1 |
#define | AVR32_ACIFA_AC1B_INSELP_AC1BP0 2 |
#define | AVR32_ACIFA_AC1B_INSELP_AC1BP1 3 |
#define | AVR32_ACIFA_AC1B_INSELP_DAC0_INT 4 |
#define | AVR32_ACIFA_AC1B_INSELP_VDDANA_SCALED 5 |
Negative Inputs Comparator 1 Instance B used by the ACIFA | |
#define | AVR32_ACIFA_AC1B_INSELN_AC1BN0 0 |
#define | AVR32_ACIFA_AC1B_INSELN_AC1BN1 1 |
#define | AVR32_ACIFA_AC1B_INSELN_DAC1_INT 2 |
Comparator Selection | |
#define | ACIFA_COMP_SELA 1 |
#define | ACIFA_COMP_SELB 2 |
VCCSCALE Selection | |
#define | ACIFA_VCCSCALE_SELA 1 |
#define | ACIFA_VCCSCALE_SELB 2 |
#define ACIFA_COMP_SELA 1 |
#define ACIFA_COMP_SELB 2 |
#define ACIFA_VCCSCALE_SELA 1 |
Referenced by acifa_configure_vccscale().
#define ACIFA_VCCSCALE_SELB 2 |
#define AVR32_ACIFA_AC0A_INSELN_AC0AN0 0 |
#define AVR32_ACIFA_AC0A_INSELN_AC0AN1 1 |
#define AVR32_ACIFA_AC0A_INSELN_AC0BP0 2 |
#define AVR32_ACIFA_AC0A_INSELN_AC0BP1 3 |
#define AVR32_ACIFA_AC0A_INSELN_DAC1_INT 5 |
#define AVR32_ACIFA_AC0A_INSELN_VDDANA_SCALED 4 |
#define AVR32_ACIFA_AC0A_INSELP_AC0AP0 0 |
#define AVR32_ACIFA_AC0A_INSELP_AC0AP1 1 |
#define AVR32_ACIFA_AC0A_INSELP_DAC0_INT 2 |
#define AVR32_ACIFA_AC0B_INSELN_AC0BN0 0 |
#define AVR32_ACIFA_AC0B_INSELN_AC0BN1 1 |
#define AVR32_ACIFA_AC0B_INSELN_DAC1_INT 2 |
#define AVR32_ACIFA_AC0B_INSELP_AC0AN0 0 |
#define AVR32_ACIFA_AC0B_INSELP_AC0AN1 1 |
#define AVR32_ACIFA_AC0B_INSELP_AC0BP0 2 |
#define AVR32_ACIFA_AC0B_INSELP_AC0BP1 3 |
#define AVR32_ACIFA_AC0B_INSELP_DAC0_INT 4 |
#define AVR32_ACIFA_AC0B_INSELP_VDDANA_SCALED 5 |
#define AVR32_ACIFA_AC1A_INSELN_AC1AN0 0 |
#define AVR32_ACIFA_AC1A_INSELN_AC1AN1 1 |
#define AVR32_ACIFA_AC1A_INSELN_AC1BP0 2 |
#define AVR32_ACIFA_AC1A_INSELN_AC1BP1 3 |
#define AVR32_ACIFA_AC1A_INSELN_DAC1_INT 5 |
#define AVR32_ACIFA_AC1A_INSELN_VDDANA_SCALED 4 |
#define AVR32_ACIFA_AC1A_INSELP_AC1AP0 0 |
#define AVR32_ACIFA_AC1A_INSELP_AC1AP1 1 |
#define AVR32_ACIFA_AC1A_INSELP_DAC0_INT 2 |
#define AVR32_ACIFA_AC1B_INSELN_AC1BN0 0 |
#define AVR32_ACIFA_AC1B_INSELN_AC1BN1 1 |
#define AVR32_ACIFA_AC1B_INSELN_DAC1_INT 2 |
#define AVR32_ACIFA_AC1B_INSELP_AC1AN0 0 |
#define AVR32_ACIFA_AC1B_INSELP_AC1AN1 1 |
#define AVR32_ACIFA_AC1B_INSELP_AC1BP0 2 |
#define AVR32_ACIFA_AC1B_INSELP_AC1BP1 3 |
#define AVR32_ACIFA_AC1B_INSELP_DAC0_INT 4 |
#define AVR32_ACIFA_AC1B_INSELP_VDDANA_SCALED 5 |
void acifa_clear_flags | ( | volatile avr32_acifa_t * | acifa, |
uint32_t | flag_mask | ||
) |
Clear Flags.
acifa | Base address of the ACIFA |
flag_mask | Flag Mask Value |
void acifa_configure | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel, | ||
uint8_t | input_p, | ||
uint8_t | input_n, | ||
uint32_t | pb_hz | ||
) |
Configure ACIFA Normal Mode.
Mandatory to call.
acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
input_p | Input Positive Selection |
input_n | Input Negative Selection |
pb_hz | Peripheral Bus frequency |
References ACIFA_COMP_SELA, Assert, and NULL.
Referenced by main().
void acifa_configure_hysteresis | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel, | ||
uint8_t | level | ||
) |
Configure Hysteresis on comparator.
*acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
level | Level On Hysteresis |
References ACIFA_COMP_SELA, Assert, and NULL.
void acifa_configure_vccscale | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | vcc_sel, | ||
uint8_t | scale | ||
) |
Configure VCC Scale on comparator.
acifa | Base address of the ACIFA |
vcc_sel | VCC Scale Selection |
scale | Scale |
References ACIFA_VCCSCALE_SELA, Assert, and NULL.
void acifa_configure_window | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | input_p, | ||
uint8_t | input_n, | ||
uint8_t | common_input, | ||
uint32_t | pb_hz | ||
) |
void acifa_enable_interrupt | ( | volatile avr32_acifa_t * | acifa, |
uint32_t | flag_mask | ||
) |
void acifa_enable_interrupt_inp_higher | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel | ||
) |
Enable AC Interrupt when Vinp>Vin.
acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
References ACIFA_COMP_SELA, ACIFA_COMP_SELB, Assert, and NULL.
void acifa_enable_interrupt_inp_lower | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel | ||
) |
Enable AC Interrupt when Vinp<Vin.
acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
References ACIFA_COMP_SELA, ACIFA_COMP_SELB, Assert, and NULL.
void acifa_enable_interrupt_toggle | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel | ||
) |
Enable AC Interrupt when a toggle of the comparator occurs.
acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
References ACIFA_COMP_SELA, ACIFA_COMP_SELB, Assert, and NULL.
void acifa_enable_output | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel | ||
) |
Enable Output on comparator.
acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
References ACIFA_COMP_SELA.
bool acifa_is_aca_inp_higher | ( | volatile avr32_acifa_t * | acifa | ) |
Return comparator A status.
acifa | Base address of the ACIFA |
true | when ACA Input P is higher than Input N |
false | when ACA Input P is Lower than Input N |
Referenced by main().
bool acifa_is_acb_inp_higher | ( | volatile avr32_acifa_t * | acifa | ) |
Return comparator B status.
acifa | Base address of the ACIFA |
true | when ACB Input P is higher than Input N |
false | when ACB Input P is Lower than Input N |
Referenced by main().
bool acifa_is_ci_inside_window | ( | volatile avr32_acifa_t * | acifa | ) |
Return Window status.
acifa | Base address of the ACIFA |
true | if Common Input Signal is inside the window |
false | if Common Input Signal is outside the window |
void acifa_start | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel | ||
) |
Start comparator in Normal Mode.
*acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
References ACIFA_COMP_SELA, ACIFA_COMP_SELB, acifa_is_aca_ready(), acifa_is_acb_ready(), Assert, and NULL.
Referenced by main().
void acifa_start_window | ( | volatile avr32_acifa_t * | acifa | ) |
Start comparator in Window Mode.
acifa | Base address of the ACIFA |
References acifa_is_wf_ready().
void acifa_stop | ( | volatile avr32_acifa_t * | acifa, |
uint8_t | comp_sel | ||
) |
Stops the comparators that are currently started.
*acifa | Base address of the ACIFA |
comp_sel | Comparator Selection |
References ACIFA_COMP_SELA, ACIFA_COMP_SELB, Assert, and NULL.