Classes | Macros | Typedefs | Functions
gr55xx_ll_aes.h File Reference

Header file containing functions prototypes of AES LL library. More...

`#include "gr55xx.h"`
Include dependency graph for gr55xx_ll_aes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | _ll_aes_init
| LL AES Init Structure definition. More...

## Macros
#define | LL_AES_FLAG_DATAREADY AES_STATUS_READY
| AES result data out ready More...
#define | LL_AES_FLAG_DMA_DONE AES_STATUS_TRANSDONE
| AES dma transfer done More...
#define | LL_AES_FLAG_DMA_ERR AES_STATUS_TRANSERR
| AES dma transfer error More...
#define | LL_AES_FLAG_KEY_VALID AES_STATUS_KEYVALID
| AES has fetched key More...
#define | LL_AES_KEY_SIZE_128 0x00000000U
| 128 bits More...
#define | LL_AES_KEY_SIZE_192 (1UL << AES_CONFIG_KEYMODE_Pos)
| 192 bits More...
#define | LL_AES_KEY_SIZE_256 (2UL << AES_CONFIG_KEYMODE_Pos)
| 256 bits More...
#define | LL_AES_OPERATION_MODE_ECB 0x00000000U
| Electronic codebook (ECB) mode More...
#define | LL_AES_OPERATION_MODE_CBC (1UL << AES_CONFIG_OPMODE_Pos)
| Cipher block chaining (CBC) mode. More...
#define | LL_AES_KEYTYPE_MCU 0x00000000U
| MCU More...
#define | LL_AES_KEYTYPE_AHB (1UL << AES_CONFIG_KEYTYPE_Pos)
| AHB master. More...
#define | LL_AES_KEYTYPE_KRAM (2UL << AES_CONFIG_KEYTYPE_Pos)
| Key Port More...
#define | LL_AES_DMA_TRANSIZE_MIN (1)
| Min size = 1 block More...
#define | LL_AES_DMA_TRANSIZE_MAX (2048)
| Max size = 2048 blocks More...
#define | LL_AES_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
| Write a value in AES register. More...
#define | LL_AES_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
| Read a value in AES register. More...

## Typedefs
typedef struct _ll_aes_init | ll_aes_init_t
| LL AES Init Structure definition. More...

## Functions
__STATIC_INLINE void | ll_aes_enable (aes_regs_t *AESx)
| Enable AES. More...
__STATIC_INLINE void | ll_aes_disable (aes_regs_t *AESx)
| Disable AES. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled (aes_regs_t *AESx)
| Indicate whether the AES is enabled. More...
__STATIC_INLINE void | ll_aes_enable_start (aes_regs_t *AESx)
| Enable AES start in MCU mode. More...
__STATIC_INLINE void | ll_aes_disable_start (aes_regs_t *AESx)
| Disable AES start in MCU mode. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled_start (aes_regs_t *AESx)
| Indicate whether the AES start in MCU mode is enabled. More...
__STATIC_INLINE void | ll_aes_enable_dma_start (aes_regs_t *AESx)
| Enable AES DMA mode. More...
__STATIC_INLINE void | ll_aes_disable_dma_start (aes_regs_t *AESx)
| Disable AES DMA mode. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled_dma_start (aes_regs_t *AESx)
| Indicate whether the AES DMA mode is enabled. More...
__STATIC_INLINE void | ll_aes_enable_read_key (aes_regs_t *AESx)
| Enable fetch key through AHB/key port. More...
__STATIC_INLINE void | ll_aes_set_key_size (aes_regs_t *AESx, uint32_t size)
| Set AES key size. More...
__STATIC_INLINE uint32_t | ll_aes_get_key_size (aes_regs_t *AESx)
| Get AES key size. More...
__STATIC_INLINE void | ll_aes_enable_full_mask (aes_regs_t *AESx)
| Enable AES full mask. More...
__STATIC_INLINE void | ll_aes_disable_full_mask (aes_regs_t *AESx)
| Disable AES full mask. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled_full_mask (aes_regs_t *AESx)
| Indicate whether the AES full mask is enabled. More...
__STATIC_INLINE void | ll_aes_enable_encryption (aes_regs_t *AESx)
| Enable AES encryption mode. More...
__STATIC_INLINE void | ll_aes_disable_encryption (aes_regs_t *AESx)
| Disable AES encryption mode. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled_encryption (aes_regs_t *AESx)
| Indicate whether the AES encryption mode is enabled. More...
__STATIC_INLINE void | ll_aes_set_load_seed (aes_regs_t *AESx)
| Set AES to load seed for LFSR. More...
__STATIC_INLINE void | ll_aes_set_first_block (aes_regs_t *AESx)
| Set AES in first block before starting the first block in normal CBC and DMA CBC mode. More...
__STATIC_INLINE void | ll_aes_enable_little_endian (aes_regs_t *AESx)
| Enable AES in little endian. More...
__STATIC_INLINE void | ll_aes_disable_little_endian (aes_regs_t *AESx)
| Disable AES in little endian. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled_little_endian (aes_regs_t *AESx)
| Indicate whether the AES is in little endian. More...
__STATIC_INLINE void | ll_aes_set_operation_mode (aes_regs_t *AESx, uint32_t mode)
| Set AES operation mode. More...
__STATIC_INLINE uint32_t | ll_aes_get_operation_mode (aes_regs_t *AESx)
| Get AES operation mode. More...
__STATIC_INLINE void | ll_aes_set_key_type (aes_regs_t *AESx, uint32_t Type)
| Set ways to obtain AES key. More...
__STATIC_INLINE uint32_t | ll_aes_get_key_type (aes_regs_t *AESx)
| Get ways to obtain AES key. More...
__STATIC_INLINE void | ll_aes_enable_it_done (aes_regs_t *AESx)
| Enable AES the done interrupt. More...
__STATIC_INLINE void | ll_aes_disable_it_done (aes_regs_t *AESx)
| Disable AES the done interrupt. More...
__STATIC_INLINE uint32_t | ll_aes_is_enabled_it_done (aes_regs_t *AESx)
| Indicate whether the done interrupt is enabled. More...
__STATIC_INLINE uint32_t | ll_aes_is_action_flag_ready (aes_regs_t *AESx)
| Indicate whether the ready flag is set. More...
__STATIC_INLINE uint32_t | ll_aes_is_action_flag_dma_done (aes_regs_t *AESx)
| Indicate whether the DMA transfer done flag is set. More...
__STATIC_INLINE uint32_t | ll_aes_is_action_flag_dma_error (aes_regs_t *AESx)
| Indicate whether the DMA transfer error flag is set. More...
__STATIC_INLINE uint32_t | ll_aes_is_action_flag_key_valid (aes_regs_t *AESx)
| Indicate whether the key valid flag is set. More...
__STATIC_INLINE uint32_t | ll_aes_is_action_flag_it_done (aes_regs_t *AESx)
| Indicate whether the done interrupt flag is set. More...
__STATIC_INLINE void | ll_aes_clear_flag_it_done (aes_regs_t *AESx)
| Clear the done interrupt flag. More...
__STATIC_INLINE void | ll_aes_set_dma_transfer_block (aes_regs_t *AESx, uint32_t block)
| Set AES transfer blocks in DMA mode. More...
__STATIC_INLINE uint32_t | ll_aes_get_dma_transfer_block (aes_regs_t *AESx)
| Get AES transfer blocks in DMA mode. More...
__STATIC_INLINE void | ll_aes_set_dma_read_address (aes_regs_t *AESx, uint32_t address)
| Set AES read address of RAM in DMA mode. More...
__STATIC_INLINE uint32_t | ll_aes_get_dma_read_address (aes_regs_t *AESx)
| Get AES read address of RAM in DMA mode. More...
__STATIC_INLINE void | ll_aes_set_dma_write_address (aes_regs_t *AESx, uint32_t address)
| Set AES write address of RAM in DMA mode. More...
__STATIC_INLINE uint32_t | ll_aes_get_dma_write_address (aes_regs_t *AESx)
| Get AES write address of RAM in DMA mode. More...
__STATIC_INLINE void | ll_aes_set_key_address (aes_regs_t *AESx, uint32_t address)
| Set AES key address in memory. More...
__STATIC_INLINE uint32_t | ll_aes_get_key_address (aes_regs_t *AESx)
| Get AES key address in memory. More...
__STATIC_INLINE uint32_t | ll_aes_get_data_127_96 (aes_regs_t *AESx)
| Get AES output data[127:96]. More...
__STATIC_INLINE uint32_t | ll_aes_get_data_95_64 (aes_regs_t *AESx)
| Get AES output data[95:64]. More...
__STATIC_INLINE uint32_t | ll_aes_get_data_63_32 (aes_regs_t *AESx)
| Get AES output data[63:32]. More...
__STATIC_INLINE uint32_t | ll_aes_get_data_31_0 (aes_regs_t *AESx)
| Get AES output data[31:0]. More...
__STATIC_INLINE void | ll_aes_set_key_255_224 (aes_regs_t *AESx, uint32_t key)
| Set AES key[255:224]. More...
__STATIC_INLINE void | ll_aes_set_key_223_192 (aes_regs_t *AESx, uint32_t key)
| Set AES key[223:192]. More...
__STATIC_INLINE void | ll_aes_set_key_191_160 (aes_regs_t *AESx, uint32_t key)
| Set AES key[191:160]. More...
__STATIC_INLINE void | ll_aes_set_key_159_128 (aes_regs_t *AESx, uint32_t key)
| Set AES key[159:128]. More...
__STATIC_INLINE void | ll_aes_set_key_127_96 (aes_regs_t *AESx, uint32_t key)
| Set AES key[127:96]. More...
__STATIC_INLINE void | ll_aes_set_key_95_64 (aes_regs_t *AESx, uint32_t key)
| Set AES key[95:64]. More...
__STATIC_INLINE void | ll_aes_set_key_63_32 (aes_regs_t *AESx, uint32_t key)
| Set AES key[63:32]. More...
__STATIC_INLINE void | ll_aes_set_key_31_0 (aes_regs_t *AESx, uint32_t key)
| Set AES key[31:0]. More...
__STATIC_INLINE void | ll_aes_set_seed_in (aes_regs_t *AESx, uint32_t seed)
| Set AES input seed. More...
__STATIC_INLINE uint32_t | ll_aes_get_seed_in (aes_regs_t *AESx)
| Get AES input seed. More...
__STATIC_INLINE void | ll_aes_set_seed_out (aes_regs_t *AESx, uint32_t seed)
| Set AES output seed. More...
__STATIC_INLINE uint32_t | ll_aes_get_seed_out (aes_regs_t *AESx)
| Get AES output seed. More...
__STATIC_INLINE void | ll_aes_set_seed_Imask (aes_regs_t *AESx, uint32_t mask)
| Set sbox input data's mask. More...
__STATIC_INLINE uint32_t | ll_aes_get_seed_Imask (aes_regs_t *AESx)
| Get sbox input data's mask. More...
__STATIC_INLINE void | ll_aes_set_seed_Osbox (aes_regs_t *AESx, uint32_t mask)
| Set sbox output data's mask. More...
__STATIC_INLINE uint32_t | ll_aes_get_seed_Osbox (aes_regs_t *AESx)
| Get sbox output data's mask. More...
__STATIC_INLINE void | ll_aes_set_vector_127_96 (aes_regs_t *AESx, uint32_t vector)
| Set AES initialization vector[127:96]. More...
__STATIC_INLINE void | ll_aes_set_vector_95_64 (aes_regs_t *AESx, uint32_t vector)
| Set AES initialization vector[95:64]. More...
__STATIC_INLINE void | ll_aes_set_vector_63_32 (aes_regs_t *AESx, uint32_t vector)
| Set AES initialization vector[63:32]. More...
__STATIC_INLINE void | ll_aes_set_vector_31_0 (aes_regs_t *AESx, uint32_t vector)
| Set AES initialization vector[31:0]. More...
__STATIC_INLINE void | ll_aes_set_data_127_96 (aes_regs_t *AESx, uint32_t data)
| Set AES input data[127:96]. More...
__STATIC_INLINE void | ll_aes_set_data_95_64 (aes_regs_t *AESx, uint32_t data)
| Set AES input data[95:64]. More...
__STATIC_INLINE void | ll_aes_set_data_63_32 (aes_regs_t *AESx, uint32_t data)
| Set AES input data[63:32]. More...
__STATIC_INLINE void | ll_aes_set_data_31_0 (aes_regs_t *AESx, uint32_t data)
| Set AES input data[31:0]. More...
__STATIC_INLINE void | ll_aes_set_key_port_mask (aes_regs_t *AESx, uint32_t mask)
| Set AES fetch key port mask. More...
error_status_t | ll_aes_deinit (aes_regs_t *AESx)
| De-initialize AES registers (Registers restored to their default values). More...
error_status_t | ll_aes_init (aes_regs_t *AESx, ll_aes_init_t *p_aes_init)
| Initialize AES registers according to the specified parameters in p_aes_init. More...
void | ll_aes_struct_init (ll_aes_init_t *p_aes_init)
| Set each field of a ll_aes_init_t type structure to default value. More...

## Detailed Description

Header file containing functions prototypes of AES LL library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_ll_aes.h.