STM8L15x Standard Peripherals Drivers: AES

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

AES driver modules. More...

Modules

 AES_Exported_Types
 AES_Private_Functions

Functions

void AES_ClearFlag (AES_FLAG_TypeDef AES_FLAG)
 Clears the AES flags.
void AES_ClearITPendingBit (AES_IT_TypeDef AES_IT)
 Clears the AES's interrupt pending bits.
void AES_Cmd (FunctionalState NewState)
 Enable the AES peripheral.
void AES_DeInit (void)
 Deinitializes the AES peripheral.
void AES_DMAConfig (AES_DMATransfer_TypeDef AES_DMATransfer, FunctionalState NewState)
 Configures the AES DMA interface.
FlagStatus AES_GetFlagStatus (AES_FLAG_TypeDef AES_FLAG)
 Checks whether the specified AES flag is set or not.
ITStatus AES_GetITStatus (AES_IT_TypeDef AES_IT)
 Checks whether the specified AES interrupt has occurred or not.
void AES_ITConfig (AES_IT_TypeDef AES_IT, FunctionalState NewState)
 Enables or disables the specified AES interrupt.
void AES_OperationModeConfig (AES_Operation_TypeDef AES_Operation)
 Configures the AES operation mode.
uint8_t AES_ReadSubData (void)
 Returns the data in DOUTR register processed by AES peripheral.
uint8_t AES_ReadSubKey (void)
 Returns the DOUTR register content.
void AES_WriteSubData (uint8_t Data)
 Write data in DINR register to be processed by AES peripheral.
void AES_WriteSubKey (uint8_t Key)
 Write key in DINR register.

Detailed Description

AES driver modules.


Function Documentation

void AES_ClearFlag ( AES_FLAG_TypeDef  AES_FLAG)

Clears the AES flags.

Parameters:
AES_FLAG,:specifies the flag to clear. This parameter can be one of the following values:
  • AES_FLAG_CCF: Computation Complete Flag
  • AES_FLAG_RDERR: Read Error Flag
  • AES_FLAG_WRERR: Write Error Flag
Return values:
None

Definition at line 360 of file stm8l15x_aes.c.

References AES, AES_CR_CCFC, AES_CR_ERRC, AES_FLAG_CCF, and IS_AES_FLAG.

void AES_ClearITPendingBit ( AES_IT_TypeDef  AES_IT)

Clears the AES's interrupt pending bits.

Parameters:
AES_IT,:specifies the interrupt pending bit to clear. This parameter can be one of the following values:
  • AES_IT_CCIE: Computation Complete interrupt enable
  • AES_IT_ERRIE: Error interrupt enable
Return values:
None

Definition at line 448 of file stm8l15x_aes.c.

References AES, AES_CR_CCFC, AES_CR_ERRC, AES_IT_CCIE, and IS_AES_IT.

void AES_Cmd ( FunctionalState  NewState)

Enable the AES peripheral.

Parameters:
NewState: The new state of the AES peripheral. This parameter can be: ENABLE or DISABLE.
Note:
AES peripheral can be enabled once operation mode is configured using AES_OperationModeConfig()
Return values:
None

< AES Enable

< AES Disable

Definition at line 126 of file stm8l15x_aes.c.

References AES, AES_CR_EN, DISABLE, and IS_FUNCTIONAL_STATE.

void AES_DeInit ( void  )

Deinitializes the AES peripheral.

Parameters:
None.
Return values:
None

Definition at line 87 of file stm8l15x_aes.c.

References AES, AES_CR_CCFC, AES_CR_ERRC, AES_DINR_RESET_VALUE, and AES_DOUTR_RESET_VALUE.

void AES_DMAConfig ( AES_DMATransfer_TypeDef  AES_DMATransfer,
FunctionalState  NewState 
)

Configures the AES DMA interface.

Parameters:
AES_DMATransfer,:Specifies the AES DMA transfer. This parameter can be one of the following values:
  • AES_DMATransfer_InOut: DMA requests enabled for input/Output transfer phase
NewStateIndicates the new state of the AES DMA interface. This parameter can be: ENABLE or DISABLE.
Return values:
None
Note:
CCF bit has no meaning when DMA requests are enabled (DMAEN = 1).

Definition at line 231 of file stm8l15x_aes.c.

References AES, DISABLE, and IS_AES_DMATRANSFER.

FlagStatus AES_GetFlagStatus ( AES_FLAG_TypeDef  AES_FLAG)

Checks whether the specified AES flag is set or not.

Parameters:
AES_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • AES_FLAG_CCF: Computation Complete Flag
  • AES_FLAG_RDERR: Read Error Flag
  • AES_FLAG_WRERR: Write Error Flag
Return values:
FlagStatus(SET or RESET)
Note:
CCF bit has a meaning only when DMA requests are disabled (DMAEN bit = 0).

Definition at line 301 of file stm8l15x_aes.c.

References AES, AES_FLAG_CCF, AES_FLAG_RDERR, AES_FLAG_WRERR, IS_AES_FLAG, RESET, and SET.

ITStatus AES_GetITStatus ( AES_IT_TypeDef  AES_IT)

Checks whether the specified AES interrupt has occurred or not.

Parameters:
AES_IT,:Specifies the AES interrupt pending bit to check. This parameter can be one of the following values:
  • AES_IT_CCIE: Computation Complete interrupt enable
  • AES_IT_ERRIE: Error interrupt enable
Return values:
ITStatusThe new state of AES_IT (SET or RESET).

Definition at line 386 of file stm8l15x_aes.c.

References AES, AES_CR_CCIE, AES_CR_ERRIE, AES_IT_CCIE, AES_SR_CCF, AES_SR_RDERR, AES_SR_WRERR, IS_AES_IT, RESET, and SET.

void AES_ITConfig ( AES_IT_TypeDef  AES_IT,
FunctionalState  NewState 
)

Enables or disables the specified AES interrupt.

Parameters:
AES_IT,:Specifies the AES interrupt source to enable/disable. This parameter can be one of the following values:
  • AES_IT_CCIE: Computation Complete interrupt enable
  • AES_IT_ERRIE: Error interrupt enable
NewState: The new state of the AES peripheral. This parameter can be: ENABLE or DISABLE.
Return values:
None

< AES_IT Enable

< AES_IT Disable

Definition at line 275 of file stm8l15x_aes.c.

References AES, DISABLE, IS_AES_IT, and IS_FUNCTIONAL_STATE.

void AES_OperationModeConfig ( AES_Operation_TypeDef  AES_Operation)

Configures the AES operation mode.

Parameters:
AES_Operation: the selected AES operation mode. This parameter can be one of the following values:
  • AES_Operation_Encryp: AES in Encryption mode
  • AES_Operation_KeyDeriv: AES in Key Derivation mode
  • AES_Operation_Decryp: AES in Decryption mode
  • AES_Operation_KeyDerivAndDecryp: AES in Key Derivation and Decryption mode
Note:
The operation mode must be configured when AES peripheral is disabled.
Return values:
None

Definition at line 106 of file stm8l15x_aes.c.

References AES, AES_CR_MODE, and IS_AES_MODE.

uint8_t AES_ReadSubData ( void  )

Returns the data in DOUTR register processed by AES peripheral.

Note:
When an unexpected read of DOUTR register is detected, RDERR flag is set
Return values:
Theprocessed data.

Definition at line 189 of file stm8l15x_aes.c.

References AES.

uint8_t AES_ReadSubKey ( void  )

Returns the DOUTR register content.

Return values:
Thederivation key.
Note:
When an unexpected read of DOUTR register is detected, RDERR flag is set.

Definition at line 200 of file stm8l15x_aes.c.

References AES.

void AES_WriteSubData ( uint8_t  Data)

Write data in DINR register to be processed by AES peripheral.

Parameters:
Data,:The data to be processed.
Note:
When an unexpected write to DINR register is detected, WRERR flag is set.
Return values:
None

Definition at line 164 of file stm8l15x_aes.c.

References AES.

void AES_WriteSubKey ( uint8_t  Key)

Write key in DINR register.

Parameters:
Key,:The key to be used for encryption/decryption.
Note:
When an unexpected write to DINR register is detected, WRERR flag is set.
Return values:
None

Definition at line 177 of file stm8l15x_aes.c.

References AES.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com