26 #define FSL_ACMP_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 4U))
30 #define CMP_C0_CFx_MASK (CMP_C0_CFR_MASK | CMP_C0_CFF_MASK)
31 #define CMP_C1_CHNn_MASK 0xFF0000U
32 #define CMP_C2_CHnF_MASK 0xFF0000U
50 #if defined(FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT) && (FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT == 1U)
86 #if defined(FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT) && (FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT == 1U)
102 #if defined(FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT) && (FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT == 1U)
114 #if defined(FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT) && (FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT == 1U)
132 #if defined(FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT) && (FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT == 1U)
136 #if defined(FSL_FEATURE_ACMP_HAS_C1_INNSEL_BIT) && (FSL_FEATURE_ACMP_HAS_C1_INNSEL_BIT == 1U)
156 #if defined(FSL_FEATURE_ACMP_HAS_C1_DACOE_BIT) && (FSL_FEATURE_ACMP_HAS_C1_DACOE_BIT == 1U)
160 #if defined(FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT) && (FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT == 1U)
176 #if defined(FSL_FEATURE_ACMP_HAS_C3_REG) && (FSL_FEATURE_ACMP_HAS_C3_REG == 1U)
236 #if defined(__cplusplus)
300 #if defined(FSL_FEATURE_ACMP_HAS_C0_LINKEN_BIT) && (FSL_FEATURE_ACMP_HAS_C0_LINKEN_BIT == 1U)
431 return (((base->C2) & CMP_C2_CHnF_MASK) >> CMP_C2_CH0F_SHIFT);
453 return ((base->C2 & CMP_C2_ACOn_MASK) >> CMP_C2_ACOn_SHIFT);
504 #if defined(FSL_FEATURE_ACMP_HAS_C3_REG) && (FSL_FEATURE_ACMP_HAS_C3_REG == 1U)
530 #if defined(__cplusplus)
struct _acmp_channel_config acmp_channel_config_t
Configuration for channel.
_acmp_discrete_sample_time
ACMP discrete sample selection. These values configures the analog comparator sampling timing (speici...
_acmp_interrupt_enable
Interrupt enable/disable mask.
void ACMP_SetFilterConfig(CMP_Type *base, const acmp_filter_config_t *config)
Configures the filter.
acmp_hysteresis_mode_t hysteresisMode
void ACMP_Enable(CMP_Type *base, bool enable)
Enables or disables the ACMP.
void ACMP_GetDefaultDiscreteModeConfig(acmp_discrete_mode_config_t *config)
Get the default configuration for discrete mode setting.
static uint32_t ACMP_GetRoundRobinResult(CMP_Type *base)
Gets the round robin result.
acmp_offset_mode_t offsetMode
uint32_t ACMP_GetStatusFlags(CMP_Type *base)
Gets status flags.
struct _acmp_discrete_mode_config acmp_discrete_mode_config_t
Configuration for discrete mode.
void ACMP_SetRoundRobinPreState(CMP_Type *base, uint32_t mask)
Defines the pre-set state of channels in round robin mode.
acmp_discrete_phase_time_t phase1Time
void ACMP_SetChannelConfig(CMP_Type *base, const acmp_channel_config_t *config)
Sets the channel configuration.
bool enablePositiveChannelDiscreteMode
enum _acmp_reference_voltage_source acmp_reference_voltage_source_t
CMP Voltage Reference source.
acmp_discrete_clock_source_t clockSource
acmp_discrete_phase_time_t phase2Time
uint32_t checkerChannelMask
bool enableResistorDivider
_acmp_reference_voltage_source
CMP Voltage Reference source.
_acmp_hysteresis_mode
Comparator hard block hysteresis control.
static uint32_t ACMP_GetRoundRobinStatusFlags(CMP_Type *base)
Gets the channel input changed flags in round robin mode.
_acmp_discrete_phase_time
ACMP discrete phase time selection. There are two phases for sampling input signals,...
enum _acmp_discrete_phase_time acmp_discrete_phase_time_t
ACMP discrete phase time selection. There are two phases for sampling input signals,...
acmp_port_input_t positivePortInput
enum _acmp_dac_work_mode acmp_dac_work_mode_t
Internal DAC's work mode.
bool enableNegativeChannelDiscreteMode
struct _acmp_filter_config acmp_filter_config_t
Configuration for filter.
acmp_discrete_sample_time_t sampleTime
void ACMP_Init(CMP_Type *base, const acmp_config_t *config)
Initializes the ACMP.
_acmp_discrete_clock_source
Discrete mode clock selection.
struct _acmp_config acmp_config_t
Configuration for ACMP.
_acmp_port_input
Port input source.
void ACMP_EnableDMA(CMP_Type *base, bool enable)
Enables or disables DMA.
enum _acmp_hysteresis_mode acmp_hysteresis_mode_t
Comparator hard block hysteresis control.
uint32_t fixedChannelNumber
struct _acmp_dac_config acmp_dac_config_t
Configuration for DAC.
_acmp_dac_work_mode
Internal DAC's work mode.
void ACMP_ClearRoundRobinStatusFlags(CMP_Type *base, uint32_t mask)
Clears the channel input changed flags in round robin mode.
void ACMP_DisableInterrupts(CMP_Type *base, uint32_t mask)
Disables interrupts.
void ACMP_Deinit(CMP_Type *base)
Deinitializes the ACMP.
acmp_port_input_t negativePortInput
_acmp_offset_mode
Comparator hard block offset control.
enum _acmp_port_input acmp_port_input_t
Port input source.
_acmp_status_flags
Status flag mask.
void ACMP_SetDACConfig(CMP_Type *base, const acmp_dac_config_t *config)
Configures the internal DAC.
_acmp_fixed_port
Fixed mux port.
enum _acmp_offset_mode acmp_offset_mode_t
Comparator hard block offset control.
void ACMP_EnableInterrupts(CMP_Type *base, uint32_t mask)
Enables interrupts.
void ACMP_EnableLinkToDAC(CMP_Type *base, bool enable)
Enables the link from CMP to DAC enable.
acmp_reference_voltage_source_t referenceVoltageSource
enum _acmp_discrete_sample_time acmp_discrete_sample_time_t
ACMP discrete sample selection. These values configures the analog comparator sampling timing (speici...
void ACMP_EnableWindowMode(CMP_Type *base, bool enable)
Enables or disables window mode.
acmp_fixed_port_t fixedPort
uint32_t sampleClockCount
void ACMP_ClearStatusFlags(CMP_Type *base, uint32_t mask)
Clears status flags.
void ACMP_SetDiscreteModeConfig(CMP_Type *base, const acmp_discrete_mode_config_t *config)
Configure the discrete mode.
enum _acmp_fixed_port acmp_fixed_port_t
Fixed mux port.
enum _acmp_discrete_clock_source acmp_discrete_clock_source_t
Discrete mode clock selection.
struct _acmp_round_robin_config acmp_round_robin_config_t
Configuration for round robin mode.
void ACMP_GetDefaultConfig(acmp_config_t *config)
Gets the default configuration for ACMP.
acmp_dac_work_mode_t workMode
void ACMP_SetRoundRobinConfig(CMP_Type *base, const acmp_round_robin_config_t *config)
Configures the round robin mode.
@ kACMP_DiscreteSampleTimeAs64T
@ kACMP_DiscreteSampleTimeAs2T
@ kACMP_DiscreteSampleTimeAs256T
@ kACMP_DiscreteSampleTimeAs1T
@ kACMP_DiscreteSampleTimeAs16T
@ kACMP_DiscreteSampleTimeAs8T
@ kACMP_DiscreteSampleTimeAs4T
@ kACMP_DiscreteSampleTimeAs32T
@ kACMP_RoundRobinInterruptEnable
@ kACMP_OutputFallingInterruptEnable
@ kACMP_OutputRisingInterruptEnable
@ kACMP_DiscretePhaseTimeAlt2
@ kACMP_DiscretePhaseTimeAlt0
@ kACMP_DiscretePhaseTimeAlt1
@ kACMP_DiscretePhaseTimeAlt7
@ kACMP_DiscretePhaseTimeAlt3
@ kACMP_DiscretePhaseTimeAlt4
@ kACMP_DiscretePhaseTimeAlt6
@ kACMP_DiscretePhaseTimeAlt5
@ kACMP_DiscreteClockSlow
@ kACMP_DiscreteClockFast
@ kACMP_DACWorkHighSpeedMode
@ kACMP_DACWorkLowSpeedMode
@ kACMP_OutputAssertEventFlag
@ kACMP_OutputFallingEventFlag
@ kACMP_OutputRisingEventFlag
persistent_config_s * config
static void enable(const char *param)
Configuration for channel.
Configuration for discrete mode.
Configuration for filter.
Configuration for round robin mode.