STM32F479xx HAL User Manual
Functions
Peripheral states functions
HASH Exported Functions

Peripheral State functions. More...

Functions

HAL_HASH_StateTypeDef HAL_HASH_GetState (HASH_HandleTypeDef *hhash)
 Return the HASH handle state.
HAL_StatusTypeDef HAL_HASH_GetStatus (HASH_HandleTypeDef *hhash)
 Return the HASH HAL status.
void HAL_HASH_ContextSaving (HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
 Save the HASH context in case of processing suspension.
void HAL_HASH_ContextRestoring (HASH_HandleTypeDef *hhash, uint8_t *pMemBuffer)
 Restore the HASH context in case of processing resumption.
void HAL_HASH_SwFeed_ProcessSuspend (HASH_HandleTypeDef *hhash)
 Initiate HASH processing suspension when in polling or interruption mode.
HAL_StatusTypeDef HAL_HASH_DMAFeed_ProcessSuspend (HASH_HandleTypeDef *hhash)
 Suspend the HASH processing when in DMA mode.
uint32_t HAL_HASH_GetError (HASH_HandleTypeDef *hhash)
 Return the HASH handle error code.

Detailed Description

Peripheral State functions.

 ===============================================================================
                      ##### Peripheral State methods #####
 ===============================================================================
    [..]
    This section permits to get in run-time the state and the peripheral handle
    status of the peripheral:
      (+) HAL_HASH_GetState()
      (+) HAL_HASH_GetStatus()

    [..]
    Additionally, this subsection provides functions allowing to save and restore
    the HASH or HMAC processing context in case of calculation suspension:
      (+) HAL_HASH_ContextSaving()
      (+) HAL_HASH_ContextRestoring()

    [..]
    This subsection provides functions allowing to suspend the HASH processing
      (+) when input are fed to the Peripheral by software
          (++) HAL_HASH_SwFeed_ProcessSuspend()
      (+) when input are fed to the Peripheral by DMA
          (++) HAL_HASH_DMAFeed_ProcessSuspend()




Function Documentation

void HAL_HASH_ContextRestoring ( HASH_HandleTypeDef hhash,
uint8_t *  pMemBuffer 
)

Restore the HASH context in case of processing resumption.

Parameters:
hhashHASH handle.
pMemBufferpointer to the memory buffer where the HASH context is stored.
Note:
The IMR, STR, CR then all the CSR registers are restored in that order. Only the r/w bits are restored.
By default, all the context swap registers (HASH_NUMBER_OF_CSR_REGISTERS of those) are restored (all of them have been saved by default beforehand).
Return values:
None

Definition at line 1451 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_INIT, and HASH_NUMBER_OF_CSR_REGISTERS.

void HAL_HASH_ContextSaving ( HASH_HandleTypeDef hhash,
uint8_t *  pMemBuffer 
)

Save the HASH context in case of processing suspension.

Parameters:
hhashHASH handle.
pMemBufferpointer to the memory buffer where the HASH context is saved.
Note:
The IMR, STR, CR then all the CSR registers are saved in that order. Only the r/w bits are read to be restored later on.
By default, all the context swap registers (there are HASH_NUMBER_OF_CSR_REGISTERS of those) are saved.
pMemBuffer points to a buffer allocated by the user. The buffer size must be at least (HASH_NUMBER_OF_CSR_REGISTERS + 3) * 4 uint8 long.
Return values:
None

Definition at line 1405 of file stm32f4xx_hal_hash.c.

References HASH_IT_DCI, HASH_IT_DINI, and HASH_NUMBER_OF_CSR_REGISTERS.

HAL_StatusTypeDef HAL_HASH_DMAFeed_ProcessSuspend ( HASH_HandleTypeDef hhash)

Suspend the HASH processing when in DMA mode.

Parameters:
hhashHASH handle.
Note:
When suspension attempt occurs at the very end of a DMA transfer and all the data have already been entered in the Peripheral, hhash->State is set to HAL_HASH_STATE_READY and the API returns HAL_ERROR. It is recommended to wrap-up the processing in reading the digest as usual.
Return values:
HALstatus

Definition at line 1509 of file stm32f4xx_hal_hash.c.

References __HAL_HASH_GET_FLAG, HAL_DMA_Abort(), HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HASH_DMA_SUSPENSION_WORDS_LIMIT, HASH_FLAG_BUSY, HASH_FLAG_DCIS, HASH_NBW_PUSHED, HASH_TIMEOUTVALUE, HASH_WaitOnFlagUntilTimeout(), __HASH_HandleTypeDef::HashInCount, __HASH_HandleTypeDef::hdmain, __DMA_HandleTypeDef::Instance, __HASH_HandleTypeDef::NbWordsAlreadyPushed, __HASH_HandleTypeDef::pHashInBuffPtr, and __HASH_HandleTypeDef::State.

uint32_t HAL_HASH_GetError ( HASH_HandleTypeDef hhash)

Return the HASH handle error code.

Parameters:
hhashpointer to a HASH_HandleTypeDef structure.
Return values:
HASHError Code

Definition at line 1630 of file stm32f4xx_hal_hash.c.

References __HASH_HandleTypeDef::ErrorCode.

Return the HASH handle state.

Note:
The API yields the current state of the handle (BUSY, READY,...).
Parameters:
hhashHASH handle.
Return values:
HALHASH state

Definition at line 1374 of file stm32f4xx_hal_hash.c.

References __HASH_HandleTypeDef::State.

HAL_StatusTypeDef HAL_HASH_GetStatus ( HASH_HandleTypeDef hhash)

Return the HASH HAL status.

Note:
The API yields the HAL status of the handle: it is the result of the latest HASH processing and allows to report any issue (e.g. HAL_TIMEOUT).
Parameters:
hhashHASH handle.
Return values:
HALstatus

Definition at line 1387 of file stm32f4xx_hal_hash.c.

References __HASH_HandleTypeDef::Status.

Initiate HASH processing suspension when in polling or interruption mode.

Parameters:
hhashHASH handle.
Note:
Set the handle field SuspendRequest to the appropriate value so that the on-going HASH processing is suspended as soon as the required conditions are met. Note that the actual suspension is carried out by the functions HASH_WriteData() in polling mode and HASH_IT() in interruption mode.
Return values:
None

Definition at line 1494 of file stm32f4xx_hal_hash.c.

References HAL_HASH_SUSPEND, and __HASH_HandleTypeDef::SuspendRequest.