Microchip® Advanced Software Framework

ac_chan_config Struct Reference

Analog Comparator Comparator channel configuration structure.

Configuration structure for a comparator channel, to configure the input and output settings of the comparator.

#include <ac.h>

Data Fields

bool enable_hysteresis
 When true, hysteresis mode is enabled on the comparator inputs. More...
 
enum ac_chan_filter filter
 Filtering mode for the comparator output, when the comparator is used in a supported mode. More...
 
enum ac_chan_interrupt_selection interrupt_selection
 Interrupt criteria for the comparator channel, to select the condition that will trigger a callback. More...
 
enum ac_chan_neg_mux negative_input
 Input multiplexer selection for the comparator's negative input pin. More...
 
enum ac_chan_output output_mode
 Output mode of the comparator, whether it should be available for internal use, or asynchronously/synchronously linked to a general-purpose input/output (GPIO) pin. More...
 
enum ac_chan_pos_mux positive_input
 Input multiplexer selection for the comparator's positive input pin. More...
 
enum ac_chan_sample_mode sample_mode
 Sampling mode of the comparator channel. More...
 
uint8_t vcc_scale_factor
 Scaled VCC voltage division factor for the channel, when a comparator pin is connected to the VCC voltage scalar input. More...
 

bool ac_chan_config::enable_hysteresis

When true, hysteresis mode is enabled on the comparator inputs.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

enum ac_chan_filter ac_chan_config::filter

Filtering mode for the comparator output, when the comparator is used in a supported mode.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

enum ac_chan_interrupt_selection ac_chan_config::interrupt_selection

Interrupt criteria for the comparator channel, to select the condition that will trigger a callback.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

enum ac_chan_neg_mux ac_chan_config::negative_input

Input multiplexer selection for the comparator's negative input pin.

Any internal reference source, such as a bandgap reference voltage or the DAC, must be configured and enabled prior to its use as a comparator input.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

enum ac_chan_output ac_chan_config::output_mode

Output mode of the comparator, whether it should be available for internal use, or asynchronously/synchronously linked to a general-purpose input/output (GPIO) pin.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

enum ac_chan_pos_mux ac_chan_config::positive_input

Input multiplexer selection for the comparator's positive input pin.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

enum ac_chan_sample_mode ac_chan_config::sample_mode

Sampling mode of the comparator channel.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().

uint8_t ac_chan_config::vcc_scale_factor

Scaled VCC voltage division factor for the channel, when a comparator pin is connected to the VCC voltage scalar input.

The formular is: Vscale = Vdd * vcc_scale_factor / 64. If the VCC voltage scalar is not selected as a comparator channel pin's input, this value will be ignored.

Referenced by ac_chan_get_config_defaults(), and ac_chan_set_config().