Functions
Peripheral State and Errors functions
Peripheral Driver » HAL Driver » HMAC » Functions

HMAC control functions. More...

## Functions
hal_hmac_state_t | hal_hmac_get_state (hmac_handle_t *p_hmac)
| Return the HMAC handle state. More...
uint32_t | hal_hmac_get_error (hmac_handle_t *p_hmac)
| Return the HMAC error code. More...
void | hal_hmac_set_timeout (hmac_handle_t *p_hmac, uint32_t timeout)
| Set the HMAC internal process timeout value. More...
hal_status_t | hal_hmac_suspend_reg (hmac_handle_t *p_hmac)
| Suspend some registers related to HMAC configuration before sleep. More...
hal_status_t | hal_hmac_resume_reg (hmac_handle_t *p_hmac)
| Restore some registers related to HMAC configuration after sleep. More...

## Detailed Description

HMAC control functions.

     ===============================================================================
                          ##### Peripheral State and Errors functions #####
     ===============================================================================
        [..]
        This subsection provides a set of functions allowing to control the HMAC.
         (+) hal_hmac_get_state() API can be helpful to check in run-time the state of the HMAC peripheral.
         (+) hal_hmac_get_error() check in run-time Errors occurring during communication.
         (+) hal_hmac_set_timeout() set the timeout during internal process.

## Function Documentation

## ◆ hal_hmac_get_error()

uint32_t hal_hmac_get_error | ( | hmac_handle_t * | p_hmac | ) |

Return the HMAC error code.

Parameters

  [in] | p_hmac | Pointer to a HMAC handle which contains the configuration information for the specified HMAC module.

Returns
  HMAC error code in bitmap format

## ◆ hal_hmac_get_state()

hal_hmac_state_t hal_hmac_get_state | ( | hmac_handle_t * | p_hmac | ) |

Return the HMAC handle state.

Parameters

  [in] | p_hmac | Pointer to a HMAC handle which contains the configuration information for the specified HMAC module.

Return values

  HAL_HMAC_STATE_RESET | Peripheral not initialized.
  HAL_HMAC_STATE_READY | Peripheral initialized and ready for use.
  HAL_HMAC_STATE_BUSY | Peripheral in indirect mode and busy.
  HAL_HMAC_STATE_ERROR | Peripheral in error.
  HAL_HMAC_STATE_TIMEOUT | Peripheral in timeout.
  HAL_HMAC_STATE_SUSPENDED | Peripheral in suspended.

## ◆ hal_hmac_resume_reg()

hal_status_t hal_hmac_resume_reg | ( | hmac_handle_t * | p_hmac | ) |

Restore some registers related to HMAC configuration after sleep.

This function must be used in conjunction with the hal_hmac_suspend_reg().

Parameters

  [in] | p_hmac | Pointer to a HMAC handle which contains the configuration information for the specified HMAC 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_hmac_set_timeout()

void hal_hmac_set_timeout | ( | hmac_handle_t * | p_hmac,
|  | uint32_t | timeout
| ) |  |

Set the HMAC internal process timeout value.

Parameters

  [in] | p_hmac | Pointer to a HMAC handle which contains the configuration information for the specified HMAC module.
  [in] | timeout | Internal process timeout value.

## ◆ hal_hmac_suspend_reg()

hal_status_t hal_hmac_suspend_reg | ( | hmac_handle_t * | p_hmac | ) |

Suspend some registers related to HMAC configuration before sleep.

Parameters

  [in] | p_hmac | Pointer to a HMAC handle which contains the configuration information for the specified HMAC 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.