Peripheral State functions.
More...
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()
◆ HAL_HASH_ContextRestoring()
Restore the HASH context in case of processing resumption.
- Parameters
-
hhash | HASH handle. |
pMemBuffer | pointer 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
-
Definition at line 1451 of file stm32f4xx_hal_hash.c.
◆ HAL_HASH_ContextSaving()
Save the HASH context in case of processing suspension.
- Parameters
-
hhash | HASH handle. |
pMemBuffer | pointer 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
-
Definition at line 1405 of file stm32f4xx_hal_hash.c.
◆ HAL_HASH_DMAFeed_ProcessSuspend()
Suspend the HASH processing when in DMA mode.
- Parameters
-
- 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
-
Definition at line 1509 of file stm32f4xx_hal_hash.c.
◆ HAL_HASH_GetError()
Return the HASH handle error code.
- Parameters
-
hhash | pointer to a HASH_HandleTypeDef structure. |
- Return values
-
Definition at line 1630 of file stm32f4xx_hal_hash.c.
◆ HAL_HASH_GetState()
Return the HASH handle state.
- Note
- The API yields the current state of the handle (BUSY, READY,...).
- Parameters
-
- Return values
-
Definition at line 1374 of file stm32f4xx_hal_hash.c.
◆ HAL_HASH_GetStatus()
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
-
- Return values
-
Definition at line 1387 of file stm32f4xx_hal_hash.c.
◆ HAL_HASH_SwFeed_ProcessSuspend()
Initiate HASH processing suspension when in polling or interruption mode.
- Parameters
-
- 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
-
Definition at line 1494 of file stm32f4xx_hal_hash.c.