L4 HAL Drivers

Embed: (wiki syntax)

« Back to documentation index

Configuration of comparator inputs

Configuration of comparator inputs
[COMP Exported Functions]

Functions

__STATIC_INLINE void LL_COMP_ConfigInputs (COMP_TypeDef *COMPx, uint32_t InputInverting, uint32_t InputNonInverting)
 Set COMP inputs inverting and non-inverting.
__STATIC_INLINE void LL_COMP_SetInputNonInverting (COMP_TypeDef *COMPx, uint32_t InputNonInverting)
 Set COMP inputs non-inverting.
__STATIC_INLINE uint32_t LL_COMP_GetInputNonInverting (COMP_TypeDef *COMPx)
 Get COMP input non-inverting.
__STATIC_INLINE void LL_COMP_SetInputInverting (COMP_TypeDef *COMPx, uint32_t InputInverting)
 Set COMP input inverting.
__STATIC_INLINE uint32_t LL_COMP_GetInputInverting (COMP_TypeDef *COMPx)
 Get COMP input inverting.
__STATIC_INLINE void LL_COMP_SetInputHysteresis (COMP_TypeDef *COMPx, uint32_t Hysteresis)
 Set comparator instance hysteresis mode of the inverting input.
__STATIC_INLINE uint32_t LL_COMP_GetInputHysteresis (COMP_TypeDef *COMPx)
 Get comparator instance hysteresis mode of the inverting input.

Function Documentation

__STATIC_INLINE void LL_COMP_ConfigInputs ( COMP_TypeDef *  COMPx,
uint32_t  InputInverting,
uint32_t  InputNonInverting 
)

Set COMP inputs inverting and non-inverting.

Note:
In case of comparator input selected to be connected to IO: IP pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
On STM32L4, scaler bridge is configurable: to optimize power consumption, this function enables the voltage scaler bridge only when required (comparator input based on VrefInt). The scaler bridge is common for all comparator instances, therefore if at least one of the comparator instance is requiring the scaler bridge, it remains enabled. CSR INMSEL LL_COMP_ConfigInputs
CSR INPSEL LL_COMP_ConfigInputs
CSR BRGEN LL_COMP_ConfigInputs
CSR SCALEN LL_COMP_ConfigInputs
Parameters:
COMPxComparator instance
InputInvertingThis parameter can be one of the following values:

  • LL_COMP_INVERTINGINPUT_1_4VREFINT
  • LL_COMP_INVERTINGINPUT_1_2VREFINT
  • LL_COMP_INVERTINGINPUT_3_4VREFINT
  • LL_COMP_INVERTINGINPUT_VREFINT
  • LL_COMP_INVERTINGINPUT_DAC1
  • LL_COMP_INVERTINGINPUT_DAC2
  • LL_COMP_INVERTINGINPUT_IO1
  • LL_COMP_INVERTINGINPUT_IO2
InputNonInvertingThis parameter can be one of the following values:

  • LL_COMP_NONINVERTINGINPUT_IO1
  • LL_COMP_NONINVERTINGINPUT_IO2
Return values:
None

Definition at line 299 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE uint32_t LL_COMP_GetInputHysteresis ( COMP_TypeDef *  COMPx )

Get comparator instance hysteresis mode of the inverting input.

CSR HYST LL_COMP_GetInputHysteresis

Parameters:
COMPxComparator instance
Return values:
Returnedvalue can be one of the following values:

  • LL_COMP_HYSTERESIS_NONE
  • LL_COMP_HYSTERESIS_LOW
  • LL_COMP_HYSTERESIS_MEDIUM
  • LL_COMP_HYSTERESIS_HIGH

Definition at line 419 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE uint32_t LL_COMP_GetInputInverting ( COMP_TypeDef *  COMPx )

Get COMP input inverting.

Note:
In case of comparator input selected to be connected to IO: IP pins are specific to each comparator instance. Refer to description of parameters or to reference manual. CSR INPSEL LL_COMP_GetInputNonInverting
CSR BRGEN LL_COMP_GetInputNonInverting
CSR SCALEN LL_COMP_GetInputNonInverting
Parameters:
COMPxComparator instance
Return values:
Returnedvalue can be one of the following values:

  • LL_COMP_INVERTINGINPUT_1_4VREFINT
  • LL_COMP_INVERTINGINPUT_1_2VREFINT
  • LL_COMP_INVERTINGINPUT_3_4VREFINT
  • LL_COMP_INVERTINGINPUT_VREFINT
  • LL_COMP_INVERTINGINPUT_DAC1
  • LL_COMP_INVERTINGINPUT_DAC2
  • LL_COMP_INVERTINGINPUT_IO1
  • LL_COMP_INVERTINGINPUT_IO2

Definition at line 388 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE uint32_t LL_COMP_GetInputNonInverting ( COMP_TypeDef *  COMPx )

Get COMP input non-inverting.

Note:
In case of comparator input selected to be connected to IO: IP pins are specific to each comparator instance. Refer to description of parameters or to reference manual. CSR INMSEL LL_COMP_GetInputInverting
Parameters:
COMPxComparator instance
Return values:
Returnedvalue can be one of the following values:

  • LL_COMP_NONINVERTINGINPUT_IO1
  • LL_COMP_NONINVERTINGINPUT_IO2

Definition at line 332 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE void LL_COMP_SetInputHysteresis ( COMP_TypeDef *  COMPx,
uint32_t  Hysteresis 
)

Set comparator instance hysteresis mode of the inverting input.

CSR HYST LL_COMP_SetInputHysteresis

Parameters:
COMPxComparator instance
HysteresisThis parameter can be one of the following values:

  • LL_COMP_HYSTERESIS_NONE
  • LL_COMP_HYSTERESIS_LOW
  • LL_COMP_HYSTERESIS_MEDIUM
  • LL_COMP_HYSTERESIS_HIGH
Return values:
None

Definition at line 404 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE void LL_COMP_SetInputInverting ( COMP_TypeDef *  COMPx,
uint32_t  InputInverting 
)

Set COMP input inverting.

Note:
In case of comparator input selected to be connected to IO: IP pins are specific to each comparator instance. Refer to description of parameters or to reference manual.
On STM32L4, scaler bridge is configurable: to optimize power consumption, this function enables the voltage scaler bridge only when required (comparator input based on VrefInt). The scaler bridge is common for all comparator instances, therefore if at least one of the comparator instance is requiring the scaler bridge, it remains enabled. CSR INPSEL LL_COMP_SetInputNonInverting
CSR BRGEN LL_COMP_SetInputNonInverting
CSR SCALEN LL_COMP_SetInputNonInverting
Parameters:
COMPxComparator instance
InputInvertingThis parameter can be one of the following values:

  • LL_COMP_INVERTINGINPUT_1_4VREFINT
  • LL_COMP_INVERTINGINPUT_1_2VREFINT
  • LL_COMP_INVERTINGINPUT_3_4VREFINT
  • LL_COMP_INVERTINGINPUT_VREFINT
  • LL_COMP_INVERTINGINPUT_DAC1
  • LL_COMP_INVERTINGINPUT_DAC2
  • LL_COMP_INVERTINGINPUT_IO1
  • LL_COMP_INVERTINGINPUT_IO2
Return values:
None

Definition at line 364 of file stm32l4xx_ll_comp.h.

__STATIC_INLINE void LL_COMP_SetInputNonInverting ( COMP_TypeDef *  COMPx,
uint32_t  InputNonInverting 
)

Set COMP inputs non-inverting.

Note:
In case of comparator input selected to be connected to IO: IP pins are specific to each comparator instance. Refer to description of parameters or to reference manual. CSR INMSEL LL_COMP_SetInputInverting
Parameters:
COMPxComparator instance
InputNonInvertingThis parameter can be one of the following values:

  • LL_COMP_NONINVERTINGINPUT_IO1
  • LL_COMP_NONINVERTINGINPUT_IO2
Return values:
None

Definition at line 316 of file stm32l4xx_ll_comp.h.