Functions
Peripheral State and Errors functions
Peripheral Driver » HAL Driver » COMP » 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_comp | Pointer 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_comp | Pointer to a COMP handle which contains the configuration information for the specified COMP module.

Return values

  HAL_COMP_STATE_RESET | Peripheral not initialized.
  HAL_COMP_STATE_READY | Peripheral initialized and ready for use.
  HAL_COMP_STATE_BUSY | An internal process is ongoing.
  HAL_COMP_STATE_ERROR | Peripheral 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_comp | Pointer to a COMP handle which contains the configuration information for the specified COMP module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout 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_comp | Pointer to a COMP handle which contains the configuration information for the specified COMP module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.