12#include "fsl_common.h"
26#define FSL_CMP_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
79#if defined(FSL_FEATURE_CMP_HAS_TRIGGER_MODE) && FSL_FEATURE_CMP_HAS_TRIGGER_MODE
80 bool enableTriggerMode;
89#if defined(FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT) && FSL_FEATURE_CMP_HAS_EXTERNAL_SAMPLE_SUPPORT
105#if defined(__cplusplus)
154static inline void CMP_Enable(
CMP_Type *base,
bool enable)
158 base->CR1 |= CMP_CR1_EN_MASK;
162 base->CR1 &= ~(uint8_t)CMP_CR1_EN_MASK;
203#if defined(FSL_FEATURE_CMP_HAS_DMA) && FSL_FEATURE_CMP_HAS_DMA
215void CMP_EnableDMA(
CMP_Type *base,
bool enable);
218#if defined(FSL_FEATURE_CMP_HAS_WINDOW_MODE) && FSL_FEATURE_CMP_HAS_WINDOW_MODE
225static inline void CMP_EnableWindowMode(
CMP_Type *base,
bool enable)
229 base->CR1 |= CMP_CR1_WE_MASK;
233 base->CR1 &= (uint8_t)(~CMP_CR1_WE_MASK);
238#if defined(FSL_FEATURE_CMP_HAS_PASS_THROUGH_MODE) && FSL_FEATURE_CMP_HAS_PASS_THROUGH_MODE
245static inline void CMP_EnablePassThroughMode(
CMP_Type *base,
bool enable)
249 base->MUXCR |= CMP_MUXCR_PSTM_MASK;
253 base->MUXCR &= (uint8_t)(~CMP_MUXCR_PSTM_MASK);
315#if defined(__cplusplus)
uint8_t filterPeriod
Definition: fsl_cmp.h:93
void CMP_DisableInterrupts(CMP_Type *base, uint32_t mask)
Disables the interrupts.
Definition: fsl_cmp.c:311
cmp_hysteresis_mode_t hysteresisMode
Definition: fsl_cmp.h:74
uint32_t CMP_GetStatusFlags(CMP_Type *base)
Gets the status flags.
Definition: fsl_cmp.c:333
void CMP_Deinit(CMP_Type *base)
De-initializes the CMP module.
Definition: fsl_cmp.c:134
struct _cmp_config cmp_config_t
Configures the comparator.
void CMP_SetFilterConfig(CMP_Type *base, const cmp_filter_config_t *config)
Configures the filter.
Definition: fsl_cmp.c:232
bool enableHighSpeed
Definition: fsl_cmp.h:75
void CMP_SetDACConfig(CMP_Type *base, const cmp_dac_config_t *config)
Configures the internal DAC.
Definition: fsl_cmp.c:263
void CMP_Init(CMP_Type *base, const cmp_config_t *config)
Initializes the CMP.
Definition: fsl_cmp.c:70
void CMP_SetInputChannels(CMP_Type *base, uint8_t positiveChannel, uint8_t negativeChannel)
Sets the input channels for the comparator.
Definition: fsl_cmp.c:189
_cmp_reference_voltage_source
CMP Voltage Reference source.
Definition: fsl_cmp.h:63
_cmp_status_flags
Status flags' mask.
Definition: fsl_cmp.h:42
_cmp_interrupt_enable
Interrupt enable/disable mask.
Definition: fsl_cmp.h:33
_cmp_hysteresis_mode
CMP Hysteresis mode.
Definition: fsl_cmp.h:52
void CMP_EnableInterrupts(CMP_Type *base, uint32_t mask)
Enables the interrupts.
Definition: fsl_cmp.c:290
bool useUnfilteredOutput
Definition: fsl_cmp.h:77
struct _cmp_dac_config cmp_dac_config_t
Configures the internal DAC.
cmp_reference_voltage_source_t referenceVoltageSource
Definition: fsl_cmp.h:101
uint8_t DACValue
Definition: fsl_cmp.h:102
enum _cmp_hysteresis_mode cmp_hysteresis_mode_t
CMP Hysteresis mode.
enum _cmp_reference_voltage_source cmp_reference_voltage_source_t
CMP Voltage Reference source.
struct _cmp_filter_config cmp_filter_config_t
Configures the filter.
void CMP_GetDefaultConfig(cmp_config_t *config)
Initializes the CMP user configuration structure.
Definition: fsl_cmp.c:160
bool enableInvertOutput
Definition: fsl_cmp.h:76
void CMP_ClearStatusFlags(CMP_Type *base, uint32_t mask)
Clears the status flags.
Definition: fsl_cmp.c:358
uint8_t filterCount
Definition: fsl_cmp.h:92
bool enablePinOut
Definition: fsl_cmp.h:78
bool enableCmp
Definition: fsl_cmp.h:73
@ kCMP_VrefSourceVin2
Definition: fsl_cmp.h:65
@ kCMP_VrefSourceVin1
Definition: fsl_cmp.h:64
@ kCMP_OutputFallingEventFlag
Definition: fsl_cmp.h:44
@ kCMP_OutputAssertEventFlag
Definition: fsl_cmp.h:45
@ kCMP_OutputRisingEventFlag
Definition: fsl_cmp.h:43
@ kCMP_OutputRisingInterruptEnable
Definition: fsl_cmp.h:34
@ kCMP_OutputFallingInterruptEnable
Definition: fsl_cmp.h:35
@ kCMP_HysteresisLevel1
Definition: fsl_cmp.h:54
@ kCMP_HysteresisLevel0
Definition: fsl_cmp.h:53
@ kCMP_HysteresisLevel3
Definition: fsl_cmp.h:56
@ kCMP_HysteresisLevel2
Definition: fsl_cmp.h:55
Definition: MIMXRT1052.h:10267
Configures the comparator.
Definition: fsl_cmp.h:72
Configures the internal DAC.
Definition: fsl_cmp.h:100
Configures the filter.
Definition: fsl_cmp.h:88
Definition: deflate.c:114