STM32L4xx_HAL_Driver  1.14.0
Configuration of OPAMP hierarchical scope: OPAMP instance

Functions

__STATIC_INLINE void LL_OPAMP_SetPowerMode (OPAMP_TypeDef *OPAMPx, uint32_t PowerMode)
 Set OPAMP power mode. More...
 
__STATIC_INLINE uint32_t LL_OPAMP_GetPowerMode (OPAMP_TypeDef *OPAMPx)
 Get OPAMP power mode. CSR OPALPM LL_OPAMP_GetPowerMode. More...
 
__STATIC_INLINE void LL_OPAMP_SetMode (OPAMP_TypeDef *OPAMPx, uint32_t Mode)
 Set OPAMP mode calibration or functional. More...
 
__STATIC_INLINE uint32_t LL_OPAMP_GetMode (OPAMP_TypeDef *OPAMPx)
 Get OPAMP mode calibration or functional. More...
 
__STATIC_INLINE void LL_OPAMP_SetFunctionalMode (OPAMP_TypeDef *OPAMPx, uint32_t FunctionalMode)
 Set OPAMP functional mode by setting internal connections. OPAMP operation in standalone, follower, ... More...
 
__STATIC_INLINE uint32_t LL_OPAMP_GetFunctionalMode (OPAMP_TypeDef *OPAMPx)
 Get OPAMP functional mode from setting of internal connections. OPAMP operation in standalone, follower, ... CSR OPAMODE LL_OPAMP_GetFunctionalMode. More...
 
__STATIC_INLINE void LL_OPAMP_SetPGAGain (OPAMP_TypeDef *OPAMPx, uint32_t PGAGain)
 Set OPAMP PGA gain. More...
 
__STATIC_INLINE uint32_t LL_OPAMP_GetPGAGain (OPAMP_TypeDef *OPAMPx)
 Get OPAMP PGA gain. More...
 

Detailed Description

Function Documentation

◆ LL_OPAMP_GetFunctionalMode()

__STATIC_INLINE uint32_t LL_OPAMP_GetFunctionalMode ( OPAMP_TypeDef *  OPAMPx)

Get OPAMP functional mode from setting of internal connections. OPAMP operation in standalone, follower, ... CSR OPAMODE LL_OPAMP_GetFunctionalMode.

Parameters
OPAMPxOPAMP instance
Return values
Returnedvalue can be one of the following values:
  • LL_OPAMP_MODE_STANDALONE
  • LL_OPAMP_MODE_FOLLOWER
  • LL_OPAMP_MODE_PGA

Definition at line 516 of file stm32l4xx_ll_opamp.h.

517 {
518  return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_OPAMODE));
519 }

◆ LL_OPAMP_GetMode()

__STATIC_INLINE uint32_t LL_OPAMP_GetMode ( OPAMP_TypeDef *  OPAMPx)

Get OPAMP mode calibration or functional.

Note
OPAMP mode corresponds to functional or calibration mode:
  • functional mode: OPAMP operation in standalone, follower, ... Set functional mode using function LL_OPAMP_SetFunctionalMode().
  • calibration mode: offset calibration of the selected transistors differential pair NMOS or PMOS. CSR CALON LL_OPAMP_GetMode
Parameters
OPAMPxOPAMP instance
Return values
Returnedvalue can be one of the following values:
  • LL_OPAMP_MODE_FUNCTIONAL
  • LL_OPAMP_MODE_CALIBRATION

Definition at line 480 of file stm32l4xx_ll_opamp.h.

481 {
482  return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_CALON));
483 }

◆ LL_OPAMP_GetPGAGain()

__STATIC_INLINE uint32_t LL_OPAMP_GetPGAGain ( OPAMP_TypeDef *  OPAMPx)

Get OPAMP PGA gain.

Note
Preliminarily, OPAMP must be set in mode PGA using function LL_OPAMP_SetFunctionalMode(). CSR PGGAIN LL_OPAMP_GetPGAGain
Parameters
OPAMPxOPAMP instance
Return values
Returnedvalue can be one of the following values:
  • LL_OPAMP_PGA_GAIN_2
  • LL_OPAMP_PGA_GAIN_4
  • LL_OPAMP_PGA_GAIN_8
  • LL_OPAMP_PGA_GAIN_16

Definition at line 551 of file stm32l4xx_ll_opamp.h.

552 {
553  return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_PGGAIN));
554 }

◆ LL_OPAMP_GetPowerMode()

__STATIC_INLINE uint32_t LL_OPAMP_GetPowerMode ( OPAMP_TypeDef *  OPAMPx)

Get OPAMP power mode. CSR OPALPM LL_OPAMP_GetPowerMode.

Parameters
OPAMPxOPAMP instance
Return values
Returnedvalue can be one of the following values:
  • LL_OPAMP_POWERMODE_NORMAL
  • LL_OPAMP_POWERMODE_LOWPOWER

Definition at line 434 of file stm32l4xx_ll_opamp.h.

435 {
436  register uint32_t power_mode = (READ_BIT(OPAMPx->CSR, OPAMP_CSR_OPALPM));
437 
438  return (uint32_t)(power_mode | (power_mode >> (OPAMP_CSR_OPALPM_Pos)));
439 }

◆ LL_OPAMP_SetFunctionalMode()

__STATIC_INLINE void LL_OPAMP_SetFunctionalMode ( OPAMP_TypeDef *  OPAMPx,
uint32_t  FunctionalMode 
)

Set OPAMP functional mode by setting internal connections. OPAMP operation in standalone, follower, ...

Note
This function reset bit of calibration mode to ensure to be in functional mode, in order to have OPAMP parameters (inputs selection, ...) set with the corresponding OPAMP mode to be effective. CSR OPAMODE LL_OPAMP_SetFunctionalMode
Parameters
OPAMPxOPAMP instance
FunctionalModeThis parameter can be one of the following values:
  • LL_OPAMP_MODE_STANDALONE
  • LL_OPAMP_MODE_FOLLOWER
  • LL_OPAMP_MODE_PGA
Return values
None

Definition at line 500 of file stm32l4xx_ll_opamp.h.

501 {
502  /* Note: Bit OPAMP_CSR_CALON reset to ensure to be in functional mode */
503  MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_OPAMODE | OPAMP_CSR_CALON, FunctionalMode);
504 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_OPAMP_SetMode()

__STATIC_INLINE void LL_OPAMP_SetMode ( OPAMP_TypeDef *  OPAMPx,
uint32_t  Mode 
)

Set OPAMP mode calibration or functional.

Note
OPAMP mode corresponds to functional or calibration mode:
  • functional mode: OPAMP operation in standalone, follower, ... Set functional mode using function LL_OPAMP_SetFunctionalMode().
  • calibration mode: offset calibration of the selected transistors differential pair NMOS or PMOS.
On this STM32 serie, during calibration, OPAMP functional mode must be set to standalone or follower mode (in order to open internal connections to resistors of PGA mode). Refer to function LL_OPAMP_SetFunctionalMode(). CSR CALON LL_OPAMP_SetMode
Parameters
OPAMPxOPAMP instance
ModeThis parameter can be one of the following values:
  • LL_OPAMP_MODE_FUNCTIONAL
  • LL_OPAMP_MODE_CALIBRATION
Return values
None

Definition at line 461 of file stm32l4xx_ll_opamp.h.

462 {
463  MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_CALON, Mode);
464 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_OPAMP_SetPGAGain()

__STATIC_INLINE void LL_OPAMP_SetPGAGain ( OPAMP_TypeDef *  OPAMPx,
uint32_t  PGAGain 
)

Set OPAMP PGA gain.

Note
Preliminarily, OPAMP must be set in mode PGA using function LL_OPAMP_SetFunctionalMode(). CSR PGGAIN LL_OPAMP_SetPGAGain
Parameters
OPAMPxOPAMP instance
PGAGainThis parameter can be one of the following values:
  • LL_OPAMP_PGA_GAIN_2
  • LL_OPAMP_PGA_GAIN_4
  • LL_OPAMP_PGA_GAIN_8
  • LL_OPAMP_PGA_GAIN_16
Return values
None

Definition at line 534 of file stm32l4xx_ll_opamp.h.

535 {
536  MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_PGGAIN, PGAGain);
537 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_OPAMP_SetPowerMode()

__STATIC_INLINE void LL_OPAMP_SetPowerMode ( OPAMP_TypeDef *  OPAMPx,
uint32_t  PowerMode 
)

Set OPAMP power mode.

Note
The OPAMP must be disabled to change this configuration. CSR OPALPM LL_OPAMP_SetPowerMode
Parameters
OPAMPxOPAMP instance
PowerModeThis parameter can be one of the following values:
  • LL_OPAMP_POWERMODE_NORMAL
  • LL_OPAMP_POWERMODE_LOWPOWER
Return values
None

Definition at line 421 of file stm32l4xx_ll_opamp.h.

422 {
423  MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_OPALPM, (PowerMode & OPAMP_POWERMODE_CSR_BIT_MASK));
424 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)