rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures
fsl_acmp.h File Reference

Data Structures

struct  _acmp_config
 Configuration for ACMP. More...
 
struct  _acmp_channel_config
 Configuration for channel. More...
 
struct  _acmp_filter_config
 Configuration for filter. More...
 
struct  _acmp_dac_config
 Configuration for DAC. More...
 
struct  _acmp_round_robin_config
 Configuration for round robin mode. More...
 
struct  _acmp_discrete_mode_config
 Configuration for discrete mode. More...
 

Functions

Initialization and deinitialization
void ACMP_Init (CMP_Type *base, const acmp_config_t *config)
 Initializes the ACMP.
 
void ACMP_Deinit (CMP_Type *base)
 Deinitializes the ACMP.
 
void ACMP_GetDefaultConfig (acmp_config_t *config)
 Gets the default configuration for ACMP.
 
Basic Operations
void ACMP_Enable (CMP_Type *base, bool enable)
 Enables or disables the ACMP.
 
void ACMP_EnableLinkToDAC (CMP_Type *base, bool enable)
 Enables the link from CMP to DAC enable.
 
void ACMP_SetChannelConfig (CMP_Type *base, const acmp_channel_config_t *config)
 Sets the channel configuration.
 
Advanced Operations
void ACMP_EnableDMA (CMP_Type *base, bool enable)
 Enables or disables DMA.
 
void ACMP_EnableWindowMode (CMP_Type *base, bool enable)
 Enables or disables window mode.
 
void ACMP_SetFilterConfig (CMP_Type *base, const acmp_filter_config_t *config)
 Configures the filter.
 
void ACMP_SetDACConfig (CMP_Type *base, const acmp_dac_config_t *config)
 Configures the internal DAC.
 
void ACMP_SetRoundRobinConfig (CMP_Type *base, const acmp_round_robin_config_t *config)
 Configures the round robin mode.
 
void ACMP_SetRoundRobinPreState (CMP_Type *base, uint32_t mask)
 Defines the pre-set state of channels in round robin mode.
 
static uint32_t ACMP_GetRoundRobinStatusFlags (CMP_Type *base)
 Gets the channel input changed flags in round robin mode.
 
void ACMP_ClearRoundRobinStatusFlags (CMP_Type *base, uint32_t mask)
 Clears the channel input changed flags in round robin mode.
 
static uint32_t ACMP_GetRoundRobinResult (CMP_Type *base)
 Gets the round robin result.
 
Interrupts
void ACMP_EnableInterrupts (CMP_Type *base, uint32_t mask)
 Enables interrupts.
 
void ACMP_DisableInterrupts (CMP_Type *base, uint32_t mask)
 Disables interrupts.
 
Status
uint32_t ACMP_GetStatusFlags (CMP_Type *base)
 Gets status flags.
 
void ACMP_ClearStatusFlags (CMP_Type *base, uint32_t mask)
 Clears status flags.
 
Discrete mode
void ACMP_SetDiscreteModeConfig (CMP_Type *base, const acmp_discrete_mode_config_t *config)
 Configure the discrete mode.
 
void ACMP_GetDefaultDiscreteModeConfig (acmp_discrete_mode_config_t *config)
 Get the default configuration for discrete mode setting.
 

Driver version

enum  _acmp_interrupt_enable { kACMP_OutputRisingInterruptEnable = (1U << 0U) , kACMP_OutputFallingInterruptEnable = (1U << 1U) , kACMP_RoundRobinInterruptEnable = (1U << 2U) }
 Interrupt enable/disable mask. More...
 
enum  _acmp_status_flags { kACMP_OutputRisingEventFlag = CMP_C0_CFR_MASK , kACMP_OutputFallingEventFlag = CMP_C0_CFF_MASK , kACMP_OutputAssertEventFlag = CMP_C0_COUT_MASK }
 Status flag mask. More...
 
enum  _acmp_offset_mode { kACMP_OffsetLevel0 = 0U , kACMP_OffsetLevel1 = 1U }
 Comparator hard block offset control. More...
 
enum  _acmp_hysteresis_mode { kACMP_HysteresisLevel0 = 0U , kACMP_HysteresisLevel1 = 1U , kACMP_HysteresisLevel2 = 2U , kACMP_HysteresisLevel3 = 3U }
 Comparator hard block hysteresis control. More...
 
enum  _acmp_reference_voltage_source { kACMP_VrefSourceVin1 = 0U , kACMP_VrefSourceVin2 = 1U }
 CMP Voltage Reference source. More...
 
enum  _acmp_port_input { kACMP_PortInputFromDAC = 0U , kACMP_PortInputFromMux = 1U }
 Port input source. More...
 
enum  _acmp_fixed_port { kACMP_FixedPlusPort = 0U , kACMP_FixedMinusPort = 1U }
 Fixed mux port. More...
 
enum  _acmp_dac_work_mode { kACMP_DACWorkLowSpeedMode = 0U , kACMP_DACWorkHighSpeedMode = 1U }
 Internal DAC's work mode. More...
 
enum  _acmp_discrete_clock_source { kACMP_DiscreteClockSlow = 0U , kACMP_DiscreteClockFast = 1U }
 Discrete mode clock selection. More...
 
enum  _acmp_discrete_sample_time {
  kACMP_DiscreteSampleTimeAs1T = 0U , kACMP_DiscreteSampleTimeAs2T = 1U , kACMP_DiscreteSampleTimeAs4T = 2U , kACMP_DiscreteSampleTimeAs8T = 3U ,
  kACMP_DiscreteSampleTimeAs16T = 4U , kACMP_DiscreteSampleTimeAs32T = 5U , kACMP_DiscreteSampleTimeAs64T = 6U , kACMP_DiscreteSampleTimeAs256T = 7U
}
 ACMP discrete sample selection. These values configures the analog comparator sampling timing (speicified by the discrete mode clock period T which is selected by acmp_discrete_clock_source_t) in discrete mode. More...
 
enum  _acmp_discrete_phase_time {
  kACMP_DiscretePhaseTimeAlt0 = 0U , kACMP_DiscretePhaseTimeAlt1 = 1U , kACMP_DiscretePhaseTimeAlt2 = 2U , kACMP_DiscretePhaseTimeAlt3 = 3U ,
  kACMP_DiscretePhaseTimeAlt4 = 4U , kACMP_DiscretePhaseTimeAlt5 = 5U , kACMP_DiscretePhaseTimeAlt6 = 6U , kACMP_DiscretePhaseTimeAlt7 = 7U
}
 ACMP discrete phase time selection. There are two phases for sampling input signals, phase 1 and phase 2. More...
 
typedef enum _acmp_offset_mode acmp_offset_mode_t
 Comparator hard block offset control.
 
typedef enum _acmp_hysteresis_mode acmp_hysteresis_mode_t
 Comparator hard block hysteresis control.
 
typedef enum _acmp_reference_voltage_source acmp_reference_voltage_source_t
 CMP Voltage Reference source.
 
typedef enum _acmp_port_input acmp_port_input_t
 Port input source.
 
typedef enum _acmp_fixed_port acmp_fixed_port_t
 Fixed mux port.
 
typedef enum _acmp_dac_work_mode acmp_dac_work_mode_t
 Internal DAC's work mode.
 
typedef struct _acmp_config acmp_config_t
 Configuration for ACMP.
 
typedef struct _acmp_channel_config acmp_channel_config_t
 Configuration for channel.
 
typedef struct _acmp_filter_config acmp_filter_config_t
 Configuration for filter.
 
typedef struct _acmp_dac_config acmp_dac_config_t
 Configuration for DAC.
 
typedef struct _acmp_round_robin_config acmp_round_robin_config_t
 Configuration for round robin mode.
 
typedef enum _acmp_discrete_clock_source acmp_discrete_clock_source_t
 Discrete mode clock selection.
 
typedef enum _acmp_discrete_sample_time acmp_discrete_sample_time_t
 ACMP discrete sample selection. These values configures the analog comparator sampling timing (speicified by the discrete mode clock period T which is selected by acmp_discrete_clock_source_t) in discrete mode.
 
typedef enum _acmp_discrete_phase_time acmp_discrete_phase_time_t
 ACMP discrete phase time selection. There are two phases for sampling input signals, phase 1 and phase 2.
 
typedef struct _acmp_discrete_mode_config acmp_discrete_mode_config_t
 Configuration for discrete mode.
 

Go to the source code of this file.