Management functions.
More...
Management functions.
===============================================================================
##### Peripheral Control functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the comparators.
◆ HAL_COMP_GetOutputLevel()
Return the output level (high or low) of the selected comparator. The output level depends on the selected polarity. If the polarity is not inverted:
- Comparator output is low when the input plus is at a lower voltage than the input minus
- Comparator output is high when the input plus is at a higher voltage than the input minus If the polarity is inverted:
- Comparator output is high when the input plus is at a lower voltage than the input minus
- Comparator output is low when the input plus is at a higher voltage than the input minus
- Parameters
-
- Return values
-
| Returns | the selected comparator output level:
- COMP_OUTPUT_LEVEL_LOW
- COMP_OUTPUT_LEVEL_HIGH
|
Definition at line 956 of file stm32l4xx_hal_comp.c.
961 return (uint32_t)(READ_BIT(hcomp->Instance->CSR, COMP_CSR_VALUE)
962 >> COMP_OUTPUT_LEVEL_BITOFFSET_POS);
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_COMP_Lock()
Lock the selected comparator configuration.
- Note
- A system reset is required to unlock the comparator configuration.
-
Locking the comparator from reset state is possible if __HAL_RCC_SYSCFG_CLK_ENABLE() is being called before.
- Parameters
-
- Return values
-
Definition at line 895 of file stm32l4xx_hal_comp.c.
897 HAL_StatusTypeDef status =
HAL_OK;
904 else if(__HAL_COMP_IS_LOCKED(hcomp))
931 __HAL_COMP_LOCK(hcomp);
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_COMP_TriggerCallback()