Peripheral State and Errors functions

COMP control functions. More...

Functions

hal_comp_state_t hal_comp_get_state (comp_handle_t *p_comp)
 Return the COMP handle state. More...
 
uint32_t hal_comp_get_error (comp_handle_t *p_comp)
 Return the COMP error code. More...
 
hal_status_t hal_comp_suspend_reg (comp_handle_t *p_comp)
 Suspend some registers related to COMP configuration before sleep. More...
 
hal_status_t hal_comp_resume_reg (comp_handle_t *p_comp)
 Restore some registers related to COMP configuration after sleep. This function must be used in conjunction with the hal_comp_suspend_reg(). More...
 

Detailed Description

COMP control functions.

 ===============================================================================
                      ##### Peripheral State and Errors functions #####
 ===============================================================================
    [..]
    This subsection provides a set of functions allowing to control the COMP.
     (+) hal_comp_get_state() API can be helpful to check in run-time the state of the COMP peripheral.
     (+) hal_comp_get_error() check in run-time Errors occurring during communication.

Function Documentation

◆ hal_comp_get_error()

uint32_t hal_comp_get_error ( comp_handle_t p_comp)

Return the COMP error code.

Parameters
[in]p_compPointer to a COMP handle which contains the configuration information for the specified COMP module.
Returns
COMP error code in bitmap format

◆ hal_comp_get_state()

hal_comp_state_t hal_comp_get_state ( comp_handle_t p_comp)

Return the COMP handle state.

Parameters
[in]p_compPointer to a COMP handle which contains the configuration information for the specified COMP module.
Return values
HAL_COMP_STATE_RESETPeripheral not initialized.
HAL_COMP_STATE_READYPeripheral initialized and ready for use.
HAL_COMP_STATE_BUSYAn internal process is ongoing.
HAL_COMP_STATE_ERRORPeripheral in error.

◆ hal_comp_resume_reg()

hal_status_t hal_comp_resume_reg ( comp_handle_t p_comp)

Restore some registers related to COMP configuration after sleep. This function must be used in conjunction with the hal_comp_suspend_reg().

Parameters
[in]p_compPointer to a COMP handle which contains the configuration information for the specified COMP module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_comp_suspend_reg()

hal_status_t hal_comp_suspend_reg ( comp_handle_t p_comp)

Suspend some registers related to COMP configuration before sleep.

Parameters
[in]p_compPointer to a COMP handle which contains the configuration information for the specified COMP module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.