HAL COMP Types ¶
HAL COMP Types ¶
- group COMP_Exported_Types
-
Typedefs
-
typedef
struct
hal_comp_handle_s
hal_comp_handle_t
¶
-
COMP handle type definition
-
typedef
void
(
*
hal_comp_cb_t
)
(
hal_comp_handle_t
*
hcomp
)
¶
-
pointer to COMP callback functions
Enums
-
enum
hal_comp_state_t
¶
-
COMP Global state.
Values:
-
enumerator
HAL_COMP_STATE_RESET
¶
-
HAL Comparator handle not yet initialized
-
enumerator
HAL_COMP_STATE_INIT
¶
-
HAL Comparator handle initialized but comparator not yet configured
-
enumerator
HAL_COMP_STATE_IDLE
¶
-
Comparator configured
-
enumerator
HAL_COMP_STATE_ACTIVE
¶
-
Comparator operating
-
enumerator
HAL_COMP_STATE_LINKED
¶
-
HAL Comparator handle linked to other comparator handle
-
enumerator
HAL_COMP_STATE_WINDOW_IDLE
¶
-
Comparator configured in window mode (with other comparator handle)
-
enumerator
HAL_COMP_STATE_WINDOW_ACTIVE
¶
-
Comparator operating in window mode (with other comparator handle)
-
enumerator
HAL_COMP_STATE_RESET
¶
-
enum
hal_comp_power_mode_t
¶
-
HAL COMP power mode.
Note
For the electrical characteristics of comparator power modes (propagation delay, power consumption), refer to device datasheet.
Values:
-
enumerator
HAL_COMP_POWER_MODE_HIGH_SPEED
¶
-
Comparator power mode to high speed Comparator power mode to high speed
-
enumerator
HAL_COMP_POWER_MODE_MEDIUM_SPEED
¶
-
Comparator power mode to medium speed Comparator power mode to medium speed
-
enumerator
HAL_COMP_POWER_MODE_ULTRA_LOW_POWER
¶
-
Comparator power mode to ultra-low power Comparator power mode to ultra-low power
-
enumerator
HAL_COMP_POWER_MODE_HIGH_SPEED
¶
-
enum
hal_comp_input_plus_t
¶
-
HAL COMP input plus.
Values:
-
enumerator
HAL_COMP_INPUT_PLUS_IO1
¶
-
Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INP1”) Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INP1”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO2
¶
-
Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INP2”) Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INP2”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO3
¶
-
Comparator input plus connected to IO3 (for GPIO mapping, refer to datasheet parameters “COMPx_INP3”) Comparator input plus connected to IO3 (for GPIO mapping, refer to datasheet parameters “COMPx_INP3”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO1
¶
-
enum
hal_comp_input_minus_t
¶
-
HAL COMP input minus.
Values:
-
enumerator
HAL_COMP_INPUT_MINUS_VREFINT
¶
-
Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_1_4VREFINT
¶
-
Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_1_2VREFINT
¶
-
Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_3_4VREFINT
¶
-
Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_IO1
¶
-
Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INM1”) Comparator input minus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INM1”)
-
enumerator
HAL_COMP_INPUT_MINUS_IO2
¶
-
Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INM2”) Comparator input minus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INM2”)
-
enumerator
HAL_COMP_INPUT_MINUS_DAC1_CH1
¶
-
Comparator input minus connected to DAC1 channel 1 Comparator input minus connected to DAC1 channel 1
-
enumerator
HAL_COMP_INPUT_MINUS_DAC1_CH2
¶
-
Comparator input minus connected to DAC1 channel 2 Comparator input minus connected to DAC1 channel 2
-
enumerator
HAL_COMP_INPUT_MINUS_VREFINT
¶
-
enum
hal_comp_input_hysteresis_t
¶
-
HAL COMP input hysteresis.
Note
Hysteresis applied to input plus, subtracted to input voltage value.
Note
For the electrical characteristics of comparator hysteresis (voltage amplitude), refer to device datasheet.
Values:
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_NONE
¶
-
No hysteresis Comparator input without hysteresis
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_LOW
¶
-
Hysteresis level low Comparator input hysteresis level low
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_MEDIUM
¶
-
Hysteresis level medium Comparator input hysteresis level medium
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_HIGH
¶
-
Hysteresis level high Comparator input hysteresis level high
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_NONE
¶
-
enum
hal_comp_output_polarity_t
¶
-
HAL COMP output polarity.
Values:
-
enumerator
HAL_COMP_OUTPUT_POLARITY_NONINVERTED
¶
-
Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus
-
enumerator
HAL_COMP_OUTPUT_POLARITY_INVERTED
¶
-
Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus
-
enumerator
HAL_COMP_OUTPUT_POLARITY_NONINVERTED
¶
-
enum
hal_comp_output_blank_t
¶
-
HAL COMP output blanking.
Values:
-
enumerator
HAL_COMP_OUTPUT_BLANK_NONE
¶
-
Comparator output without blanking Comparator output without blanking
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM1_OC5
¶
-
Comparator output blanking source TIM1 OC5 (specific to comparator instance: COMP1) Comparator output blanking source TIM1 OC5 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM2_OC3
¶
-
Comparator output blanking source TIM2 OC3 (specific to comparator instance: COMP1) Comparator output blanking source TIM2 OC3 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM3_OC3
¶
-
Comparator output blanking source TIM3 OC3 (specific to comparator instance: COMP1) Comparator output blanking source TIM3 OC3 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM3_OC4
¶
-
Comparator output blanking source TIM3 OC4 (specific to comparator instance: COMP2) Comparator output blanking source TIM3 OC4 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM8_OC5
¶
-
Comparator output blanking source TIM8 OC5 (specific to comparator instance: COMP2) Comparator output blanking source TIM8 OC5 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM15_OC1
¶
-
Comparator output blanking source TIM15 OC1 (specific to comparator instance: COMP2) Comparator output blanking source TIM15 OC1 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_NONE
¶
-
enum
hal_comp_output_trigger_t
¶
-
HAL COMP output trigger to system.
Note
When output set to generate a trigger, impact depends on programming model used:
-
with HAL_COMP_Start() : generates a system wake-up event and a CPU event
-
with HAL_COMP_Start_IT() : generates a system wake-up event and a CPU interruption
Values:
-
enumerator
HAL_COMP_OUTPUT_TRIG_NONE
¶
-
No Trigger Mode Comparator output does not generate a trigger
-
enumerator
HAL_COMP_OUTPUT_TRIG_RISING
¶
-
Trigger Rising Mode Comparator output generates a trigger event to system on rising edge
-
enumerator
HAL_COMP_OUTPUT_TRIG_FALLING
¶
-
Trigger Falling Mode Comparator output generates a trigger event to system on falling edge
-
enumerator
HAL_COMP_OUTPUT_TRIG_RISING_FALLING
¶
-
Trigger Rising & Falling Mode Comparator output generates a trigger event to system on both rising and falling edges
-
-
enum
hal_comp_window_output_mode_t
¶
-
HAL COMP window output.
Values:
-
enumerator
HAL_COMP_WINDOW_OUTPUT_INDEPT
¶
-
Comparators window output default mode: both comparators output are independent, indicating each their own state. Note: To know signal state versus window thresholds, read each comparator output and perform a logical “exclusive or” operation. Comparators window output default mode: both comparators output are independent, indicating each their own state. Note: To know signal state versus window thresholds, read each comparator output and perform a logical “exclusive or” operation.
-
enumerator
HAL_COMP_WINDOW_OUTPUT_XOR
¶
-
Window output synthesized on both comparators output of pair of comparator selected (COMP1 and COMP2): both comparators outputs are no more indicating their own state, but global window mode state (XOR: logical “exclusive or”). Logical high means monitored signal is within comparators window thresholds). This is a specific configuration (technically possible but not relevant from application point of view: 2 comparators output used for the same signal level), standard configuration for window mode is one of the settings above. Note: impacts only comparator output signal level (propagated to GPIO, EXTI lines, timers, …), does not impact output digital state ( LL_COMP_ReadOutputLevel() ) always reflecting each comparator output state. Comparators window output synthesized on a single comparator output: comparator no more indicating its own state, but window state (XOR: logical “exclusive or”). Logical high means monitored signal is within comparators window thresholds. Comparator instance selected corresponds to handle assigned as upper threshold in HAL_COMP_WINDOW_SetHandle() . Note: impacts only comparator output signal level (propagated to GPIO, EXTI lines, timers, …), does not impact output digital state ( hal_comp_output_level_t ) always reflecting each comparator output state.
-
enumerator
HAL_COMP_WINDOW_OUTPUT_INDEPT
¶
-
enum
hal_comp_window_output_level_t
¶
-
HAL COMP window output level.
Note
Comparator output level depends on inputs voltages and output polarity.
Values:
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_BELOW
¶
-
Comparators window output below window low threshold
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_WITHIN
¶
-
Comparators window output within window thresholds
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_ABOVE
¶
-
Comparators window output above window high threshold
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_BELOW
¶
-
enum
hal_comp_window_instance_t
¶
-
HAL COMP window instances assignation.
Values:
-
enumerator
HAL_COMP_WINDOW_INST_NONE
¶
-
Comparators window instance not assigned
-
enumerator
HAL_COMP_WINDOW_INST_UPPER
¶
-
Comparators window instance assignation upper
-
enumerator
HAL_COMP_WINDOW_INST_LOWER
¶
-
Comparators window instance assignation lower
-
enumerator
HAL_COMP_WINDOW_INST_NONE
¶
-
enum
hal_comp_lock_status_t
¶
-
HAL COMP lock state.
Values:
-
enumerator
HAL_COMP_LOCK_DISABLED
¶
-
Comparator not locked
-
enumerator
HAL_COMP_LOCK_ENABLED
¶
-
Comparator locked
-
enumerator
HAL_COMP_LOCK_DISABLED
¶
-
enum
hal_comp_output_level_t
¶
-
HAL COMP output level.
Note
Comparator output level depends on inputs voltages and output polarity.
Values:
-
enumerator
HAL_COMP_OUTPUT_LEVEL_LOW
¶
-
Comparator output level low (with polarity not inverted) Comparator output logical level low
-
enumerator
HAL_COMP_OUTPUT_LEVEL_HIGH
¶
-
Comparator output level high (with polarity not inverted) Comparator output logical level high
-
enumerator
HAL_COMP_OUTPUT_LEVEL_LOW
¶
-
struct
hal_comp_config_t
¶
-
#include <stm32u5xx_hal_comp.h>
COMP Global configuration.
Public Members
-
hal_comp_power_mode_t
power_mode
¶
-
Comparator power mode
-
hal_comp_input_plus_t
input_plus
¶
-
Comparator input plus
-
hal_comp_input_minus_t
input_minus
¶
-
Comparator input minus
-
hal_comp_input_hysteresis_t
input_hysteresis
¶
-
Comparator input hysteresis
-
hal_comp_output_polarity_t
output_polarity
¶
-
Comparator output polarity
-
hal_comp_output_trigger_t
output_trigger
¶
-
Comparator output trigger to system (wake up, CPU)
-
hal_comp_power_mode_t
power_mode
¶
-
struct
hal_comp_window_config_t
¶
-
#include <stm32u5xx_hal_comp.h>
COMP window mode configuration.
Public Members
-
hal_comp_input_plus_t
input
¶
-
Window comparators input.
Note
This parameter corresponds to common input plus. Comparators instances pair have their input plus connected together (common input plus). The input plus used corresponds to handle used in first argument (hcomp_upper_threshold) of function HAL_COMP_WINDOW_SetHandle() (input plus of the other comparator is no more accessible)
-
hal_comp_input_minus_t
upper_threshold
¶
-
Window comparators upper threshold.
Note
This parameter corresponds to input minus of handle used in first argument (hcomp_upper_threshold) of function HAL_COMP_WINDOW_SetHandle() .
Note
Term “upper” does not imply voltage value must be higher than the other threshold. This is an arbitrary selection to determine window output level ( hal_comp_window_output_level_t ).
-
hal_comp_input_minus_t
lower_threshold
¶
-
Window comparators lower threshold.
Note
This parameter corresponds to input minus of handle used in second argument (hcomp_lower_threshold) of function HAL_COMP_WINDOW_SetHandle() .
Note
Term “lower” does not imply voltage value must be higher than the other threshold. This is an arbitrary selection to determine window output level ( hal_comp_window_output_level_t ).
-
hal_comp_power_mode_t
power_mode
¶
-
Comparator power mode
-
hal_comp_input_hysteresis_t
input_hysteresis
¶
-
Comparator input hysteresis
-
hal_comp_output_polarity_t
output_polarity
¶
-
Comparator output polarity
-
hal_comp_output_trigger_t
output_trigger
¶
-
Comparator output trigger to system (wake up, CPU)
-
hal_comp_window_output_mode_t
window_output_mode
¶
-
Comparator window output
-
hal_comp_input_plus_t
input
¶
-
struct
hal_comp_handle_s
¶
-
#include <stm32u5xx_hal_comp.h>
COMP Handle Structure Definition.
Public Members
-
hal_comp_t
instance
¶
-
Peripheral instance
-
hal_comp_handle_t
*
p_link_next_handle
¶
-
Pointer to another HAL COMP handle of instance belonging to the same COMP common instance (therefore, sharing common features). Used to access multiple HAL COMP handles (daisy chain: from one to another and circular). Set using function HAL_COMP_WINDOW_SetHandle() .
-
hal_comp_window_instance_t
window_instance
¶
-
Comparators window instance assignation
-
volatile
hal_comp_state_t
global_state
¶
-
Global state
-
const
void
*
p_user_data
¶
-
User data pointer
-
hal_comp_cb_t
p_output_trigger_cb
¶
-
COMP output trigger callback
-
uint32_t
exti_line
¶
-
EXTI line (needed for event and IT operation) on LL driver format
-
hal_comp_output_trigger_t
output_trigger
¶
-
Comparator output trigger configured
-
hal_comp_t
instance
¶
-
typedef
struct
hal_comp_handle_s
hal_comp_handle_t
¶
- group COMP_Exported_Types
-
Typedefs
-
typedef
struct
hal_comp_handle_s
hal_comp_handle_t
-
COMP handle type definition
-
typedef
void
(
*
hal_comp_cb_t
)
(
hal_comp_handle_t
*
hcomp
)
-
pointer to COMP callback functions
Enums
-
enum
hal_comp_t
-
HAL COMP instance.
Values:
-
enumerator
HAL_COMP1
-
enumerator
HAL_COMP2
-
enumerator
HAL_COMP1
-
enum
hal_comp_state_t
-
COMP Global state.
Values:
-
enumerator
HAL_COMP_STATE_RESET
-
HAL Comparator handle not yet initialized
-
enumerator
HAL_COMP_STATE_INIT
-
HAL Comparator handle initialized but comparator not yet configured
-
enumerator
HAL_COMP_STATE_IDLE
-
Comparator configured
-
enumerator
HAL_COMP_STATE_ACTIVE
-
Comparator operating
-
enumerator
HAL_COMP_STATE_LINKED
-
HAL Comparator handle linked to other comparator handle
-
enumerator
HAL_COMP_STATE_WINDOW_IDLE
-
Comparator configured in window mode (with other comparator handle)
-
enumerator
HAL_COMP_STATE_WINDOW_ACTIVE
-
Comparator operating in window mode (with other comparator handle)
-
enumerator
HAL_COMP_STATE_RESET
-
enum
hal_comp_power_mode_t
-
HAL COMP power mode.
Note
For the electrical characteristics of comparator power modes (propagation delay, power consumption), refer to device datasheet.
Values:
-
enumerator
HAL_COMP_POWER_MODE_HIGH_SPEED
-
Comparator power mode to high speed Comparator power mode to high speed
-
enumerator
HAL_COMP_POWER_MODE_MEDIUM_SPEED
-
Comparator power mode to medium speed Comparator power mode to medium speed
-
enumerator
HAL_COMP_POWER_MODE_ULTRA_LOW_POWER
-
Comparator power mode to ultra-low power Comparator power mode to ultra-low power
-
enumerator
HAL_COMP_POWER_MODE_HIGH_SPEED
-
enum
hal_comp_input_plus_t
-
HAL COMP input plus.
Values:
-
enumerator
HAL_COMP_INPUT_PLUS_IO1
-
Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INP1”) Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INP1”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO2
-
Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INP2”) Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INP2”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO3
-
Comparator input plus connected to IO3 (for GPIO mapping, refer to datasheet parameters “COMPx_INP3”) Comparator input plus connected to IO3 (for GPIO mapping, refer to datasheet parameters “COMPx_INP3”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO1
-
enum
hal_comp_input_minus_t
-
HAL COMP input minus.
Values:
-
enumerator
HAL_COMP_INPUT_MINUS_VREFINT
-
Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_1_4VREFINT
-
Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_1_2VREFINT
-
Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_3_4VREFINT
-
Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_IO1
-
Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INM1”) Comparator input minus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INM1”)
-
enumerator
HAL_COMP_INPUT_MINUS_IO2
-
Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INM2”) Comparator input minus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INM2”)
-
enumerator
HAL_COMP_INPUT_MINUS_DAC1_CH1
-
Comparator input minus connected to DAC1 channel 1 Comparator input minus connected to DAC1 channel 1
-
enumerator
HAL_COMP_INPUT_MINUS_DAC1_CH2
-
Comparator input minus connected to DAC1 channel 2 Comparator input minus connected to DAC1 channel 2
-
enumerator
HAL_COMP_INPUT_MINUS_VREFINT
-
enum
hal_comp_input_hysteresis_t
-
HAL COMP input hysteresis.
Note
Hysteresis applied to input plus, subtracted to input voltage value.
Note
For the electrical characteristics of comparator hysteresis (voltage amplitude), refer to device datasheet.
Values:
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_NONE
-
No hysteresis Comparator input without hysteresis
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_LOW
-
Hysteresis level low Comparator input hysteresis level low
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_MEDIUM
-
Hysteresis level medium Comparator input hysteresis level medium
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_HIGH
-
Hysteresis level high Comparator input hysteresis level high
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_NONE
-
enum
hal_comp_output_polarity_t
-
HAL COMP output polarity.
Values:
-
enumerator
HAL_COMP_OUTPUT_POLARITY_NONINVERTED
-
Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus
-
enumerator
HAL_COMP_OUTPUT_POLARITY_INVERTED
-
Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus
-
enumerator
HAL_COMP_OUTPUT_POLARITY_NONINVERTED
-
enum
hal_comp_output_blank_t
-
HAL COMP output blanking.
Values:
-
enumerator
HAL_COMP_OUTPUT_BLANK_NONE
-
Comparator output without blanking Comparator output without blanking
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM1_OC5
-
Comparator output blanking source TIM1 OC5 (specific to comparator instance: COMP1) Comparator output blanking source TIM1 OC5 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM2_OC3
-
Comparator output blanking source TIM2 OC3 (specific to comparator instance: COMP1) Comparator output blanking source TIM2 OC3 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM3_OC3
-
Comparator output blanking source TIM3 OC3 (specific to comparator instance: COMP1) Comparator output blanking source TIM3 OC3 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM3_OC4
-
Comparator output blanking source TIM3 OC4 (specific to comparator instance: COMP2) Comparator output blanking source TIM3 OC4 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM8_OC5
-
Comparator output blanking source TIM8 OC5 (specific to comparator instance: COMP2) Comparator output blanking source TIM8 OC5 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM15_OC1
-
Comparator output blanking source TIM15 OC1 (specific to comparator instance: COMP2) Comparator output blanking source TIM15 OC1 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_NONE
-
enum
hal_comp_output_trigger_t
-
HAL COMP output trigger to system.
Note
When output set to generate a trigger, impact depends on programming model used:
-
with HAL_COMP_Start() : generates a system wake-up event and a CPU event
-
with HAL_COMP_Start_IT() : generates a system wake-up event and a CPU interruption
Values:
-
enumerator
HAL_COMP_OUTPUT_TRIG_NONE
-
No Trigger Mode Comparator output does not generate a trigger
-
enumerator
HAL_COMP_OUTPUT_TRIG_RISING
-
Trigger Rising Mode Comparator output generates a trigger event to system on rising edge
-
enumerator
HAL_COMP_OUTPUT_TRIG_FALLING
-
Trigger Falling Mode Comparator output generates a trigger event to system on falling edge
-
enumerator
HAL_COMP_OUTPUT_TRIG_RISING_FALLING
-
Trigger Rising & Falling Mode Comparator output generates a trigger event to system on both rising and falling edges
-
-
enum
hal_comp_window_output_mode_t
-
HAL COMP window output.
Values:
-
enumerator
HAL_COMP_WINDOW_OUTPUT_INDEPT
-
Comparators window output default mode: both comparators output are independent, indicating each their own state. Note: To know signal state versus window thresholds, read each comparator output and perform a logical “exclusive or” operation. Comparators window output default mode: both comparators output are independent, indicating each their own state. Note: To know signal state versus window thresholds, read each comparator output and perform a logical “exclusive or” operation.
-
enumerator
HAL_COMP_WINDOW_OUTPUT_XOR
-
Window output synthesized on both comparators output of pair of comparator selected (COMP1 and COMP2): both comparators outputs are no more indicating their own state, but global window mode state (XOR: logical “exclusive or”). Logical high means monitored signal is within comparators window thresholds). This is a specific configuration (technically possible but not relevant from application point of view: 2 comparators output used for the same signal level), standard configuration for window mode is one of the settings above. Note: impacts only comparator output signal level (propagated to GPIO, EXTI lines, timers, …), does not impact output digital state ( LL_COMP_ReadOutputLevel() ) always reflecting each comparator output state. Comparators window output synthesized on a single comparator output: comparator no more indicating its own state, but window state (XOR: logical “exclusive or”). Logical high means monitored signal is within comparators window thresholds. Comparator instance selected corresponds to handle assigned as upper threshold in HAL_COMP_WINDOW_SetHandle() . Note: impacts only comparator output signal level (propagated to GPIO, EXTI lines, timers, …), does not impact output digital state ( hal_comp_output_level_t ) always reflecting each comparator output state.
-
enumerator
HAL_COMP_WINDOW_OUTPUT_INDEPT
-
enum
hal_comp_window_output_level_t
-
HAL COMP window output level.
Note
Comparator output level depends on inputs voltages and output polarity.
Values:
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_BELOW
-
Comparators window output below window low threshold
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_WITHIN
-
Comparators window output within window thresholds
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_ABOVE
-
Comparators window output above window high threshold
-
enumerator
HAL_COMP_WINDOW_OUTPUT_LEVEL_BELOW
-
enum
hal_comp_window_instance_t
-
HAL COMP window instances assignation.
Values:
-
enumerator
HAL_COMP_WINDOW_INST_NONE
-
Comparators window instance not assigned
-
enumerator
HAL_COMP_WINDOW_INST_UPPER
-
Comparators window instance assignation upper
-
enumerator
HAL_COMP_WINDOW_INST_LOWER
-
Comparators window instance assignation lower
-
enumerator
HAL_COMP_WINDOW_INST_NONE
-
enum
hal_comp_lock_status_t
-
HAL COMP lock state.
Values:
-
enumerator
HAL_COMP_LOCK_DISABLED
-
Comparator not locked
-
enumerator
HAL_COMP_LOCK_ENABLED
-
Comparator locked
-
enumerator
HAL_COMP_LOCK_DISABLED
-
enum
hal_comp_output_level_t
-
HAL COMP output level.
Note
Comparator output level depends on inputs voltages and output polarity.
Values:
-
enumerator
HAL_COMP_OUTPUT_LEVEL_LOW
-
Comparator output level low (with polarity not inverted) Comparator output logical level low
-
enumerator
HAL_COMP_OUTPUT_LEVEL_HIGH
-
Comparator output level high (with polarity not inverted) Comparator output logical level high
-
enumerator
HAL_COMP_OUTPUT_LEVEL_LOW
-
struct
hal_comp_config_t
-
#include <stm32u5xx_hal_comp.h>
COMP Global configuration.
Public Members
-
hal_comp_power_mode_t
power_mode
-
Comparator power mode
-
hal_comp_input_plus_t
input_plus
-
Comparator input plus
-
hal_comp_input_minus_t
input_minus
-
Comparator input minus
-
hal_comp_input_hysteresis_t
input_hysteresis
-
Comparator input hysteresis
-
hal_comp_output_polarity_t
output_polarity
-
Comparator output polarity
-
hal_comp_output_trigger_t
output_trigger
-
Comparator output trigger to system (wake up, CPU)
-
hal_comp_power_mode_t
power_mode
-
struct
hal_comp_window_config_t
-
#include <stm32u5xx_hal_comp.h>
COMP window mode configuration.
Public Members
-
hal_comp_input_plus_t
input
-
Window comparators input.
Note
This parameter corresponds to common input plus. Comparators instances pair have their input plus connected together (common input plus). The input plus used corresponds to handle used in first argument (hcomp_upper_threshold) of function HAL_COMP_WINDOW_SetHandle() (input plus of the other comparator is no more accessible)
-
hal_comp_input_minus_t
upper_threshold
-
Window comparators upper threshold.
Note
This parameter corresponds to input minus of handle used in first argument (hcomp_upper_threshold) of function HAL_COMP_WINDOW_SetHandle() .
Note
Term “upper” does not imply voltage value must be higher than the other threshold. This is an arbitrary selection to determine window output level ( hal_comp_window_output_level_t ).
-
hal_comp_input_minus_t
lower_threshold
-
Window comparators lower threshold.
Note
This parameter corresponds to input minus of handle used in second argument (hcomp_lower_threshold) of function HAL_COMP_WINDOW_SetHandle() .
Note
Term “lower” does not imply voltage value must be higher than the other threshold. This is an arbitrary selection to determine window output level ( hal_comp_window_output_level_t ).
-
hal_comp_power_mode_t
power_mode
-
Comparator power mode
-
hal_comp_input_hysteresis_t
input_hysteresis
-
Comparator input hysteresis
-
hal_comp_output_polarity_t
output_polarity
-
Comparator output polarity
-
hal_comp_output_trigger_t
output_trigger
-
Comparator output trigger to system (wake up, CPU)
-
hal_comp_window_output_mode_t
window_output_mode
-
Comparator window output
-
hal_comp_input_plus_t
input
-
struct
hal_comp_handle_s
-
#include <stm32u5xx_hal_comp.h>
COMP Handle Structure Definition.
Public Members
-
hal_comp_t
instance
-
Peripheral instance
-
hal_comp_handle_t
*
p_link_next_handle
-
Pointer to another HAL COMP handle of instance belonging to the same COMP common instance (therefore, sharing common features). Used to access multiple HAL COMP handles (daisy chain: from one to another and circular). Set using function HAL_COMP_WINDOW_SetHandle() .
-
hal_comp_window_instance_t
window_instance
-
Comparators window instance assignation
-
volatile
hal_comp_state_t
global_state
-
Global state
-
const
void
*
p_user_data
-
User data pointer
-
hal_comp_cb_t
p_output_trigger_cb
-
COMP output trigger callback
-
uint32_t
exti_line
-
EXTI line (needed for event and IT operation) on LL driver format
-
hal_comp_output_trigger_t
output_trigger
-
Comparator output trigger configured
-
hal_comp_t
instance
-
typedef
struct
hal_comp_handle_s
hal_comp_handle_t
- group COMP_Exported_Types
-
Typedefs
-
typedef
struct
hal_comp_handle_s
hal_comp_handle_t
-
COMP handle type definition
-
typedef
void
(
*
hal_comp_cb_t
)
(
hal_comp_handle_t
*
hcomp
)
-
pointer to COMP callback functions
Enums
-
enum
hal_comp_t
-
HAL COMP instance.
Values:
-
enumerator
HAL_COMP1
-
enumerator
HAL_COMP1
-
enum
hal_comp_state_t
-
COMP Global state.
Values:
-
enumerator
HAL_COMP_STATE_RESET
-
HAL Comparator handle not yet initialized
-
enumerator
HAL_COMP_STATE_INIT
-
HAL Comparator handle initialized but comparator not yet configured
-
enumerator
HAL_COMP_STATE_IDLE
-
Comparator configured
-
enumerator
HAL_COMP_STATE_ACTIVE
-
Comparator operating
-
enumerator
HAL_COMP_STATE_LINKED
-
HAL Comparator handle linked to other comparator handle
-
enumerator
HAL_COMP_STATE_RESET
-
enum
hal_comp_power_mode_t
-
HAL COMP power mode.
Note
For the electrical characteristics of comparator power modes (propagation delay, power consumption), refer to device datasheet.
Values:
-
enumerator
HAL_COMP_POWER_MODE_HIGH_SPEED
-
Comparator power mode to high speed Comparator power mode to high speed
-
enumerator
HAL_COMP_POWER_MODE_MEDIUM_SPEED
-
Comparator power mode to medium speed Comparator power mode to medium speed
-
enumerator
HAL_COMP_POWER_MODE_ULTRA_LOW_POWER
-
Comparator power mode to ultra-low power Comparator power mode to ultra-low power
-
enumerator
HAL_COMP_POWER_MODE_HIGH_SPEED
-
enum
hal_comp_input_plus_t
-
HAL COMP input plus.
Values:
-
enumerator
HAL_COMP_INPUT_PLUS_IO1
-
Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INP1”) Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INP1”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO2
-
Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INP2”) Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INP2”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO3
-
Comparator input plus connected to IO3 (for GPIO mapping, refer to datasheet parameters “COMPx_INP3”) Comparator input plus connected to IO3 (for GPIO mapping, refer to datasheet parameters “COMPx_INP3”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO4
¶
-
Comparator input plus connected to IO4 (for GPIO mapping, refer to datasheet parameters “COMPx_INP4”) Comparator input plus connected to IO4 (for GPIO mapping, refer to datasheet parameters “COMPx_INP4”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO5
¶
-
Comparator input plus connected to IO5 (for GPIO mapping, refer to datasheet parameters “COMPx_INP5”) Comparator input plus connected to IO5 (for GPIO mapping, refer to datasheet parameters “COMPx_INP5”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO6
¶
-
Comparator input plus connected to IO6 (for GPIO mapping, refer to datasheet parameters “COMPx_INP6”) Comparator input plus connected to IO6 (for GPIO mapping, refer to datasheet parameters “COMPx_INP6”)
-
enumerator
HAL_COMP_INPUT_PLUS_IO1
-
enum
hal_comp_input_minus_t
-
HAL COMP input minus.
Values:
-
enumerator
HAL_COMP_INPUT_MINUS_VREFINT
-
Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_1_4VREFINT
-
Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_1_2VREFINT
-
Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_3_4VREFINT
-
Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to datasheet). Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to datasheet)
-
enumerator
HAL_COMP_INPUT_MINUS_IO1
-
Comparator input plus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INM1”) Comparator input minus connected to IO1 (for GPIO mapping, refer to datasheet parameters “COMPx_INM1”)
-
enumerator
HAL_COMP_INPUT_MINUS_IO2
-
Comparator input plus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INM2”) Comparator input minus connected to IO2 (for GPIO mapping, refer to datasheet parameters “COMPx_INM2”)
-
enumerator
HAL_COMP_INPUT_MINUS_DAC1_CH1
-
Comparator input minus connected to DAC1 channel 1 Comparator input minus connected to DAC1 channel 1
-
enumerator
HAL_COMP_INPUT_MINUS_DAC1_CH2
-
Comparator input minus connected to DAC1 channel 2 Comparator input minus connected to DAC1 channel 2
-
enumerator
HAL_COMP_INPUT_MINUS_VREFINT
-
enum
hal_comp_input_hysteresis_t
-
HAL COMP input hysteresis.
Note
Hysteresis applied to input plus, subtracted to input voltage value.
Note
For the electrical characteristics of comparator hysteresis (voltage amplitude), refer to device datasheet.
Values:
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_NONE
-
No hysteresis Comparator input without hysteresis
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_LOW
-
Hysteresis level low Comparator input hysteresis level low
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_MEDIUM
-
Hysteresis level medium Comparator input hysteresis level medium
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_HIGH
-
Hysteresis level high Comparator input hysteresis level high
-
enumerator
HAL_COMP_INPUT_HYSTERESIS_NONE
-
enum
hal_comp_output_polarity_t
-
HAL COMP output polarity.
Values:
-
enumerator
HAL_COMP_OUTPUT_POLARITY_NONINVERTED
-
Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus
-
enumerator
HAL_COMP_OUTPUT_POLARITY_INVERTED
-
Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus
-
enumerator
HAL_COMP_OUTPUT_POLARITY_NONINVERTED
-
enum
hal_comp_output_blank_t
-
HAL COMP output blanking.
Values:
-
enumerator
HAL_COMP_OUTPUT_BLANK_NONE
-
Comparator output without blanking Comparator output without blanking
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM1_OC5
-
Comparator output blanking source TIM1 OC5 (specific to comparator instance: COMP1) Comparator output blanking source TIM1 OC5 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM2_OC3
-
Comparator output blanking source TIM2 OC3 (specific to comparator instance: COMP1) Comparator output blanking source TIM2 OC3 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM3_OC3
-
Comparator output blanking source TIM3 OC3 (specific to comparator instance: COMP1) Comparator output blanking source TIM3 OC3 (specific to comparator instance: COMP1)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM3_OC4
-
Comparator output blanking source TIM3 OC4 (specific to comparator instance: COMP2) Comparator output blanking source TIM3 OC4 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM8_OC5
-
Comparator output blanking source TIM8 OC5 (specific to comparator instance: COMP2) Comparator output blanking source TIM8 OC5 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_TIM15_OC1
-
Comparator output blanking source TIM15 OC1 (specific to comparator instance: COMP2) Comparator output blanking source TIM15 OC1 (specific to comparator instance: COMP2)
-
enumerator
HAL_COMP_OUTPUT_BLANK_NONE
-
enum
hal_comp_output_trigger_t
-
HAL COMP output trigger to system.
Note
When output set to generate a trigger, impact depends on programming model used:
-
with HAL_COMP_Start() : generates a system wake-up event and a CPU event
-
with HAL_COMP_Start_IT() : generates a system wake-up event and a CPU interruption
Values:
-
enumerator
HAL_COMP_OUTPUT_TRIG_NONE
-
No Trigger Mode Comparator output does not generate a trigger
-
enumerator
HAL_COMP_OUTPUT_TRIG_RISING
-
Trigger Rising Mode Comparator output generates a trigger event to system on rising edge
-
enumerator
HAL_COMP_OUTPUT_TRIG_FALLING
-
Trigger Falling Mode Comparator output generates a trigger event to system on falling edge
-
enumerator
HAL_COMP_OUTPUT_TRIG_RISING_FALLING
-
Trigger Rising & Falling Mode Comparator output generates a trigger event to system on both rising and falling edges
-
-
enum
hal_comp_lock_status_t
-
HAL COMP lock state.
Values:
-
enumerator
HAL_COMP_LOCK_DISABLED
-
Comparator not locked
-
enumerator
HAL_COMP_LOCK_ENABLED
-
Comparator locked
-
enumerator
HAL_COMP_LOCK_DISABLED
-
enum
hal_comp_output_level_t
-
HAL COMP output level.
Note
Comparator output level depends on inputs voltages and output polarity.
Values:
-
enumerator
HAL_COMP_OUTPUT_LEVEL_LOW
-
Comparator output level low (with polarity not inverted) Comparator output logical level low
-
enumerator
HAL_COMP_OUTPUT_LEVEL_HIGH
-
Comparator output level high (with polarity not inverted) Comparator output logical level high
-
enumerator
HAL_COMP_OUTPUT_LEVEL_LOW
-
struct
hal_comp_config_t
-
#include <stm32u5xx_hal_comp.h>
COMP Global configuration.
Public Members
-
hal_comp_power_mode_t
power_mode
-
Comparator power mode
-
hal_comp_input_plus_t
input_plus
-
Comparator input plus
-
hal_comp_input_minus_t
input_minus
-
Comparator input minus
-
hal_comp_input_hysteresis_t
input_hysteresis
-
Comparator input hysteresis
-
hal_comp_output_polarity_t
output_polarity
-
Comparator output polarity
-
hal_comp_output_trigger_t
output_trigger
-
Comparator output trigger to system (wake up, CPU)
-
hal_comp_power_mode_t
power_mode
-
struct
hal_comp_handle_s
-
#include <stm32u5xx_hal_comp.h>
COMP Handle Structure Definition.
Public Members
-
hal_comp_t
instance
-
Peripheral instance
-
volatile
hal_comp_state_t
global_state
-
Global state
-
const
void
*
p_user_data
-
User data pointer
-
hal_comp_cb_t
p_output_trigger_cb
-
COMP output trigger callback
-
uint32_t
exti_line
-
EXTI line (needed for event and IT operation) on LL driver format
-
hal_comp_output_trigger_t
output_trigger
-
Comparator output trigger configured
-
hal_comp_t
instance
-
typedef
struct
hal_comp_handle_s
hal_comp_handle_t