STM32L486xx HAL User Manual
Functions
Operation on comparator instance
COMP Exported Functions

Functions

__STATIC_INLINE void LL_COMP_Enable (COMP_TypeDef *COMPx)
 Enable comparator instance.
__STATIC_INLINE void LL_COMP_Disable (COMP_TypeDef *COMPx)
 Disable comparator instance.
__STATIC_INLINE uint32_t LL_COMP_IsEnabled (COMP_TypeDef *COMPx)
 Get comparator enable state (0: COMP is disabled, 1: COMP is enabled)
__STATIC_INLINE void LL_COMP_Lock (COMP_TypeDef *COMPx)
 Lock comparator instance.
__STATIC_INLINE uint32_t LL_COMP_IsLocked (COMP_TypeDef *COMPx)
 Get comparator lock state (0: COMP is unlocked, 1: COMP is locked).
__STATIC_INLINE uint32_t LL_COMP_ReadOutputLevel (COMP_TypeDef *COMPx)
 Read comparator instance output level.

Function Documentation

__STATIC_INLINE void LL_COMP_Disable ( COMP_TypeDef *  COMPx)

Disable comparator instance.

Reference Manual to LL API cross reference:
CSR EN LL_COMP_Disable
Parameters:
COMPxComparator instance
Return values:
None

Definition at line 782 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE void LL_COMP_Enable ( COMP_TypeDef *  COMPx)

Enable comparator instance.

Note:
After enable from off state, comparator requires a delay to reach reach propagation delay specification. Refer to device datasheet, parameter "tSTART".
Reference Manual to LL API cross reference:
CSR EN LL_COMP_Enable
Parameters:
COMPxComparator instance
Return values:
None

Definition at line 771 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE uint32_t LL_COMP_IsEnabled ( COMP_TypeDef *  COMPx)

Get comparator enable state (0: COMP is disabled, 1: COMP is enabled)

Reference Manual to LL API cross reference:
CSR EN LL_COMP_IsEnabled
Parameters:
COMPxComparator instance
Return values:
Stateof bit (1 or 0).

Definition at line 794 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE uint32_t LL_COMP_IsLocked ( COMP_TypeDef *  COMPx)

Get comparator lock state (0: COMP is unlocked, 1: COMP is locked).

Note:
Once locked, comparator configuration can be accessed in read-only.
The only way to unlock the comparator is a device hardware reset.
Reference Manual to LL API cross reference:
CSR LOCK LL_COMP_IsLocked
Parameters:
COMPxComparator instance
Return values:
Stateof bit (1 or 0).

Definition at line 821 of file stm32l4xx_ll_comp.h.

Referenced by LL_COMP_DeInit(), and LL_COMP_Init().

__STATIC_INLINE void LL_COMP_Lock ( COMP_TypeDef *  COMPx)

Lock comparator instance.

Note:
Once locked, comparator configuration can be accessed in read-only.
The only way to unlock the comparator is a device hardware reset.
Reference Manual to LL API cross reference:
CSR LOCK LL_COMP_Lock
Parameters:
COMPxComparator instance
Return values:
None

Definition at line 807 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE uint32_t LL_COMP_ReadOutputLevel ( COMP_TypeDef *  COMPx)

Read comparator instance output level.

Note:
The comparator output level depends on the selected polarity (Refer to function LL_COMP_SetOutputPolarity()). If the comparator 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 comparator 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
Reference Manual to LL API cross reference:
CSR VALUE LL_COMP_ReadOutputLevel
Parameters:
COMPxComparator instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 846 of file stm32l4xx_ll_comp.h.

References LL_COMP_OUTPUT_LEVEL_BITOFFSET_POS.