MG32F157 Standard Peripherals Firmware Library
Data Structures | Macros | Enumerations | Functions
mg32f157_aes.h File Reference

This file contains all the functions prototypes for the AES firmware library. More...

#include "mg32f157.h"

Go to the source code of this file.

Data Structures

struct  AES_InitTypeDef
 AES Init structure definition. More...
 

Macros

#define IS_AES_CHMOD(MODE)
 
#define IS_AES_MODE(MODE)
 
#define IS_AES_DATATYPE(DATA)
 
#define AES_DMA_IN   ((uint16_t)0x0800)
 
#define AES_DMA_OUT   ((uint16_t)0x1000)
 
#define IS_AES_DMA(AES_DMA)   (((AES_DMA) == AES_DMA_IN) || ((AES_DMA) == AES_DMA_OUT))
 
#define AES_IT_ERR   ((uint32_t)0x04000006)
 
#define AES_IT_CCF   ((uint32_t)0x02000001)
 
#define IS_AES_IT(AES_IT)   (((uint16_t)(AES_IT >> 16) & 0x0600) != 0x0000)
 
#define IS_AES_GET_IT(AES_IT)   (((AES_IT) == AES_IT_ERR) || ((AES_IT) == AES_IT_CCF))
 
#define AES_FLAG_WRERR   ((uint8_t)0x04)
 
#define AES_FLAG_RDERR   ((uint8_t)0x02)
 
#define AES_FLAG_CCF   ((uint8_t)0x01)
 
#define IS_AES_GET_FLAG(AES_FLAG)   (((AES_FLAG) == AES_FLAG_WRERR) || ((AES_FLAG) == AES_FLAG_RDERR) || ((AES_FLAG) == AES_FLAG_CCF))
 
#define IS_AES_CLEAR_FLAG(AES_FLAG)   (((AES_FLAG) == AES_FLAG_WRERR) || ((AES_FLAG) == AES_FLAG_RDERR) || ((AES_FLAG) == AES_FLAG_CCF))
 

Enumerations

enum  AESChMod_TypeDef { AES_CHMOD_ECB, AES_CHMOD_CBC, AES_CHMOD_CTR }
 AES chaining mode definition. More...
 
enum  AESMode_TypeDef { AES_MODE_Encryption, AES_MODE_Decryption, AES_MODE_Derivation, AES_MODE_Derivation_Decryption }
 AES working mode definition. More...
 
enum  AESData_TypeDef { AES_DATATYPE_32Bits, AES_DATATYPE_16Bits, AES_DATATYPE_8Bits, AES_DATATYPE_1Bit }
 AES datatype definition.
 

Functions

void AES_DeInit (void)
 Deinitializes the AES peripheral registers to their default reset values. More...
 
void AES_Cmd (FunctionalState NewState)
 Enables or disables the AES. More...
 
void AES_IT_Config (uint32_t AES_IT, FunctionalState NewState)
 Enables or disables the specified AES interrupts. More...
 
void AES_Init (AES_InitTypeDef *AES_InitStruct)
 Initializes the AES peripheral according to the specified parameters in the AES_InitStruct. More...
 
void AES_SetKey (uint8_t *Key)
 Writes the Key in Key registers. More...
 
void AES_SetInitVector (uint8_t *InitVector)
 Writes the InitVector/InitCounter in IV registers. More...
 
void AES_DataInput (uint32_t *inputaddr)
 Writes the origin data into AES DINR register. More...
 
void AES_DataOutput (uint32_t *outputaddr)
 Gets the output data from AES DOUTR register. More...
 
void AES_DMA_Cmd (uint16_t AES_DMA, FunctionalState NewState)
 Enables or disables the specified AES DMA request. More...
 
FlagStatus AES_GetFlagStatus (uint8_t AES_FLAG)
 Checks whether the specified AES flag is set or not. More...
 
void AES_ClearFlag (uint8_t AES_FLAG)
 Clears the AES's pending flags. More...
 
ITStatus AES_GetITStatus (uint32_t AES_IT)
 Checks whether the specified AES interrupt has occurred or not. More...
 
void AES_ClearITPendingBit (uint32_t AES_IT)
 Clears the AES's interrupt pending bits. More...
 

Detailed Description

This file contains all the functions prototypes for the AES firmware library.

Author
MegawinTech Application Team
Version
V0.0.4
Date
16-June-2023