STM32L486xx HAL User Manual
Functions
Initialization/de-initialization functions
COMP Exported Functions

Initialization and de-initialization functions. More...

Functions

HAL_StatusTypeDef HAL_COMP_Init (COMP_HandleTypeDef *hcomp)
 Initialize the COMP according to the specified parameters in the COMP_InitTypeDef and initialize the associated handle.
HAL_StatusTypeDef HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp)
 DeInitialize the COMP peripheral.
__weak void HAL_COMP_MspInit (COMP_HandleTypeDef *hcomp)
 Initialize the COMP MSP.
__weak void HAL_COMP_MspDeInit (COMP_HandleTypeDef *hcomp)
 DeInitialize the COMP MSP.
HAL_StatusTypeDef HAL_COMP_RegisterCallback (COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID, pCOMP_CallbackTypeDef pCallback)
 Register a User COMP Callback To be used instead of the weak predefined callback.
HAL_StatusTypeDef HAL_COMP_UnRegisterCallback (COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID)
 Unregister a COMP Callback COMP callback is redirected to the weak predefined callback.

Detailed Description

Initialization and de-initialization functions.

 ===============================================================================
              ##### Initialization and de-initialization functions #####
 ===============================================================================
    [..]  This section provides functions to initialize and de-initialize comparators 


Function Documentation

HAL_StatusTypeDef HAL_COMP_DeInit ( COMP_HandleTypeDef hcomp)

DeInitialize the COMP peripheral.

Note:
Deinitialization cannot be performed if the COMP configuration is locked. To unlock the configuration, perform a system reset.
Parameters:
hcompCOMP handle
Return values:
HALstatus

Definition at line 474 of file stm32l4xx_hal_comp.c.

References __HAL_COMP_IS_LOCKED, assert_param, HAL_COMP_MspDeInit(), HAL_COMP_STATE_RESET, __COMP_HandleTypeDef::Instance, __COMP_HandleTypeDef::MspDeInitCallback, and __COMP_HandleTypeDef::State.

HAL_StatusTypeDef HAL_COMP_Init ( COMP_HandleTypeDef hcomp)

Initialize the COMP according to the specified parameters in the COMP_InitTypeDef and initialize the associated handle.

Note:
If the selected comparator is locked, initialization can't be performed. To unlock the configuration, perform a system reset.
Parameters:
hcompCOMP handle
Return values:
HALstatus

Definition at line 277 of file stm32l4xx_hal_comp.c.

References __HAL_COMP_IS_LOCKED, __HAL_RCC_SYSCFG_CLK_ENABLE, assert_param, COMP_InitTypeDef::BlankingSrce, COMP_CLEAR_ERRORCODE, COMP_DELAY_VOLTAGE_SCALER_STAB_US, COMP_EXTI_EVENT, COMP_EXTI_FALLING, COMP_EXTI_IT, COMP_EXTI_RISING, COMP_GET_EXTI_LINE, COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON, HAL_COMP_MspInit(), HAL_COMP_STATE_READY, HAL_COMP_STATE_RESET, HAL_COMP_TriggerCallback(), COMP_InitTypeDef::Hysteresis, __COMP_HandleTypeDef::Init, __COMP_HandleTypeDef::Instance, COMP_InitTypeDef::InvertingInput, IS_COMP_BLANKINGSRC_INSTANCE, IS_COMP_HYSTERESIS, IS_COMP_INPUT_MINUS, IS_COMP_INPUT_PLUS, IS_COMP_OUTPUTPOL, IS_COMP_POWERMODE, IS_COMP_TRIGGERMODE, IS_COMP_WINDOWMODE, LL_EXTI_ClearFlag_0_31(), LL_EXTI_DisableEvent_0_31(), LL_EXTI_DisableFallingTrig_0_31(), LL_EXTI_DisableIT_0_31(), LL_EXTI_DisableRisingTrig_0_31(), LL_EXTI_EnableEvent_0_31(), LL_EXTI_EnableFallingTrig_0_31(), LL_EXTI_EnableIT_0_31(), LL_EXTI_EnableRisingTrig_0_31(), __COMP_HandleTypeDef::Lock, COMP_InitTypeDef::Mode, __COMP_HandleTypeDef::MspInitCallback, COMP_InitTypeDef::NonInvertingInput, COMP_InitTypeDef::OutputPol, __COMP_HandleTypeDef::State, __COMP_HandleTypeDef::TriggerCallback, COMP_InitTypeDef::TriggerMode, and COMP_InitTypeDef::WindowMode.

DeInitialize the COMP MSP.

Parameters:
hcompCOMP handle
Return values:
None

Definition at line 534 of file stm32l4xx_hal_comp.c.

Referenced by HAL_COMP_DeInit(), and HAL_COMP_UnRegisterCallback().

Initialize the COMP MSP.

Parameters:
hcompCOMP handle
Return values:
None

Definition at line 519 of file stm32l4xx_hal_comp.c.

Referenced by HAL_COMP_Init(), and HAL_COMP_UnRegisterCallback().

HAL_StatusTypeDef HAL_COMP_RegisterCallback ( COMP_HandleTypeDef hcomp,
HAL_COMP_CallbackIDTypeDef  CallbackID,
pCOMP_CallbackTypeDef  pCallback 
)

Register a User COMP Callback To be used instead of the weak predefined callback.

Parameters:
hcompPointer to a COMP_HandleTypeDef structure that contains the configuration information for the specified COMP.
CallbackIDID of the callback to be registered This parameter can be one of the following values:
pCallbackpointer to the Callback function
Return values:
HALstatus

Definition at line 558 of file stm32l4xx_hal_comp.c.

References __COMP_HandleTypeDef::ErrorCode, HAL_COMP_ERROR_INVALID_CALLBACK, HAL_COMP_MSPDEINIT_CB_ID, HAL_COMP_MSPINIT_CB_ID, HAL_COMP_STATE_READY, HAL_COMP_STATE_RESET, HAL_COMP_TRIGGER_CB_ID, __COMP_HandleTypeDef::MspDeInitCallback, __COMP_HandleTypeDef::MspInitCallback, __COMP_HandleTypeDef::State, and __COMP_HandleTypeDef::TriggerCallback.

HAL_StatusTypeDef HAL_COMP_UnRegisterCallback ( COMP_HandleTypeDef hcomp,
HAL_COMP_CallbackIDTypeDef  CallbackID 
)

Unregister a COMP Callback COMP callback is redirected to the weak predefined callback.

Parameters:
hcompPointer to a COMP_HandleTypeDef structure that contains the configuration information for the specified COMP.
CallbackIDID of the callback to be unregistered This parameter can be one of the following values:
Return values:
HALstatus

Definition at line 640 of file stm32l4xx_hal_comp.c.

References __COMP_HandleTypeDef::ErrorCode, HAL_COMP_ERROR_INVALID_CALLBACK, HAL_COMP_MspDeInit(), HAL_COMP_MSPDEINIT_CB_ID, HAL_COMP_MspInit(), HAL_COMP_MSPINIT_CB_ID, HAL_COMP_STATE_READY, HAL_COMP_STATE_RESET, HAL_COMP_TRIGGER_CB_ID, HAL_COMP_TriggerCallback(), __COMP_HandleTypeDef::MspDeInitCallback, __COMP_HandleTypeDef::MspInitCallback, __COMP_HandleTypeDef::State, and __COMP_HandleTypeDef::TriggerCallback.