rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
fsl_acmp.c File Reference

Functions

static uint32_t ACMP_GetInstance (CMP_Type *base)
 Get the ACMP instance from the peripheral base address.
 
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.
 
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.
 
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.
 
void ACMP_ClearRoundRobinStatusFlags (CMP_Type *base, uint32_t mask)
 Clears the channel input changed flags in round robin mode.
 
void ACMP_EnableInterrupts (CMP_Type *base, uint32_t mask)
 Enables interrupts.
 
void ACMP_DisableInterrupts (CMP_Type *base, uint32_t mask)
 Disables interrupts.
 
uint32_t ACMP_GetStatusFlags (CMP_Type *base)
 Gets status flags.
 
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.
 
void ACMP_GetDefaultDiscreteModeConfig (acmp_discrete_mode_config_t *config)
 Get the default configuration for discrete mode setting.
 

Variables

static CMP_Type *const s_acmpBases [] = CMP_BASE_PTRS
 
static const clock_ip_name_t s_acmpClock [] = CMP_CLOCKS
 

Function Documentation

◆ ACMP_GetInstance()

static uint32_t ACMP_GetInstance ( CMP_Type *  base)
static

Get the ACMP instance from the peripheral base address.

Parameters
baseACMP peripheral base address.
Returns
ACMP instance.

Definition at line 45 of file fsl_acmp.c.

46{
47 uint32_t instance = 0U;
48 uint32_t acmpArrayCount = (sizeof(s_acmpBases) / sizeof(s_acmpBases[0]));
49
50 /* Find the instance index from base address mappings. */
51 for (instance = 0; instance < acmpArrayCount; instance++)
52 {
53 if (s_acmpBases[instance] == base)
54 {
55 break;
56 }
57 }
58
59 return instance;
60}
static BenchController instance
static CMP_Type *const s_acmpBases[]
Definition fsl_acmp.c:36

Referenced by ACMP_Deinit(), and ACMP_Init().

Here is the caller graph for this function:

Variable Documentation

◆ s_acmpBases

CMP_Type* const s_acmpBases[] = CMP_BASE_PTRS
static

Definition at line 36 of file fsl_acmp.c.

Referenced by ACMP_GetInstance().

◆ s_acmpClock

const clock_ip_name_t s_acmpClock[] = CMP_CLOCKS
static

Definition at line 39 of file fsl_acmp.c.

Referenced by ACMP_Deinit(), and ACMP_Init().

Go to the source code of this file.