MG32F157 Standard Peripherals Firmware Library
Macros | Functions
mg32f157_aes.c File Reference

This file provides all the AES firmware functions. More...

#include "mg32f157_aes.h"

Macros

#define AES_Set   ((uint32_t)0x00000001)
 
#define AES_Reset   ((uint32_t)0x00000000)
 
#define AES_IT_MASK   ((uint32_t)0xFFFBFFFF)
 
#define AES_ERRC   ((uint16_t)0x0100)
 
#define AES_CCFC   ((uint16_t)0x0080)
 
#define AES_ERRC_CCFC   ((uint16_t)0x0180)
 
#define CHMOD_ECB   ((uint32_t)0x00000000)
 
#define CHMOD_CBC   ((uint32_t)0x00000020)
 
#define CHMOD_CTR   ((uint32_t)0x00000040)
 
#define MODE_Encryption   ((uint32_t)0x00000000)
 
#define MODE_Derivation   ((uint32_t)0x00000008)
 
#define MODE_Decryption   ((uint32_t)0x00000010)
 
#define MODE_Derivation_Decryption   ((uint32_t)0x00000018)
 
#define DATATYPE_32Bits   ((uint32_t)0x00000000)
 
#define DATATYPE_16Bits   ((uint32_t)0x00000002)
 
#define DATATYPE_8Bits   ((uint32_t)0x00000004)
 
#define DATATYPE_1Bit   ((uint32_t)0x00000006)
 

Functions

void AES_Cmd (FunctionalState NewState)
 Enables or disables the AES. More...
 
void AES_DeInit (void)
 Deinitializes the AES peripheral registers to their default reset values. More...
 
void AES_StructInit (AES_InitTypeDef *AES_InitStruct)
 Fills each AES_InitStruct member with its default value. More...
 
void AES_Init (AES_InitTypeDef *AES_InitStruct)
 Initializes the AES peripheral according to the specified parameters in the AES_InitStruct. More...
 
void AES_IT_Config (uint32_t AES_IT, FunctionalState NewState)
 Enables or disables the specified AES interrupts. 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...
 
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...
 

Detailed Description

This file provides all the AES firmware functions.

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