STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
Peripheral states functions

Peripheral State functions. More...

Collaboration diagram for Peripheral states functions:

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

◆ HAL_HASH_GetState()

HAL_HASH_StateTypeDef HAL_HASH_GetState ( HASH_HandleTypeDef * hhash)

#include <stm32f4xx_hal_hash.h>

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_HASH_GetStatus()

HAL_StatusTypeDef HAL_HASH_GetStatus ( HASH_HandleTypeDef * hhash)

#include <stm32f4xx_hal_hash.h>

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.

◆ HAL_HASH_ContextSaving()

void HAL_HASH_ContextSaving ( HASH_HandleTypeDef * hhash,
uint8_t * pMemBuffer )

#include <stm32f4xx_hal_hash.h>

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, HASH_NUMBER_OF_CSR_REGISTERS, and UNUSED.

◆ HAL_HASH_ContextRestoring()

void HAL_HASH_ContextRestoring ( HASH_HandleTypeDef * hhash,
uint8_t * pMemBuffer )

#include <stm32f4xx_hal_hash.h>

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, HASH_NUMBER_OF_CSR_REGISTERS, and UNUSED.

◆ HAL_HASH_SwFeed_ProcessSuspend()

void HAL_HASH_SwFeed_ProcessSuspend ( HASH_HandleTypeDef * hhash)

#include <stm32f4xx_hal_hash.h>

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.

◆ HAL_HASH_DMAFeed_ProcessSuspend()

HAL_StatusTypeDef HAL_HASH_DMAFeed_ProcessSuspend ( HASH_HandleTypeDef * hhash)

#include <stm32f4xx_hal_hash.h>

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_ERROR, HAL_HASH_STATE_READY, HAL_HASH_STATE_SUSPENDED, HAL_OK, HAL_TIMEOUT, 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.

◆ HAL_HASH_GetError()

uint32_t HAL_HASH_GetError ( HASH_HandleTypeDef * hhash)

#include <stm32f4xx_hal_hash.h>

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.