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

AES control functions. More...

## Functions
hal_aes_state_t | hal_aes_get_state (aes_handle_t *p_aes)
| Return the AES handle state. More...
uint32_t | hal_aes_get_error (aes_handle_t *p_aes)
| Return the AES error code. More...
void | hal_aes_set_timeout (aes_handle_t *p_aes, uint32_t timeout)
| Set the AES internal process timeout value. More...
hal_status_t | hal_aes_suspend_reg (aes_handle_t *p_aes)
| Suspend some registers related to AES configuration before sleep. More...
hal_status_t | hal_aes_resume_reg (aes_handle_t *p_aes)
| Restore some registers related to AES configuration after sleep. This function must be used in conjunction with the hal_aes_suspend_reg(). More...

## Detailed Description

AES control functions.

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

## Function Documentation

## ◆ hal_aes_get_error()

uint32_t hal_aes_get_error | ( | aes_handle_t * | p_aes | ) |

Return the AES error code.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.

Returns
  AES error code in bitmap format

## ◆ hal_aes_get_state()

hal_aes_state_t hal_aes_get_state | ( | aes_handle_t * | p_aes | ) |

Return the AES handle state.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.

Return values

  HAL_AES_STATE_RESET | Peripheral not initialized.
  HAL_AES_STATE_READY | Peripheral initialized and ready for use.
  HAL_AES_STATE_BUSY | Peripheral in indirect mode and busy.
  HAL_AES_STATE_ERROR | Peripheral in error.
  HAL_AES_STATE_TIMEOUT | Peripheral in timeout.
  HAL_AES_STATE_SUSPENDED | Peripheral in suspended.

## ◆ hal_aes_resume_reg()

hal_status_t hal_aes_resume_reg | ( | aes_handle_t * | p_aes | ) |

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

Parameters

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

void hal_aes_set_timeout | ( | aes_handle_t * | p_aes,
|  | uint32_t | timeout
| ) |  |

Set the AES internal process timeout value.

Parameters

  [in] | p_aes | Pointer to an AES handle which contains the configuration information for the specified AES module.
  [in] | timeout | Internal process timeout value.

## ◆ hal_aes_suspend_reg()

hal_status_t hal_aes_suspend_reg | ( | aes_handle_t * | p_aes | ) |

Suspend some registers related to AES configuration before sleep.

Parameters

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