TUKS MCU Introductory course / TUKS-COURSE-THERMOMETER

Fork of TUKS-COURSE-TIMER by TUKS MCU Introductory course

Embed: (wiki syntax)

« Back to documentation index

Operation on comparator instance

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) CSR EN LL_COMP_IsEnabled.
__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.

CSR EN LL_COMP_Disable

Parameters:
COMPxComparator instance
Return values:
None

Definition at line 784 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". CSR EN LL_COMP_Enable
Parameters:
COMPxComparator instance
Return values:
None

Definition at line 773 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) CSR EN LL_COMP_IsEnabled.

Parameters:
COMPxComparator instance
Return values:
Stateof bit (1 or 0).

Definition at line 796 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. CSR LOCK LL_COMP_IsLocked
Parameters:
COMPxComparator instance
Return values:
Stateof bit (1 or 0).

Definition at line 823 of file stm32l4xx_ll_comp.h.

__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. CSR LOCK LL_COMP_Lock
Parameters:
COMPxComparator instance
Return values:
None

Definition at line 809 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 CSR VALUE LL_COMP_ReadOutputLevel
Parameters:
COMPxComparator instance
Return values:
Returnedvalue can be one of the following values:

  • LL_COMP_OUTPUT_LEVEL_LOW
  • LL_COMP_OUTPUT_LEVEL_HIGH

Definition at line 848 of file stm32l4xx_ll_comp.h.