Context swapping functions.
More...
Context swapping functions.
===============================================================================
Context swapping functions
===============================================================================
This section provides functions allowing to save and store CRYP Context
It is possible to interrupt an encryption/ decryption/ key generation process
to perform another processing with a higher priority, and to complete the
interrupted process later on, when the higher-priority task is complete. To do
so, the context of the interrupted task must be saved from the CRYP registers
to memory, and then be restored from memory to the CRYP registers.
1. To save the current context, use CRYP_SaveContext() function
2. To restore the saved context, use CRYP_RestoreContext() function
void CRYP_RestoreContext |
( |
CRYP_Context * |
CRYP_ContextRestore | ) |
|
Restores the CRYP peripheral Context.
- Note
- Since teh DMA transfer is stopped in CRYP_SaveContext() function, after restoring the context, you have to enable the DMA again (if the DMA was previously used).
- Parameters
-
CRYP_ContextRestore,: | pointer to a CRYP_Context structure that contains the repository for saved context. |
- Note
- The data that were saved during context saving must be rewrited into the IN FIFO.
- Return values
-
Saves the CRYP peripheral Context.
- Note
- This function stops DMA transfer before to save the context. After restoring the context, you have to enable the DMA again (if the DMA was previously used).
- Parameters
-
CRYP_ContextSave,: | pointer to a CRYP_Context structure that contains the repository for current context. |
CRYP_KeyInitStruct,: | pointer to a CRYP_KeyInitTypeDef structure that contains the configuration information for the CRYP Keys. |
- Return values
-