HAL COMP Functions ¶
Initialization and de-initialization functions ¶
- group COMP_Exported_Functions_Group1
-
Set of functions allowing to initialize and deinitialize the COMPx peripheral:
-
HAL_COMP_Init() : associate HAL COMP handle with selected COMP instance,
-
HAL_COMP_DeInit() : restore the default configuration of the HAL COMP handle,
-
HAL_COMP_WINDOW_SetHandle() : link HAL COMP handles sharing common features (window mode).
Functions
-
hal_status_t
HAL_COMP_Init
(
hal_comp_handle_t
*
hcomp
,
hal_comp_t
instance
)
¶
-
Initialize HAL COMP handle and associate it to the selected COMP instance.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
instance – COMP instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter
-
HAL_ERROR – HAL COMP handle is already initialized and can not be modified.
-
HAL_OK – HAL COMP handle has been correctly initialized.
-
-
void
HAL_COMP_DeInit
(
hal_comp_handle_t
*
hcomp
)
¶
-
Deinitialize the COMP peripheral.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
hal_status_t
HAL_COMP_WINDOW_SetHandle
(
hal_comp_handle_t
*
hcomp_upper
,
hal_comp_handle_t
*
hcomp_lower
)
¶
-
Link HAL COMP handles sharing common features (window mode).
Note
Link can be performed even if not using the common features. It is recommended to systematically link handles (when compliant instances): this allows functions to perform all cross instances checks possible, for optimal HAL COMP driver usage.
Note
Links are used to access multiple HAL COMP handles (daisy chain: from one to another and circular). Used by functions configuring parameters impacting multiple COMP instances.
Note
A handle can be removed from a chain using function HAL_COMP_DeInit() .
Warning
Requirement: the selected device must have at least 2 COMP instances sharing the same COMP common instance. Refer to device reference manual of COMP LL driver macro “LL_COMP_COMMON_INSTANCE()” returning COMP common instance from COMP instance.
- Parameters :
-
-
hcomp_upper – Pointer to hal_comp_handle_t structure of a COMP instance (not yet linked or already linked to a chain).
-
hcomp_lower – Pointer to hal_comp_handle_t structure of another COMP instance sharing common features (not yet linked: to be added to an existing chain).
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
- group COMP_Exported_Functions_Group1
-
Set of functions allowing to initialize and deinitialize the COMPx peripheral:
-
HAL_COMP_Init() : associate HAL COMP handle with selected COMP instance,
-
HAL_COMP_DeInit() : restore the default configuration of the HAL COMP handle,
-
HAL_COMP_WINDOW_SetHandle() : link HAL COMP handles sharing common features (window mode).
Functions
-
hal_status_t
HAL_COMP_Init
(
hal_comp_handle_t
*
hcomp
,
hal_comp_t
instance
)
-
Initialize HAL COMP handle and associate it to the selected COMP instance.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
instance – COMP instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter
-
HAL_ERROR – HAL COMP handle is already initialized and can not be modified.
-
HAL_OK – HAL COMP handle has been correctly initialized.
-
-
void
HAL_COMP_DeInit
(
hal_comp_handle_t
*
hcomp
)
-
Deinitialize the COMP peripheral.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
hal_status_t
HAL_COMP_WINDOW_SetHandle
(
hal_comp_handle_t
*
hcomp_upper
,
hal_comp_handle_t
*
hcomp_lower
)
-
Link HAL COMP handles sharing common features (window mode).
Note
Link can be performed even if not using the common features. It is recommended to systematically link handles (when compliant instances): this allows functions to perform all cross instances checks possible, for optimal HAL COMP driver usage.
Note
Links are used to access multiple HAL COMP handles (daisy chain: from one to another and circular). Used by functions configuring parameters impacting multiple COMP instances.
Note
A handle can be removed from a chain using function HAL_COMP_DeInit() .
Warning
Requirement: the selected device must have at least 2 COMP instances sharing the same COMP common instance. Refer to device reference manual of COMP LL driver macro “LL_COMP_COMMON_INSTANCE()” returning COMP common instance from COMP instance.
- Parameters :
-
-
hcomp_upper – Pointer to hal_comp_handle_t structure of a COMP instance (not yet linked or already linked to a chain).
-
hcomp_lower – Pointer to hal_comp_handle_t structure of another COMP instance sharing common features (not yet linked: to be added to an existing chain).
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
- group COMP_Exported_Functions_Group1
-
Set of functions allowing to initialize and deinitialize the COMPx peripheral:
-
HAL_COMP_Init() : associate HAL COMP handle with selected COMP instance,
-
HAL_COMP_DeInit() : restore the default configuration of the HAL COMP handle,
-
HAL_COMP_WINDOW_SetHandle(): link HAL COMP handles sharing common features (window mode).
Functions
-
hal_status_t
HAL_COMP_Init
(
hal_comp_handle_t
*
hcomp
,
hal_comp_t
instance
)
-
Initialize HAL COMP handle and associate it to the selected COMP instance.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
instance – COMP instance.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter
-
HAL_ERROR – HAL COMP handle is already initialized and can not be modified.
-
HAL_OK – HAL COMP handle has been correctly initialized.
-
-
void
HAL_COMP_DeInit
(
hal_comp_handle_t
*
hcomp
)
-
Deinitialize the COMP peripheral.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
Configuration functions ¶
- group COMP_Exported_Functions_Group2
-
Set of functions allowing to configure COMPx peripheral:
-
HAL_COMP_SetConfig() : Configure comparator.
-
HAL_COMP_GetConfig() : Get comparator configuration.
-
HAL_COMP_SetInputPlus() : Unitary configuration: Set comparator input plus configuration.
-
HAL_COMP_GetInputPlus() : Unitary configuration: Get comparator input plus configuration.
-
HAL_COMP_SetInputMinus() : Unitary configuration: Set comparator input minus configuration.
-
HAL_COMP_GetInputMinus() : Unitary configuration: Get comparator input minus configuration.
-
HAL_COMP_SetOutputBlanking() : Unitary configuration: Set comparator output blanking (optional).
-
HAL_COMP_GetOutputBlanking() : Unitary configuration: Get comparator output blanking (optional).
-
HAL_COMP_WINDOW_SetConfig() : Configure comparators in window mode.
-
HAL_COMP_WINDOW_GetConfig() : Get window comparators configuration.
-
HAL_COMP_WINDOW_SetInput() : Unitary configuration: Set window comparators input plus configuration (common to both comparator instances)
-
HAL_COMP_WINDOW_GetInput() : Unitary configuration: Get window comparators input plus configuration (common to both comparator instances)
-
HAL_COMP_WINDOW_SetUpperThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to upper threshold)
-
HAL_COMP_WINDOW_GetUpperThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to upper threshold)
-
HAL_COMP_WINDOW_SetLowerThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to lower threshold)
-
HAL_COMP_WINDOW_GetLowerThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to lower threshold)
-
HAL_COMP_WINDOW_SetOutputBlanking() : Unitary configuration: Set window comparators output blanking (optional).
-
HAL_COMP_WINDOW_GetOutputBlanking() : Unitary configuration: Get window comparators output blanking (optional).
Functions
-
hal_status_t
HAL_COMP_SetConfig
(
hal_comp_handle_t
*
hcomp
,
const
hal_comp_config_t
*
p_config
)
¶
-
Configure comparator.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_config_t structure containing COMP configuration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
void
HAL_COMP_GetConfig
(
const
hal_comp_handle_t
*
hcomp
,
hal_comp_config_t
*
p_config
)
¶
-
Get comparator configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_config_t structure containing the COMP configuration.
-
-
hal_status_t
HAL_COMP_SetInputPlus
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_plus_t
input_plus
)
¶
-
Set comparator input plus configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input_plus – Value of hal_comp_input_plus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_plus_t
HAL_COMP_GetInputPlus
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Get comparator input plus configuration.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_plus_t – Comparator input plus value.
-
hal_status_t
HAL_COMP_SetInputMinus
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
input_minus
)
¶
-
Set comparator input minus configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input_minus – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_GetInputMinus
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Get comparator input minus configuration.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Comparator input minus value.
-
hal_status_t
HAL_COMP_SetOutputBlanking
(
hal_comp_handle_t
*
hcomp
,
hal_comp_output_blank_t
output_blank
)
¶
-
Set comparator output blanking.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
output_blank – Value of hal_comp_output_blank_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_output_blank_t
HAL_COMP_GetOutputBlanking
(
hal_comp_handle_t
*
hcomp
)
¶
-
Get comparator output blanking.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_output_blank_t – Comparator output blanking value.
-
hal_status_t
HAL_COMP_WINDOW_SetConfig
(
hal_comp_handle_t
*
hcomp
,
const
hal_comp_window_config_t
*
p_config
)
¶
-
Configure comparators in window mode.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_window_config_t structure containing COMP configuration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
void
HAL_COMP_WINDOW_GetConfig
(
const
hal_comp_handle_t
*
hcomp
,
hal_comp_window_config_t
*
p_config
)
¶
-
Get window comparators configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_window_config_t structure containing COMP configuration.
-
-
hal_status_t
HAL_COMP_WINDOW_SetInput
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_plus_t
input
)
¶
-
Set window comparators input plus configuration (common to both comparator instances).
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input – Value of hal_comp_input_plus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_plus_t
HAL_COMP_WINDOW_GetInput
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Get window comparators input plus configuration (common to both comparator instances).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_plus_t – Window comparators input plus value.
-
hal_status_t
HAL_COMP_WINDOW_SetUpperThreshold
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
upper_threshold
)
¶
-
Set window comparators input minus configuration (for comparator instance assigned to upper threshold).
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
upper_threshold – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_WINDOW_GetUpperThreshold
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Get window comparators input minus configuration (for comparator instance assigned to upper threshold).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Window comparators input minus value.
-
hal_status_t
HAL_COMP_WINDOW_SetLowerThreshold
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
lower_threshold
)
¶
-
Set window comparators input minus configuration (for comparator instance assigned to lower threshold).
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
lower_threshold – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_WINDOW_GetLowerThreshold
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Get window comparators input minus configuration (for comparator instance assigned to lower threshold).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Window comparators input minus value.
-
hal_status_t
HAL_COMP_WINDOW_SetOutputBlanking
(
hal_comp_handle_t
*
hcomp
,
hal_comp_output_blank_t
output_blank
)
¶
-
Set window comparators output blanking.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
output_blank – Value of hal_comp_output_blank_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_output_blank_t
HAL_COMP_WINDOW_GetOutputBlanking
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Get window comparators output blanking.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_output_blank_t – Window comparators output blanking value.
-
- group COMP_Exported_Functions_Group2
-
Set of functions allowing to configure COMPx peripheral:
-
HAL_COMP_SetConfig() : Configure comparator.
-
HAL_COMP_GetConfig() : Get comparator configuration.
-
HAL_COMP_SetInputPlus() : Unitary configuration: Set comparator input plus configuration.
-
HAL_COMP_GetInputPlus() : Unitary configuration: Get comparator input plus configuration.
-
HAL_COMP_SetInputMinus() : Unitary configuration: Set comparator input minus configuration.
-
HAL_COMP_GetInputMinus() : Unitary configuration: Get comparator input minus configuration.
-
HAL_COMP_SetOutputBlanking() : Unitary configuration: Set comparator output blanking (optional).
-
HAL_COMP_GetOutputBlanking() : Unitary configuration: Get comparator output blanking (optional).
-
HAL_COMP_WINDOW_SetConfig() : Configure comparators in window mode.
-
HAL_COMP_WINDOW_GetConfig() : Get window comparators configuration.
-
HAL_COMP_WINDOW_SetInput() : Unitary configuration: Set window comparators input plus configuration (common to both comparator instances)
-
HAL_COMP_WINDOW_GetInput() : Unitary configuration: Get window comparators input plus configuration (common to both comparator instances)
-
HAL_COMP_WINDOW_SetUpperThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to upper threshold)
-
HAL_COMP_WINDOW_GetUpperThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to upper threshold)
-
HAL_COMP_WINDOW_SetLowerThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to lower threshold)
-
HAL_COMP_WINDOW_GetLowerThreshold() : Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to lower threshold)
-
HAL_COMP_WINDOW_SetOutputBlanking() : Unitary configuration: Set window comparators output blanking (optional).
-
HAL_COMP_WINDOW_GetOutputBlanking() : Unitary configuration: Get window comparators output blanking (optional).
Functions
-
hal_status_t
HAL_COMP_SetConfig
(
hal_comp_handle_t
*
hcomp
,
const
hal_comp_config_t
*
p_config
)
-
Configure comparator.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_config_t structure containing COMP configuration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
void
HAL_COMP_GetConfig
(
const
hal_comp_handle_t
*
hcomp
,
hal_comp_config_t
*
p_config
)
-
Get comparator configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_config_t structure containing the COMP configuration.
-
-
hal_status_t
HAL_COMP_SetInputPlus
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_plus_t
input_plus
)
-
Set comparator input plus configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input_plus – Value of hal_comp_input_plus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_plus_t
HAL_COMP_GetInputPlus
(
const
hal_comp_handle_t
*
hcomp
)
-
Get comparator input plus configuration.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_plus_t – Comparator input plus value.
-
hal_status_t
HAL_COMP_SetInputMinus
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
input_minus
)
-
Set comparator input minus configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input_minus – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_GetInputMinus
(
const
hal_comp_handle_t
*
hcomp
)
-
Get comparator input minus configuration.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Comparator input minus value.
-
hal_status_t
HAL_COMP_SetOutputBlanking
(
hal_comp_handle_t
*
hcomp
,
hal_comp_output_blank_t
output_blank
)
-
Set comparator output blanking.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
output_blank – Value of hal_comp_output_blank_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_output_blank_t
HAL_COMP_GetOutputBlanking
(
hal_comp_handle_t
*
hcomp
)
-
Get comparator output blanking.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_output_blank_t – Comparator output blanking value.
-
hal_status_t
HAL_COMP_WINDOW_SetConfig
(
hal_comp_handle_t
*
hcomp
,
const
hal_comp_window_config_t
*
p_config
)
-
Configure comparators in window mode.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_window_config_t structure containing COMP configuration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
void
HAL_COMP_WINDOW_GetConfig
(
const
hal_comp_handle_t
*
hcomp
,
hal_comp_window_config_t
*
p_config
)
-
Get window comparators configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_window_config_t structure containing COMP configuration.
-
-
hal_status_t
HAL_COMP_WINDOW_SetInput
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_plus_t
input
)
-
Set window comparators input plus configuration (common to both comparator instances).
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input – Value of hal_comp_input_plus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_plus_t
HAL_COMP_WINDOW_GetInput
(
const
hal_comp_handle_t
*
hcomp
)
-
Get window comparators input plus configuration (common to both comparator instances).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_plus_t – Window comparators input plus value.
-
hal_status_t
HAL_COMP_WINDOW_SetUpperThreshold
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
upper_threshold
)
-
Set window comparators input minus configuration (for comparator instance assigned to upper threshold).
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
upper_threshold – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_WINDOW_GetUpperThreshold
(
const
hal_comp_handle_t
*
hcomp
)
-
Get window comparators input minus configuration (for comparator instance assigned to upper threshold).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Window comparators input minus value.
-
hal_status_t
HAL_COMP_WINDOW_SetLowerThreshold
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
lower_threshold
)
-
Set window comparators input minus configuration (for comparator instance assigned to lower threshold).
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
lower_threshold – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_WINDOW_GetLowerThreshold
(
const
hal_comp_handle_t
*
hcomp
)
-
Get window comparators input minus configuration (for comparator instance assigned to lower threshold).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Window comparators input minus value.
-
hal_status_t
HAL_COMP_WINDOW_SetOutputBlanking
(
hal_comp_handle_t
*
hcomp
,
hal_comp_output_blank_t
output_blank
)
-
Set window comparators output blanking.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
output_blank – Value of hal_comp_output_blank_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_output_blank_t
HAL_COMP_WINDOW_GetOutputBlanking
(
const
hal_comp_handle_t
*
hcomp
)
-
Get window comparators output blanking.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_output_blank_t – Window comparators output blanking value.
-
- group COMP_Exported_Functions_Group2
-
Set of functions allowing to configure COMPx peripheral:
-
HAL_COMP_SetConfig() : Configure comparator.
-
HAL_COMP_GetConfig() : Get comparator configuration.
-
HAL_COMP_SetInputPlus() : Unitary configuration: Set comparator input plus configuration.
-
HAL_COMP_GetInputPlus() : Unitary configuration: Get comparator input plus configuration.
-
HAL_COMP_SetInputMinus() : Unitary configuration: Set comparator input minus configuration.
-
HAL_COMP_GetInputMinus() : Unitary configuration: Get comparator input minus configuration.
-
HAL_COMP_SetOutputBlanking() : Unitary configuration: Set comparator output blanking (optional).
-
HAL_COMP_GetOutputBlanking() : Unitary configuration: Get comparator output blanking (optional).
-
HAL_COMP_WINDOW_SetConfig(): Configure comparators in window mode.
-
HAL_COMP_WINDOW_GetConfig(): Get window comparators configuration.
-
HAL_COMP_WINDOW_SetInput(): Unitary configuration: Set window comparators input plus configuration (common to both comparator instances)
-
HAL_COMP_WINDOW_GetInput(): Unitary configuration: Get window comparators input plus configuration (common to both comparator instances)
-
HAL_COMP_WINDOW_SetUpperThreshold(): Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to upper threshold)
-
HAL_COMP_WINDOW_GetUpperThreshold(): Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to upper threshold)
-
HAL_COMP_WINDOW_SetLowerThreshold(): Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to lower threshold)
-
HAL_COMP_WINDOW_GetLowerThreshold(): Unitary configuration: Set window comparators input minus configuration (for comparator instance assigned to lower threshold)
-
HAL_COMP_WINDOW_SetOutputBlanking(): Unitary configuration: Set window comparators output blanking (optional).
-
HAL_COMP_WINDOW_GetOutputBlanking(): Unitary configuration: Get window comparators output blanking (optional).
Functions
-
hal_status_t
HAL_COMP_SetConfig
(
hal_comp_handle_t
*
hcomp
,
const
hal_comp_config_t
*
p_config
)
-
Configure comparator.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_config_t structure containing COMP configuration.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter.
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
void
HAL_COMP_GetConfig
(
const
hal_comp_handle_t
*
hcomp
,
hal_comp_config_t
*
p_config
)
-
Get comparator configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_config – Pointer to a hal_comp_config_t structure containing the COMP configuration.
-
-
hal_status_t
HAL_COMP_SetInputPlus
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_plus_t
input_plus
)
-
Set comparator input plus configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input_plus – Value of hal_comp_input_plus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_plus_t
HAL_COMP_GetInputPlus
(
const
hal_comp_handle_t
*
hcomp
)
-
Get comparator input plus configuration.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_plus_t – Comparator input plus value.
-
hal_status_t
HAL_COMP_SetInputMinus
(
hal_comp_handle_t
*
hcomp
,
hal_comp_input_minus_t
input_minus
)
-
Set comparator input minus configuration.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
input_minus – Value of hal_comp_input_minus_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_input_minus_t
HAL_COMP_GetInputMinus
(
const
hal_comp_handle_t
*
hcomp
)
-
Get comparator input minus configuration.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_input_minus_t – Comparator input minus value.
-
hal_status_t
HAL_COMP_SetOutputBlanking
(
hal_comp_handle_t
*
hcomp
,
hal_comp_output_blank_t
output_blank
)
-
Set comparator output blanking.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
output_blank – Value of hal_comp_output_blank_t .
-
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_output_blank_t
HAL_COMP_GetOutputBlanking
(
hal_comp_handle_t
*
hcomp
)
-
Get comparator output blanking.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_output_blank_t – Comparator output blanking value.
-
IRQHandler and Callbacks functions ¶
- group COMP_Exported_Functions_Group3
-
Set of function to handle the COMP interruptions :
-
HAL_COMP_IRQHandler() : Handle all COMP interrupt requests.
Functions
-
void
HAL_COMP_IRQHandler
(
hal_comp_handle_t
*
hcomp
)
¶
-
Handle the COMP interrupt request.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
void
HAL_COMP_OutputTriggerCallback
(
hal_comp_handle_t
*
hcomp
)
¶
-
Event callback.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure
-
hal_status_t
HAL_COMP_RegisterOutputTriggerCallback
(
hal_comp_handle_t
*
hcomp
,
hal_comp_cb_t
p_callback
)
¶
-
Register the COMP output trigger callback to be used instead of the weak HAL_COMP_OutputTriggerCallback() predefined callback.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_callback – Pointer to the hal_comp_cb_t Comparator trigger callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
- group COMP_Exported_Functions_Group3
-
Set of function to handle the COMP interruptions :
-
HAL_COMP_IRQHandler() : Handle all COMP interrupt requests.
Functions
-
void
HAL_COMP_IRQHandler
(
hal_comp_handle_t
*
hcomp
)
-
Handle the COMP interrupt request.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
void
HAL_COMP_OutputTriggerCallback
(
hal_comp_handle_t
*
hcomp
)
-
Event callback.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure
-
hal_status_t
HAL_COMP_RegisterOutputTriggerCallback
(
hal_comp_handle_t
*
hcomp
,
hal_comp_cb_t
p_callback
)
-
Register the COMP output trigger callback to be used instead of the weak HAL_COMP_OutputTriggerCallback() predefined callback.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_callback – Pointer to the hal_comp_cb_t Comparator trigger callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
- group COMP_Exported_Functions_Group3
-
Set of function to handle the COMP interruptions :
-
HAL_COMP_IRQHandler() : Handle all COMP interrupt requests.
Functions
-
void
HAL_COMP_IRQHandler
(
hal_comp_handle_t
*
hcomp
)
-
Handle the COMP interrupt request.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
void
HAL_COMP_OutputTriggerCallback
(
hal_comp_handle_t
*
hcomp
)
-
Event callback.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure
-
hal_status_t
HAL_COMP_RegisterOutputTriggerCallback
(
hal_comp_handle_t
*
hcomp
,
hal_comp_cb_t
p_callback
)
-
Register the COMP output trigger callback to be used instead of the weak HAL_COMP_OutputTriggerCallback() predefined callback.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t structure.
-
p_callback – Pointer to the hal_comp_cb_t Comparator trigger callback function.
-
- Return values :
-
-
HAL_INVALID_PARAM – Invalid parameter
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
Peripheral State, Error functions ¶
- group COMP_Exported_Functions_Group4
-
Set of function to handle the HAL COMP driver state and errors:
-
HAL_COMP_GetState() : Retrieve the HAL COMP global state,
-
HAL_COMP_GetEXTI_Handle(): Retrieve the HAL EXTI handle used by the selected HAL COMP handle.
Functions
-
hal_comp_state_t
HAL_COMP_GetState
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Retrieve the HAL COMP global state.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_state_t – HAL COMP global state.
-
- group COMP_Exported_Functions_Group4
-
Set of function to handle the HAL COMP driver state and errors:
-
HAL_COMP_GetState() : Retrieve the HAL COMP global state,
-
HAL_COMP_GetEXTI_Handle(): Retrieve the HAL EXTI handle used by the selected HAL COMP handle.
Functions
-
hal_comp_state_t
HAL_COMP_GetState
(
const
hal_comp_handle_t
*
hcomp
)
-
Retrieve the HAL COMP global state.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_state_t – HAL COMP global state.
-
- group COMP_Exported_Functions_Group4
-
Set of function to handle the HAL COMP driver state and errors:
-
HAL_COMP_GetState() : Retrieve the HAL COMP global state,
-
HAL_COMP_GetEXTI_Handle(): Retrieve the HAL EXTI handle used by the selected HAL COMP handle.
Functions
-
hal_comp_state_t
HAL_COMP_GetState
(
const
hal_comp_handle_t
*
hcomp
)
-
Retrieve the HAL COMP global state.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
hal_comp_state_t – HAL COMP global state.
-
Process functions ¶
- group COMP_Exported_Functions_Group5
-
Set of functions allowing to operate COMPx peripheral.
-
HAL_COMP_Start() : Start comparator
-
HAL_COMP_Stop() : Stop comparator
-
HAL_COMP_Start_IT() : Start comparator with interruption
-
HAL_COMP_Stop_IT() : Stop comparator with interruption
-
HAL_COMP_Lock() : Lock comparator
-
HAL_COMP_IsLocked() : Check whether comparator is locked
-
HAL_COMP_GetOutputLevel() : Get comparator output logical level
-
HAL_COMP_WINDOW_Start() : Start window comparators
-
HAL_COMP_WINDOW_Stop() : Stop window comparators
-
HAL_COMP_WINDOW_Start_IT() : Start window comparators with interruption
-
HAL_COMP_WINDOW_Stop_IT() : Stop window comparators with interruption
-
HAL_COMP_WINDOW_Lock() : Lock window comparators
-
HAL_COMP_WINDOW_IsLocked() : Check whether window comparators is locked
-
HAL_COMP_WINDOW_GetOutputLevel() : Get window comparators output logical level
Functions
-
hal_status_t
HAL_COMP_Start
(
hal_comp_handle_t
*
hcomp
)
¶
-
Start comparator.
Note
Depending on configuration of output trigger to system ( hal_comp_output_trigger_t ), comparator can generate events to system. Output trigger edge selection is optional (selected parameter can be no trigger).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Stop
(
hal_comp_handle_t
*
hcomp
)
¶
-
Stop comparator.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Start_IT
(
hal_comp_handle_t
*
hcomp
)
¶
-
Start comparator with interruption: default interruptions.
Note
Depending on configuration of output trigger to system hal_comp_output_trigger_t , comparator can generate events and interruption to system. Output trigger edge selection is mandatory (selected parameter must be different of no trigger).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Stop_IT
(
hal_comp_handle_t
*
hcomp
)
¶
-
Stop comparator in interruption mode.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Lock
(
hal_comp_handle_t
*
hcomp
)
¶
-
Lock comparator.
Note
Once locked, comparator configuration cannot be changed (use case: safety purpose).
Note
Comparator can be unlocked with a system reset.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_lock_status_t
HAL_COMP_IsLocked
(
hal_comp_handle_t
*
hcomp
)
¶
-
Check whether comparator is locked.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_lock_status_t .
-
hal_comp_output_level_t
HAL_COMP_GetOutputLevel
(
hal_comp_handle_t
*
hcomp
)
¶
-
Get comparator output logical level.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_output_level_t .
-
hal_status_t
HAL_COMP_WINDOW_Start
(
hal_comp_handle_t
*
hcomp
)
¶
-
Start window comparators.
Depending on configuration of output trigger to system hal_comp_output_trigger_t , comparator can generate events to system.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Stop
(
hal_comp_handle_t
*
hcomp
)
¶
-
Stop window comparators.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Start_IT
(
hal_comp_handle_t
*
hcomp
)
¶
-
Start window comparators with interruption: default interruptions.
Note
Configuration prerequisite: select comparator output trigger ( hal_comp_output_trigger_t ) with setting different of no trigger.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Stop_IT
(
hal_comp_handle_t
*
hcomp
)
¶
-
Stop window comparators in interruption mode.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Lock
(
hal_comp_handle_t
*
hcomp
)
¶
-
Lock window comparators.
Note
Once locked, comparator configuration cannot be changed (use case: safety purpose).
Note
Comparator can be unlocked with a system reset.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_lock_status_t
HAL_COMP_WINDOW_IsLocked
(
hal_comp_handle_t
*
hcomp
)
¶
-
Check whether window comparators are locked.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_lock_status_t .
-
hal_comp_window_output_level_t
HAL_COMP_WINDOW_GetOutputLevel
(
hal_comp_handle_t
*
hcomp
)
¶
-
Get window comparators output logical level.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_window_output_level_t .
-
- group COMP_Exported_Functions_Group5
-
Set of functions allowing to operate COMPx peripheral.
-
HAL_COMP_Start() : Start comparator
-
HAL_COMP_Stop() : Stop comparator
-
HAL_COMP_Start_IT() : Start comparator with interruption
-
HAL_COMP_Stop_IT() : Stop comparator with interruption
-
HAL_COMP_Lock() : Lock comparator
-
HAL_COMP_IsLocked() : Check whether comparator is locked
-
HAL_COMP_GetOutputLevel() : Get comparator output logical level
-
HAL_COMP_WINDOW_Start() : Start window comparators
-
HAL_COMP_WINDOW_Stop() : Stop window comparators
-
HAL_COMP_WINDOW_Start_IT() : Start window comparators with interruption
-
HAL_COMP_WINDOW_Stop_IT() : Stop window comparators with interruption
-
HAL_COMP_WINDOW_Lock() : Lock window comparators
-
HAL_COMP_WINDOW_IsLocked() : Check whether window comparators is locked
-
HAL_COMP_WINDOW_GetOutputLevel() : Get window comparators output logical level
Functions
-
hal_status_t
HAL_COMP_Start
(
hal_comp_handle_t
*
hcomp
)
-
Start comparator.
Note
Depending on configuration of output trigger to system ( hal_comp_output_trigger_t ), comparator can generate events to system. Output trigger edge selection is optional (selected parameter can be no trigger).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Stop
(
hal_comp_handle_t
*
hcomp
)
-
Stop comparator.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Start_IT
(
hal_comp_handle_t
*
hcomp
)
-
Start comparator with interruption: default interruptions.
Note
Depending on configuration of output trigger to system hal_comp_output_trigger_t , comparator can generate events and interruption to system. Output trigger edge selection is mandatory (selected parameter must be different of no trigger).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Stop_IT
(
hal_comp_handle_t
*
hcomp
)
-
Stop comparator in interruption mode.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Lock
(
hal_comp_handle_t
*
hcomp
)
-
Lock comparator.
Note
Once locked, comparator configuration cannot be changed (use case: safety purpose).
Note
Comparator can be unlocked with a system reset.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_lock_status_t
HAL_COMP_IsLocked
(
hal_comp_handle_t
*
hcomp
)
-
Check whether comparator is locked.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_lock_status_t .
-
hal_comp_output_level_t
HAL_COMP_GetOutputLevel
(
hal_comp_handle_t
*
hcomp
)
-
Get comparator output logical level.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_output_level_t .
-
hal_status_t
HAL_COMP_WINDOW_Start
(
hal_comp_handle_t
*
hcomp
)
-
Start window comparators.
Depending on configuration of output trigger to system hal_comp_output_trigger_t , comparator can generate events to system.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Stop
(
hal_comp_handle_t
*
hcomp
)
-
Stop window comparators.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Start_IT
(
hal_comp_handle_t
*
hcomp
)
-
Start window comparators with interruption: default interruptions.
Note
Configuration prerequisite: select comparator output trigger ( hal_comp_output_trigger_t ) with setting different of no trigger.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Stop_IT
(
hal_comp_handle_t
*
hcomp
)
-
Stop window comparators in interruption mode.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_WINDOW_Lock
(
hal_comp_handle_t
*
hcomp
)
-
Lock window comparators.
Note
Once locked, comparator configuration cannot be changed (use case: safety purpose).
Note
Comparator can be unlocked with a system reset.
- Parameters :
-
hcomp – Pointer to a HAL_COMP_WINDOW_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_lock_status_t
HAL_COMP_WINDOW_IsLocked
(
hal_comp_handle_t
*
hcomp
)
-
Check whether window comparators are locked.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_lock_status_t .
-
hal_comp_window_output_level_t
HAL_COMP_WINDOW_GetOutputLevel
(
hal_comp_handle_t
*
hcomp
)
-
Get window comparators output logical level.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_window_output_level_t .
-
- group COMP_Exported_Functions_Group5
-
Set of functions allowing to operate COMPx peripheral.
-
HAL_COMP_Start() : Start comparator
-
HAL_COMP_Stop() : Stop comparator
-
HAL_COMP_Start_IT() : Start comparator with interruption
-
HAL_COMP_Stop_IT() : Stop comparator with interruption
-
HAL_COMP_Lock() : Lock comparator
-
HAL_COMP_IsLocked() : Check whether comparator is locked
-
HAL_COMP_GetOutputLevel() : Get comparator output logical level
-
HAL_COMP_WINDOW_Start(): Start window comparators
-
HAL_COMP_WINDOW_Stop(): Stop window comparators
-
HAL_COMP_WINDOW_Start_IT(): Start window comparators with interruption
-
HAL_COMP_WINDOW_Stop_IT(): Stop window comparators with interruption
-
HAL_COMP_WINDOW_Lock(): Lock window comparators
-
HAL_COMP_WINDOW_IsLocked(): Check whether window comparators is locked
-
HAL_COMP_WINDOW_GetOutputLevel(): Get window comparators output logical level
Functions
-
hal_status_t
HAL_COMP_Start
(
hal_comp_handle_t
*
hcomp
)
-
Start comparator.
Note
Depending on configuration of output trigger to system ( hal_comp_output_trigger_t ), comparator can generate events to system. Output trigger edge selection is optional (selected parameter can be no trigger).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Stop
(
hal_comp_handle_t
*
hcomp
)
-
Stop comparator.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Start_IT
(
hal_comp_handle_t
*
hcomp
)
-
Start comparator with interruption: default interruptions.
Note
Depending on configuration of output trigger to system hal_comp_output_trigger_t , comparator can generate events and interruption to system. Output trigger edge selection is mandatory (selected parameter must be different of no trigger).
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_BUSY – HAL COMP state machine not in expected initial state
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Stop_IT
(
hal_comp_handle_t
*
hcomp
)
-
Stop comparator in interruption mode.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_status_t
HAL_COMP_Lock
(
hal_comp_handle_t
*
hcomp
)
-
Lock comparator.
Note
Once locked, comparator configuration cannot be changed (use case: safety purpose).
Note
Comparator can be unlocked with a system reset.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
-
HAL_ERROR – Operation completed with error.
-
HAL_OK – Operation completed successfully.
-
-
hal_comp_lock_status_t
HAL_COMP_IsLocked
(
hal_comp_handle_t
*
hcomp
)
-
Check whether comparator is locked.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_lock_status_t .
-
hal_comp_output_level_t
HAL_COMP_GetOutputLevel
(
hal_comp_handle_t
*
hcomp
)
-
Get comparator output logical level.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t structure.
- Return values :
-
Value – of hal_comp_output_level_t .
-
User data functions ¶
- group COMP_Exported_Functions_Group6
-
This subsection provides functions allowing to:
-
HAL_COMP_SetUserData() : Set a user data pointer (ex: a user context) in a HAL COMP handle,
-
HAL_COMP_GetUserData() : Get a user data pointer (ex: a user context) from a HAL COMP handle.
Note
A typical usage is to set user data pointer before starting a process, then retrieve it within the user process completion callback.
Functions
-
void
HAL_COMP_SetUserData
(
hal_comp_handle_t
*
hcomp
,
const
void
*
p_user_data
)
¶
-
Store user data pointer into the comp handle.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t .
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_COMP_GetUserData
(
const
hal_comp_handle_t
*
hcomp
)
¶
-
Retrieve user data pointer from the comp handle.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t .
- Return values :
-
-
(void*) – the pointer to the user data, when previously set by HAL_COMP_SetUserData() .
-
NULL – other way.
-
-
- group COMP_Exported_Functions_Group6
-
This subsection provides functions allowing to:
-
HAL_COMP_SetUserData() : Set a user data pointer (ex: a user context) in a HAL COMP handle,
-
HAL_COMP_GetUserData() : Get a user data pointer (ex: a user context) from a HAL COMP handle.
Note
A typical usage is to set user data pointer before starting a process, then retrieve it within the user process completion callback.
Functions
-
void
HAL_COMP_SetUserData
(
hal_comp_handle_t
*
hcomp
,
const
void
*
p_user_data
)
-
Store user data pointer into the comp handle.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t .
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_COMP_GetUserData
(
const
hal_comp_handle_t
*
hcomp
)
-
Retrieve user data pointer from the comp handle.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t .
- Return values :
-
-
(void*) – the pointer to the user data, when previously set by HAL_COMP_SetUserData() .
-
NULL – other way.
-
-
- group COMP_Exported_Functions_Group6
-
This subsection provides functions allowing to:
-
HAL_COMP_SetUserData() : Set a user data pointer (ex: a user context) in a HAL COMP handle,
-
HAL_COMP_GetUserData() : Get a user data pointer (ex: a user context) from a HAL COMP handle.
Note
A typical usage is to set user data pointer before starting a process, then retrieve it within the user process completion callback.
Functions
-
void
HAL_COMP_SetUserData
(
hal_comp_handle_t
*
hcomp
,
const
void
*
p_user_data
)
-
Store user data pointer into the comp handle.
- Parameters :
-
-
hcomp – Pointer to a hal_comp_handle_t .
-
p_user_data – Pointer to the user data.
-
-
const
void
*
HAL_COMP_GetUserData
(
const
hal_comp_handle_t
*
hcomp
)
-
Retrieve user data pointer from the comp handle.
- Parameters :
-
hcomp – Pointer to a hal_comp_handle_t .
- Return values :
-
-
(void*) – the pointer to the user data, when previously set by HAL_COMP_SetUserData() .
-
NULL – other way.
-
-