52 CMP_Type* base = g_cmpBase[instance];
78 (config->
dac).state =
false;
80 (config->
dac).voltage = 0U;
83 (config->
mux).negativeInputMux = 0U;
84 (config->
mux).positiveInputMux = 0U;
86 (config->
triggerMode).roundRobinInterruptState =
false;
107 CMP_Type* base = g_cmpBase[instance];
150 const CMP_Type* base = g_cmpBase[instance];
191 config->
state =
false;
208 CMP_Type* base = g_cmpBase[instance];
226 const CMP_Type* base = g_cmpBase[instance];
263 CMP_Type* base = g_cmpBase[instance];
283 const CMP_Type* base = g_cmpBase[instance];
324 CMP_Type* base = g_cmpBase[instance];
347 const CMP_Type* base = g_cmpBase[instance];
370 const CMP_Type* base = g_cmpBase[instance];
385 CMP_Type* base = g_cmpBase[instance];
403 const CMP_Type* base = g_cmpBase[instance];
418 CMP_Type* base = g_cmpBase[instance];
460 CMP_Type* base = g_cmpBase[instance];
486 const CMP_Type* base = g_cmpBase[instance];
static cmp_hysteresis_t CMP_HAL_GetHysteresis(const CMP_Type *baseAddr)
Return the current hysteresis level.
static void CMP_HAL_SetInitDelay(CMP_Type *baseAddr, uint8_t to_set)
Set the comparator and DAC initialization delay.
status_t CMP_DRV_GetComparatorConfig(const uint32_t instance, cmp_comparator_t *config)
Return configuration for comparator from CMP module.
static cmp_ch_number_t CMP_HAL_GetFixedChannel(const CMP_Type *baseAddr)
Return which channel is selected for fixed mux port(as fixed reference)
cmp_ch_number_t fixedChannel
static cmp_ch_list_t CMP_HAL_GetInputChangedFlags(const CMP_Type *baseAddr)
Return all input changed flags.
static void CMP_HAL_SetInverterState(CMP_Type *baseAddr, cmp_inverter_t to_set)
Configure the comparator output inverter mode.
uint8_t initializationDelay
cmp_fixed_port_t fixedPort
status_t CMP_DRV_GetDACConfig(const uint32_t instance, cmp_dac_t *const config)
Return current configuration for DAC.
static cmp_output_trigger_t CMP_HAL_GetOutputEvent(const CMP_Type *baseAddr)
Return type of event occurred at the comparator output.
static void CMP_HAL_SetFilterSamplePeriod(CMP_Type *baseAddr, uint8_t to_set)
Set the filter sample period(clock cycles)
static void CMP_HAL_SetOutputInterruptTrigger(CMP_Type *baseAddr, cmp_output_trigger_t to_set)
Set the comparator output interrupts source configuration(none, rising edge, falling edge or both edg...
static void CMP_HAL_SetVoltageReference(CMP_Type *baseAddr, cmp_voltage_reference_t to_set)
Set the voltage reference.
status_t CMP_DRV_ConfigTriggerMode(const uint32_t instance, const cmp_trigger_mode_t *config)
Configure trigger mode.
cmp_ch_number_t positiveInputMux
static void CMP_HAL_SetComparatorOutputSource(CMP_Type *baseAddr, cmp_output_select_t to_set)
Select the comparator output signal source.
static void CMP_HAL_SetDMATriggerState(CMP_Type *baseAddr, bool to_set)
Configure the DMA transfer trigger.
static void CMP_HAL_SetPositivePortInput(CMP_Type *baseAddr, cmp_port_mux_t to_set)
Set the source for positive port of the comparator.
cmp_output_trigger_t
Comparator output interrupt configuration Implements : cmp_output_trigger_t_Class.
static void CMP_HAL_SetDACState(CMP_Type *baseAddr, bool to_set)
Set the DAC state (enabled/disabled)
status_t CMP_DRV_GetInitTriggerMode(cmp_trigger_mode_t *config)
Get reset configuration for registers related with Trigger Mode.
static cmp_ch_number_t CMP_HAL_GetMinusMUXControl(const CMP_Type *baseAddr)
Determine which input is selected for the minus mux.
static void CMP_HAL_SetRoundRobinState(CMP_Type *baseAddr, bool to_set)
Set the round robin operation state.
static void CMP_HAL_ClearOutputEvent(CMP_Type *baseAddr)
Clear all output flags.
static CMP_Type *const g_cmpBase[]
void CMP_HAL_SetFunctionalMode(CMP_Type *baseAddr, cmp_mode_t mode, uint8_t filter_sample_count, uint8_t filter_sample_period)
Sets the comparator functional mode (mode, filter count, filter period)
static void CMP_HAL_SetPowerMode(CMP_Type *baseAddr, cmp_power_mode_t to_set)
Set the power mode.
static uint8_t CMP_HAL_GetVoltage(const CMP_Type *baseAddr)
Return the current output voltage level(0-255)
static void CMP_HAL_SetVoltage(CMP_Type *baseAddr, uint8_t to_set)
Set the output voltage level.
status_t CMP_DRV_ConfigDAC(const uint32_t instance, const cmp_dac_t *config)
Configure only the DAC component.
cmp_mode_t CMP_HAL_GetFunctionalMode(const CMP_Type *baseAddr)
Gets the comparator functional mode. If you want to get filter count and filter period please use CMP...
static cmp_voltage_reference_t CMP_HAL_GetVoltageReference(const CMP_Type *baseAddr)
Return the current voltage reference.
status_t CMP_DRV_GetInitConfigComparator(cmp_comparator_t *config)
Get reset configuration for registers related with comparator features.
status_t CMP_DRV_GetTriggerModeConfig(const uint32_t instance, cmp_trigger_mode_t *const config)
Get current trigger mode configuration.
bool roundRobinInterruptState
Defines the trigger mode.
status_t CMP_DRV_ClearInputFlags(const uint32_t instance)
Clear comparator input channels flags.
uint8_t cmp_ch_list_t
Comparator channels list (1bit/channel) |------—|------—|--—|------—|------—| |CH7_state|CH6_sta...
static cmp_offset_t CMP_HAL_GetOffset(const CMP_Type *baseAddr)
Return the current offset level.
status_t CMP_DRV_GetOutputFlags(const uint32_t instance, cmp_output_trigger_t *flags)
Get comparator output flags.
static cmp_ch_list_t CMP_HAL_GetRoundRobinChannels(const CMP_Type *baseAddr)
Return which channels are used for round-robin checker.
status_t CMP_DRV_GetConfigAll(const uint32_t instance, cmp_module_t *const config)
Gets the current comparator configuration.
static cmp_output_enable_t CMP_HAL_GetOutputPinState(const CMP_Type *baseAddr)
Verify if the comparator output state(available/not available in a packaged pin)
static void CMP_HAL_SetPresetState(CMP_Type *baseAddr, cmp_ch_list_t to_set)
Defines the pre-set state of input channels.
cmp_ch_list_t roundRobinChannelsState
uint8_t filterSamplePeriod
Defines the comparator module configuration.
static cmp_inverter_t CMP_HAL_GetInverterState(const CMP_Type *baseAddr)
Return the current comparator output inverter.
status_t CMP_DRV_ConfigMUX(const uint32_t instance, const cmp_anmux_t *config)
Configure only the MUX component.
static cmp_port_mux_t CMP_HAL_GetNegativePortInput(const CMP_Type *baseAddr)
Return the current source for negative port of the comparator.
status_t CMP_DRV_GetInitConfigMUX(cmp_anmux_t *config)
Get reset configuration for registers related with MUX.
status_t CMP_DRV_GetInputFlags(const uint32_t instance, cmp_ch_list_t *flags)
Gets input channels change flags.
cmp_voltage_reference_t voltageReferenceSource
status_t CMP_DRV_ConfigComparator(const uint32_t instance, const cmp_comparator_t *config)
Configure only comparator features.
static void CMP_HAL_ClearInputChangedFlags(CMP_Type *baseAddr)
Clear all input changed flags.
static cmp_ch_list_t CMP_HAL_GetLastComparisonResult(const CMP_Type *baseAddr)
Return last input comparison results for all channels.
static uint8_t CMP_HAL_GetInitDelay(const CMP_Type *baseAddr)
Return the comparator and DAC initialization delay.
static cmp_port_mux_t CMP_HAL_GetPositivePortInput(const CMP_Type *baseAddr)
Return the current source for positive port of the comparator.
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
status_t CMP_DRV_Reset(const uint32_t instance)
Reset all registers.
cmp_output_enable_t pinState
static void CMP_HAL_SetOffset(CMP_Type *baseAddr, cmp_offset_t to_set)
Set the offset level.
static void CMP_HAL_SetFixedChannel(CMP_Type *baseAddr, cmp_ch_number_t to_set)
Set which channel is used as the fixed reference input for the fixed mux port.
status_t CMP_DRV_GetInitConfigAll(cmp_module_t *config)
Get reset configuration for all registers.
static uint8_t CMP_HAL_GetFilterSamplePeriod(const CMP_Type *baseAddr)
Return the sample period for filter(clock cycles)
status_t CMP_DRV_Init(const uint32_t instance, const cmp_module_t *const config)
Configure all comparator features with the given configuration structure.
static bool CMP_HAL_GetDMATriggerState(const CMP_Type *baseAddr)
Verify if the DMA transfer trigger is enabled.
static uint8_t CMP_HAL_GetFilterSampleCount(const CMP_Type *baseAddr)
Return the number of consecutive samples that must agree prior to the comparator output filter accept...
cmp_ch_number_t negativeInputMux
static void CMP_HAL_SetRoundRobinSamplesNumber(CMP_Type *baseAddr, uint8_t to_set)
Set how many round-robin clock cycles takes sampling.
static cmp_output_trigger_t CMP_HAL_GetOutputInterruptTrigger(const CMP_Type *baseAddr)
Return the comparator output interrupts source configuration(none, rising edge, falling edge or both ...
static cmp_power_mode_t CMP_HAL_GetPowerMode(const CMP_Type *baseAddr)
Return the current power mode.
static void CMP_HAL_SetRoundRobinChannels(CMP_Type *baseAddr, cmp_ch_list_t to_set)
Set which channels are use for round-robin checker.
cmp_port_mux_t positivePortMux
static uint8_t CMP_HAL_GetRoundRobinSamplesNumber(const CMP_Type *baseAddr)
Return how many round-robin clock cycles takes sampling.
#define CMP_INSTANCE_COUNT
void CMP_HAL_Init(CMP_Type *baseAddr)
Initializes the comparator registers with reset values.
static void CMP_HAL_SetMinusMUXControl(CMP_Type *baseAddr, cmp_ch_number_t to_set)
Select input for the minus mux.
cmp_comparator_t comparator
static void CMP_HAL_SetRoundRobinInterruptState(CMP_Type *baseAddr, bool to_set)
Set the round robin interrupt state.
static void CMP_HAL_SetOutputPinState(CMP_Type *baseAddr, cmp_output_enable_t to_set)
Set the comparator output pin state(available/not available in a packaged pin)
cmp_output_select_t outputSelect
static void CMP_HAL_SetPlusMuxControl(CMP_Type *baseAddr, cmp_ch_number_t to_set)
Select input for the plus mux.
static cmp_ch_number_t CMP_HAL_GetPlusMUXControl(const CMP_Type *baseAddr)
Determine which input is selected for the plus mux.
status_t CMP_DRV_GetInitConfigDAC(cmp_dac_t *config)
Get reset configuration for registers related with DAC.
Defines the block configuration.
static void CMP_HAL_SetFilterSampleCount(CMP_Type *baseAddr, uint8_t to_set)
Set the number of consecutive samples that must agree prior to the comparator output filter accepting...
cmp_hysteresis_t hysteresisLevel
status_t CMP_DRV_ClearOutputFlags(const uint32_t instance)
Clear comparator output flags.
static void CMP_HAL_SetHysteresis(CMP_Type *baseAddr, cmp_hysteresis_t to_set)
Set the hysteresis level.
uint8_t filterSampleCount
static void CMP_HAL_SetNegativePortInput(CMP_Type *baseAddr, cmp_port_mux_t to_set)
Set the source for negative port of the comparator.
static void CMP_HAL_SetFixedPort(CMP_Type *baseAddr, cmp_fixed_port_t to_set)
Set the fixed port for round-robin operation.
cmp_trigger_mode_t triggerMode
cmp_output_trigger_t outputInterruptTrigger
static cmp_fixed_port_t CMP_HAL_GetFixedPort(const CMP_Type *baseAddr)
Return the port fixed for round-robin operation.
status_t CMP_DRV_GetMUXConfig(const uint32_t instance, cmp_anmux_t *const config)
Return configuration only for the MUX component.
cmp_ch_list_t programedState
cmp_power_mode_t powerMode
cmp_inverter_t inverterState
static cmp_output_select_t CMP_HAL_GetComparatorOutputSource(const CMP_Type *baseAddr)
Return the current comparator output selected.
cmp_port_mux_t negativePortMux
static bool CMP_HAL_GetRoundRobinState(const CMP_Type *baseAddr)
Verify if the round robin operation is enabled.
static bool CMP_HAL_GetRoundRobinInterruptState(const CMP_Type *baseAddr)
Verify if the round robin interrupt is enabled.
static bool CMP_HAL_GetDACState(const CMP_Type *baseAddr)
Verify if the DAC is enabled.