Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:22:58

0001 /*
0002  * Copyright (c) 2015, Freescale Semiconductor, Inc.
0003  * Copyright 2016-2020 NXP
0004  * All rights reserved.
0005  *
0006  * SPDX-License-Identifier: BSD-3-Clause
0007  */
0008 
0009 #ifndef _FSL_ACMP_H_
0010 #define _FSL_ACMP_H_
0011 
0012 #include "fsl_common.h"
0013 
0014 /*!
0015  * @addtogroup acmp
0016  * @{
0017  */
0018 
0019 /*******************************************************************************
0020  * Definitions
0021  ******************************************************************************/
0022 
0023 /*! @name Driver version */
0024 /*@{*/
0025 /*! @brief ACMP driver version 2.0.6. */
0026 #define FSL_ACMP_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 6U))
0027 /*@}*/
0028 
0029 /*! @brief The mask of status flags cleared by writing 1. */
0030 #define CMP_C0_CFx_MASK  (CMP_C0_CFR_MASK | CMP_C0_CFF_MASK)
0031 #define CMP_C1_CHNn_MASK 0xFF0000U /* C1_CHN0 - C1_CHN7. */
0032 #define CMP_C2_CHnF_MASK 0xFF0000U /* C2_CH0F - C2_CH7F. */
0033 
0034 /*! @brief Interrupt enable/disable mask. */
0035 enum _acmp_interrupt_enable
0036 {
0037     kACMP_OutputRisingInterruptEnable  = (1U << 0U), /*!< Enable the interrupt when comparator outputs rising. */
0038     kACMP_OutputFallingInterruptEnable = (1U << 1U), /*!< Enable the interrupt when comparator outputs falling. */
0039     kACMP_RoundRobinInterruptEnable    = (1U << 2U), /*!< Enable the Round-Robin interrupt. */
0040 };
0041 
0042 /*! @brief Status flag mask. */
0043 enum _acmp_status_flags
0044 {
0045     kACMP_OutputRisingEventFlag  = CMP_C0_CFR_MASK,  /*!< Rising-edge on compare output has occurred. */
0046     kACMP_OutputFallingEventFlag = CMP_C0_CFF_MASK,  /*!< Falling-edge on compare output has occurred. */
0047     kACMP_OutputAssertEventFlag  = CMP_C0_COUT_MASK, /*!< Return the current value of the analog comparator output. */
0048 };
0049 
0050 #if defined(FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT) && (FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT == 1U)
0051 /*!
0052  * @brief Comparator hard block offset control.
0053  *
0054  * If OFFSET level is 1, then there is no hysteresis in the case of positive port input crossing negative port
0055  * input in the positive direction (or negative port input crossing positive port input in the negative direction).
0056  * Hysteresis still exists for positive port input crossing negative port input in the falling direction.
0057  * If OFFSET level is 0, then the hysteresis selected by acmp_hysteresis_mode_t is valid for both directions.
0058  */
0059 typedef enum _acmp_offset_mode
0060 {
0061     kACMP_OffsetLevel0 = 0U, /*!< The comparator hard block output has level 0 offset internally. */
0062     kACMP_OffsetLevel1 = 1U, /*!< The comparator hard block output has level 1 offset internally. */
0063 } acmp_offset_mode_t;
0064 #endif /* FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT */
0065 
0066 /*!
0067  * @brief Comparator hard block hysteresis control.
0068  *
0069  * See chip data sheet to get the actual hysteresis value with each level.
0070  */
0071 typedef enum _acmp_hysteresis_mode
0072 {
0073     kACMP_HysteresisLevel0 = 0U, /*!< Offset is level 0 and Hysteresis is level 0. */
0074     kACMP_HysteresisLevel1 = 1U, /*!< Offset is level 0 and Hysteresis is level 1. */
0075     kACMP_HysteresisLevel2 = 2U, /*!< Offset is level 0 and Hysteresis is level 2. */
0076     kACMP_HysteresisLevel3 = 3U, /*!< Offset is level 0 and Hysteresis is level 3. */
0077 } acmp_hysteresis_mode_t;
0078 
0079 /*! @brief CMP Voltage Reference source. */
0080 typedef enum _acmp_reference_voltage_source
0081 {
0082     kACMP_VrefSourceVin1 = 0U, /*!< Vin1 is selected as resistor ladder network supply reference Vin. */
0083     kACMP_VrefSourceVin2 = 1U, /*!< Vin2 is selected as resistor ladder network supply reference Vin. */
0084 } acmp_reference_voltage_source_t;
0085 
0086 #if defined(FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT) && (FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT == 1U)
0087 /*! @brief Port input source. */
0088 typedef enum _acmp_port_input
0089 {
0090     kACMP_PortInputFromDAC = 0U, /*!< Port input from the 8-bit DAC output. */
0091     kACMP_PortInputFromMux = 1U, /*!< Port input from the analog 8-1 mux. */
0092 } acmp_port_input_t;
0093 #endif /* FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT */
0094 
0095 /*! @brief Fixed mux port. */
0096 typedef enum _acmp_fixed_port
0097 {
0098     kACMP_FixedPlusPort  = 0U, /*!< Only the inputs to the Minus port are swept in each round. */
0099     kACMP_FixedMinusPort = 1U, /*!< Only the inputs to the Plus port are swept in each round. */
0100 } acmp_fixed_port_t;
0101 
0102 #if defined(FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT) && (FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT == 1U)
0103 /*! @brief Internal DAC's work mode. */
0104 typedef enum _acmp_dac_work_mode
0105 {
0106     kACMP_DACWorkLowSpeedMode  = 0U, /*!< DAC is selected to work in low speed and low power mode. */
0107     kACMP_DACWorkHighSpeedMode = 1U, /*!< DAC is selected to work in high speed high power mode. */
0108 } acmp_dac_work_mode_t;
0109 #endif /* FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT */
0110 
0111 /*! @brief Configuration for ACMP. */
0112 typedef struct _acmp_config
0113 {
0114 #if defined(FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT) && (FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT == 1U)
0115     acmp_offset_mode_t offsetMode;         /*!< Offset mode. */
0116 #endif                                     /* FSL_FEATURE_ACMP_HAS_C0_OFFSET_BIT */
0117     acmp_hysteresis_mode_t hysteresisMode; /*!< Hysteresis mode. */
0118     bool enableHighSpeed;                  /*!< Enable High Speed (HS) comparison mode. */
0119     bool enableInvertOutput;               /*!< Enable inverted comparator output. */
0120     bool useUnfilteredOutput;              /*!< Set compare output(COUT) to equal COUTA(true) or COUT(false). */
0121     bool enablePinOut;                     /*!< The comparator output is available on the associated pin. */
0122 } acmp_config_t;
0123 
0124 /*!
0125  * @brief Configuration for channel.
0126  *
0127  * The comparator's port can be input from channel mux or DAC. If port input is from channel mux, detailed channel
0128  * number for the mux should be configured.
0129  */
0130 typedef struct _acmp_channel_config
0131 {
0132 #if defined(FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT) && (FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT == 1U)
0133     acmp_port_input_t positivePortInput; /*!< Input source of the comparator's positive port. */
0134 #endif                                   /* FSL_FEATURE_ACMP_HAS_C1_INPSEL_BIT */
0135     uint32_t plusMuxInput;               /*!< Plus mux input channel(0~7). */
0136 #if defined(FSL_FEATURE_ACMP_HAS_C1_INNSEL_BIT) && (FSL_FEATURE_ACMP_HAS_C1_INNSEL_BIT == 1U)
0137     acmp_port_input_t negativePortInput; /*!< Input source of the comparator's negative port. */
0138 #endif                                   /* FSL_FEATURE_ACMP_HAS_C1_INNSEL_BIT */
0139     uint32_t minusMuxInput;              /*!< Minus mux input channel(0~7). */
0140 } acmp_channel_config_t;
0141 
0142 /*! @brief Configuration for filter. */
0143 typedef struct _acmp_filter_config
0144 {
0145     bool enableSample;     /*!< Using external SAMPLE as sampling clock input, or using divided bus clock. */
0146     uint32_t filterCount;  /*!< Filter Sample Count. Available range is 1-7, 0 would cause the filter disabled. */
0147     uint32_t filterPeriod; /*!< Filter Sample Period. The divider to bus clock. Available range is 0-255. */
0148 } acmp_filter_config_t;
0149 
0150 /*! @brief Configuration for DAC. */
0151 typedef struct _acmp_dac_config
0152 {
0153     acmp_reference_voltage_source_t referenceVoltageSource; /*!< Supply voltage reference source. */
0154     uint32_t DACValue; /*!< Value for DAC Output Voltage. Available range is 0-255. */
0155 
0156 #if defined(FSL_FEATURE_ACMP_HAS_C1_DACOE_BIT) && (FSL_FEATURE_ACMP_HAS_C1_DACOE_BIT == 1U)
0157     bool enableOutput; /*!< Enable the DAC output. */
0158 #endif                 /* FSL_FEATURE_ACMP_HAS_C1_DACOE_BIT */
0159 
0160 #if defined(FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT) && (FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT == 1U)
0161     acmp_dac_work_mode_t workMode;
0162 #endif /* FSL_FEATURE_ACMP_HAS_C1_DMODE_BIT */
0163 } acmp_dac_config_t;
0164 
0165 /*! @brief Configuration for round robin mode. */
0166 typedef struct _acmp_round_robin_config
0167 {
0168     acmp_fixed_port_t fixedPort; /*!< Fixed mux port. */
0169     uint32_t fixedChannelNumber; /*!< Indicates which channel is fixed in the fixed mux port. */
0170     uint32_t checkerChannelMask; /*!< Mask of checker channel index. Available range is channel0:0x01 to channel7:0x80
0171                                     for round-robin checker. */
0172     uint32_t sampleClockCount;   /*!< Specifies how many round-robin clock cycles(0~3) later the sample takes place. */
0173     uint32_t delayModulus;       /*!< Comparator and DAC initialization delay modulus. */
0174 } acmp_round_robin_config_t;
0175 
0176 #if defined(FSL_FEATURE_ACMP_HAS_C3_REG) && (FSL_FEATURE_ACMP_HAS_C3_REG == 1U)
0177 
0178 /*! @brief Discrete mode clock selection. */
0179 typedef enum _acmp_discrete_clock_source
0180 {
0181     kACMP_DiscreteClockSlow = 0U, /*!< Slow clock (32kHz) is used as the discrete mode clock. */
0182     kACMP_DiscreteClockFast = 1U, /*!< Fast clock (16-20MHz) is used as the discrete mode clock. */
0183 } acmp_discrete_clock_source_t;
0184 
0185 /*!
0186  * @brief ACMP discrete sample selection.
0187  * These values configures the analog comparator sampling timing (speicified by the discrete mode clock period T which
0188  * is selected by #acmp_discrete_clock_source_t) in discrete mode.
0189  */
0190 typedef enum _acmp_discrete_sample_time
0191 {
0192     kACMP_DiscreteSampleTimeAs1T   = 0U, /*!< The sampling time equals to 1xT. */
0193     kACMP_DiscreteSampleTimeAs2T   = 1U, /*!< The sampling time equals to 2xT. */
0194     kACMP_DiscreteSampleTimeAs4T   = 2U, /*!< The sampling time equals to 4xT. */
0195     kACMP_DiscreteSampleTimeAs8T   = 3U, /*!< The sampling time equals to 8xT. */
0196     kACMP_DiscreteSampleTimeAs16T  = 4U, /*!< The sampling time equals to 16xT. */
0197     kACMP_DiscreteSampleTimeAs32T  = 5U, /*!< The sampling time equals to 32xT. */
0198     kACMP_DiscreteSampleTimeAs64T  = 6U, /*!< The sampling time equals to 64xT. */
0199     kACMP_DiscreteSampleTimeAs256T = 7U, /*!< The sampling time equals to 256xT. */
0200 } acmp_discrete_sample_time_t;
0201 
0202 /*!
0203  * @brief ACMP discrete phase time selection.
0204  * There are two phases for sampling input signals, phase 1 and phase 2.
0205  */
0206 typedef enum _acmp_discrete_phase_time
0207 {
0208     kACMP_DiscretePhaseTimeAlt0 = 0U, /*!< The phase x active in one sampling selection 0. */
0209     kACMP_DiscretePhaseTimeAlt1 = 1U, /*!< The phase x active in one sampling selection 1. */
0210     kACMP_DiscretePhaseTimeAlt2 = 2U, /*!< The phase x active in one sampling selection 2. */
0211     kACMP_DiscretePhaseTimeAlt3 = 3U, /*!< The phase x active in one sampling selection 3. */
0212     kACMP_DiscretePhaseTimeAlt4 = 4U, /*!< The phase x active in one sampling selection 4. */
0213     kACMP_DiscretePhaseTimeAlt5 = 5U, /*!< The phase x active in one sampling selection 5. */
0214     kACMP_DiscretePhaseTimeAlt6 = 6U, /*!< The phase x active in one sampling selection 6. */
0215     kACMP_DiscretePhaseTimeAlt7 = 7U, /*!< The phase x active in one sampling selection 7. */
0216 } acmp_discrete_phase_time_t;
0217 
0218 /*! @brief Configuration for discrete mode. */
0219 typedef struct _acmp_discrete_mode_config
0220 {
0221     bool enablePositiveChannelDiscreteMode; /*!< Positive Channel Continuous Mode Enable. By default, the continuous
0222                                                  mode is used. */
0223     bool enableNegativeChannelDiscreteMode; /*!< Negative Channel Continuous Mode Enable. By default, the continuous
0224                                                  mode is used. */
0225     bool enableResistorDivider; /*!< Resistor Divider Enable is used to enable the resistor divider for the inputs when
0226                                      they come from 3v domain and their values are above 1.8v. */
0227     acmp_discrete_clock_source_t clockSource; /*!< Select the clock source in order to generate the requiried timing for
0228                                                    comparator to work in discrete mode.  */
0229     acmp_discrete_sample_time_t sampleTime;   /*!< Select the ACMP total sampling time period. */
0230     acmp_discrete_phase_time_t phase1Time;    /*!< Select the ACMP phase 1 sampling time. */
0231     acmp_discrete_phase_time_t phase2Time;    /*!< Select the ACMP phase 2 sampling time. */
0232 } acmp_discrete_mode_config_t;
0233 
0234 #endif /* FSL_FEATURE_ACMP_HAS_C3_REG */
0235 
0236 #if defined(__cplusplus)
0237 extern "C" {
0238 #endif
0239 
0240 /*******************************************************************************
0241  * API
0242  ******************************************************************************/
0243 
0244 /*!
0245  * @name Initialization and deinitialization
0246  * @{
0247  */
0248 
0249 /*!
0250  * @brief Initializes the ACMP.
0251  *
0252  * The default configuration can be got by calling ACMP_GetDefaultConfig().
0253  *
0254  * @param base ACMP peripheral base address.
0255  * @param config Pointer to ACMP configuration structure.
0256  */
0257 void ACMP_Init(CMP_Type *base, const acmp_config_t *config);
0258 
0259 /*!
0260  * @brief Deinitializes the ACMP.
0261  *
0262  * @param base ACMP peripheral base address.
0263  */
0264 void ACMP_Deinit(CMP_Type *base);
0265 
0266 /*!
0267  * @brief Gets the default configuration for ACMP.
0268  *
0269  * This function initializes the user configuration structure to default value. The default value are:
0270  *
0271  * Example:
0272    @code
0273    config->enableHighSpeed = false;
0274    config->enableInvertOutput = false;
0275    config->useUnfilteredOutput = false;
0276    config->enablePinOut = false;
0277    config->enableHysteresisBothDirections = false;
0278    config->hysteresisMode = kACMP_hysteresisMode0;
0279    @endcode
0280  *
0281  * @param config Pointer to ACMP configuration structure.
0282  */
0283 void ACMP_GetDefaultConfig(acmp_config_t *config);
0284 
0285 /* @} */
0286 
0287 /*!
0288  * @name Basic Operations
0289  * @{
0290  */
0291 
0292 /*!
0293  * @brief Enables or disables the ACMP.
0294  *
0295  * @param base ACMP peripheral base address.
0296  * @param enable True to enable the ACMP.
0297  */
0298 void ACMP_Enable(CMP_Type *base, bool enable);
0299 
0300 #if defined(FSL_FEATURE_ACMP_HAS_C0_LINKEN_BIT) && (FSL_FEATURE_ACMP_HAS_C0_LINKEN_BIT == 1U)
0301 /*!
0302  * @brief Enables the link from CMP to DAC enable.
0303  *
0304  * When this bit is set, the DAC enable/disable is controlled by the bit CMP_C0[EN] instead of CMP_C1[DACEN].
0305  *
0306  * @param base ACMP peripheral base address.
0307  * @param enable Enable the feature or not.
0308  */
0309 void ACMP_EnableLinkToDAC(CMP_Type *base, bool enable);
0310 #endif /* FSL_FEATURE_ACMP_HAS_C0_LINKEN_BIT */
0311 
0312 /*!
0313  * @brief Sets the channel configuration.
0314  *
0315  * Note that the plus/minus mux's setting is only valid when the positive/negative port's input isn't from DAC but
0316  * from channel mux.
0317  *
0318  * Example:
0319    @code
0320    acmp_channel_config_t configStruct = {0};
0321    configStruct.positivePortInput = kACMP_PortInputFromDAC;
0322    configStruct.negativePortInput = kACMP_PortInputFromMux;
0323    configStruct.minusMuxInput = 1U;
0324    ACMP_SetChannelConfig(CMP0, &configStruct);
0325    @endcode
0326  *
0327  * @param base ACMP peripheral base address.
0328  * @param config Pointer to channel configuration structure.
0329  */
0330 void ACMP_SetChannelConfig(CMP_Type *base, const acmp_channel_config_t *config);
0331 
0332 /* @} */
0333 
0334 /*!
0335  * @name Advanced Operations
0336  * @{
0337  */
0338 
0339 /*!
0340  * @brief Enables or disables DMA.
0341  *
0342  * @param base ACMP peripheral base address.
0343  * @param enable True to enable DMA.
0344  */
0345 void ACMP_EnableDMA(CMP_Type *base, bool enable);
0346 
0347 /*!
0348  * @brief Enables or disables window mode.
0349  *
0350  * @param base ACMP peripheral base address.
0351  * @param enable True to enable window mode.
0352  */
0353 void ACMP_EnableWindowMode(CMP_Type *base, bool enable);
0354 
0355 /*!
0356  * @brief Configures the filter.
0357  *
0358  * The filter can be enabled when the filter count is bigger than 1, the filter period is greater than 0 and the sample
0359  * clock is from divided bus clock or the filter is bigger than 1 and the sample clock is from external clock. Detailed
0360  * usage can be got from the reference manual.
0361  *
0362  * Example:
0363    @code
0364    acmp_filter_config_t configStruct = {0};
0365    configStruct.filterCount = 5U;
0366    configStruct.filterPeriod = 200U;
0367    configStruct.enableSample = false;
0368    ACMP_SetFilterConfig(CMP0, &configStruct);
0369    @endcode
0370  *
0371  * @param base ACMP peripheral base address.
0372  * @param config Pointer to filter configuration structure.
0373  */
0374 void ACMP_SetFilterConfig(CMP_Type *base, const acmp_filter_config_t *config);
0375 
0376 /*!
0377  * @brief Configures the internal DAC.
0378  *
0379  * Example:
0380    @code
0381    acmp_dac_config_t configStruct = {0};
0382    configStruct.referenceVoltageSource = kACMP_VrefSourceVin1;
0383    configStruct.DACValue = 20U;
0384    configStruct.enableOutput = false;
0385    configStruct.workMode = kACMP_DACWorkLowSpeedMode;
0386    ACMP_SetDACConfig(CMP0, &configStruct);
0387    @endcode
0388  *
0389  * @param base ACMP peripheral base address.
0390  * @param config Pointer to DAC configuration structure. "NULL" is for disabling the feature.
0391  */
0392 void ACMP_SetDACConfig(CMP_Type *base, const acmp_dac_config_t *config);
0393 
0394 /*!
0395  * @brief Configures the round robin mode.
0396  *
0397  * Example:
0398    @code
0399    acmp_round_robin_config_t configStruct = {0};
0400    configStruct.fixedPort = kACMP_FixedPlusPort;
0401    configStruct.fixedChannelNumber = 3U;
0402    configStruct.checkerChannelMask = 0xF7U;
0403    configStruct.sampleClockCount = 0U;
0404    configStruct.delayModulus = 0U;
0405    ACMP_SetRoundRobinConfig(CMP0, &configStruct);
0406    @endcode
0407  * @param base ACMP peripheral base address.
0408  * @param config Pointer to round robin mode configuration structure. "NULL" is for disabling the feature.
0409  */
0410 void ACMP_SetRoundRobinConfig(CMP_Type *base, const acmp_round_robin_config_t *config);
0411 
0412 /*!
0413  * @brief Defines the pre-set state of channels in round robin mode.
0414  *
0415  * Note: The pre-state has different circuit with get-round-robin-result in the SOC even though they are same bits.
0416  * So get-round-robin-result can't return the same value as the value are set by pre-state.
0417  *
0418  * @param base ACMP peripheral base address.
0419  * @param mask Mask of round robin channel index. Available range is channel0:0x01 to channel7:0x80.
0420  */
0421 void ACMP_SetRoundRobinPreState(CMP_Type *base, uint32_t mask);
0422 
0423 /*!
0424  * @brief Gets the channel input changed flags in round robin mode.
0425  *
0426  * @param base ACMP peripheral base address.
0427  * @return Mask of channel input changed asserted flags. Available range is channel0:0x01 to channel7:0x80.
0428  */
0429 static inline uint32_t ACMP_GetRoundRobinStatusFlags(CMP_Type *base)
0430 {
0431     return (((base->C2) & CMP_C2_CHnF_MASK) >> CMP_C2_CH0F_SHIFT);
0432 }
0433 
0434 /*!
0435  * @brief Clears the channel input changed flags in round robin mode.
0436  *
0437  * @param base ACMP peripheral base address.
0438  * @param mask Mask of channel index. Available range is channel0:0x01 to channel7:0x80.
0439  */
0440 void ACMP_ClearRoundRobinStatusFlags(CMP_Type *base, uint32_t mask);
0441 
0442 /*!
0443  * @brief Gets the round robin result.
0444  *
0445  * Note that the set-pre-state has different circuit with get-round-robin-result in the SOC even though they are same
0446  * bits. So ACMP_GetRoundRobinResult() can't return the same value as the value are set by ACMP_SetRoundRobinPreState.
0447 
0448  * @param base ACMP peripheral base address.
0449  * @return Mask of round robin channel result. Available range is channel0:0x01 to channel7:0x80.
0450  */
0451 static inline uint32_t ACMP_GetRoundRobinResult(CMP_Type *base)
0452 {
0453     return ((base->C2 & CMP_C2_ACOn_MASK) >> CMP_C2_ACOn_SHIFT);
0454 }
0455 
0456 /* @} */
0457 
0458 /*!
0459  * @name Interrupts
0460  * @{
0461  */
0462 
0463 /*!
0464  * @brief Enables interrupts.
0465  *
0466  * @param base ACMP peripheral base address.
0467  * @param mask Interrupts mask. See "_acmp_interrupt_enable".
0468  */
0469 void ACMP_EnableInterrupts(CMP_Type *base, uint32_t mask);
0470 
0471 /*!
0472  * @brief Disables interrupts.
0473  *
0474  * @param base ACMP peripheral base address.
0475  * @param mask Interrupts mask. See "_acmp_interrupt_enable".
0476  */
0477 void ACMP_DisableInterrupts(CMP_Type *base, uint32_t mask);
0478 
0479 /* @} */
0480 
0481 /*!
0482  * @name Status
0483  * @{
0484  */
0485 
0486 /*!
0487  * @brief Gets status flags.
0488  *
0489  * @param base ACMP peripheral base address.
0490  * @return Status flags asserted mask. See "_acmp_status_flags".
0491  */
0492 uint32_t ACMP_GetStatusFlags(CMP_Type *base);
0493 
0494 /*!
0495  * @brief Clears status flags.
0496  *
0497  * @param base ACMP peripheral base address.
0498  * @param mask Status flags mask. See "_acmp_status_flags".
0499  */
0500 void ACMP_ClearStatusFlags(CMP_Type *base, uint32_t mask);
0501 
0502 /* @} */
0503 
0504 #if defined(FSL_FEATURE_ACMP_HAS_C3_REG) && (FSL_FEATURE_ACMP_HAS_C3_REG == 1U)
0505 /*!
0506  * @name Discrete mode
0507  * @{
0508  */
0509 
0510 /*!
0511  * @brief Configure the discrete mode.
0512  *
0513  * Configure the discrete mode when supporting 3V domain with 1.8V core.
0514  *
0515  * @param base ACMP peripheral base address.
0516  * @param config Pointer to configuration structure. See "acmp_discrete_mode_config_t".
0517  */
0518 void ACMP_SetDiscreteModeConfig(CMP_Type *base, const acmp_discrete_mode_config_t *config);
0519 
0520 /*!
0521  * @brief Get the default configuration for discrete mode setting.
0522  *
0523  * @param config Pointer to configuration structure to be restored with the setting values.
0524  */
0525 void ACMP_GetDefaultDiscreteModeConfig(acmp_discrete_mode_config_t *config);
0526 
0527 /* @} */
0528 #endif /* FSL_FEATURE_ACMP_HAS_C3_REG */
0529 
0530 #if defined(__cplusplus)
0531 }
0532 #endif
0533 
0534 /*! @}*/
0535 
0536 #endif /* _FSL_ACMP_H_ */