Struct ac_chan_config

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

Table 1. Members
Type Name Description
bool enable_hysteresis

When true, hysteresis mode is enabled on the comparator inputs

enum ac_chan_filter filter

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

enum ac_hysteresis_level hysteresis_level

Hysteresis level of the comparator channel

enum ac_chan_interrupt_selection interrupt_selection

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

enum ac_chan_neg_mux 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.

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

enum ac_chan_pos_mux positive_input

Input multiplexer selection for the comparator's positive input pin

bool run_in_standby

If true, the comparator will continue to sample during sleep mode when triggered

enum ac_chan_sample_mode sample_mode

Sampling mode of the comparator channel

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. 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.