|
| 1 | +/** |
| 2 | + * @file aes_regs.h |
| 3 | + * @brief Registers, Bit Masks and Bit Positions for the AES Peripheral Module. |
| 4 | + */ |
| 5 | + |
| 6 | +/* **************************************************************************** |
| 7 | + * Copyright (C) 2022 Maxim Integrated Products, Inc., All Rights Reserved. |
| 8 | + * |
| 9 | + * Permission is hereby granted, free of charge, to any person obtaining a |
| 10 | + * copy of this software and associated documentation files (the "Software"), |
| 11 | + * to deal in the Software without restriction, including without limitation |
| 12 | + * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 13 | + * and/or sell copies of the Software, and to permit persons to whom the |
| 14 | + * Software is furnished to do so, subject to the following conditions: |
| 15 | + * |
| 16 | + * The above copyright notice and this permission notice shall be included |
| 17 | + * in all copies or substantial portions of the Software. |
| 18 | + * |
| 19 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 20 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 21 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 22 | + * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
| 23 | + * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 24 | + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 25 | + * OTHER DEALINGS IN THE SOFTWARE. |
| 26 | + * |
| 27 | + * Except as contained in this notice, the name of Maxim Integrated |
| 28 | + * Products, Inc. shall not be used except as stated in the Maxim Integrated |
| 29 | + * Products, Inc. Branding Policy. |
| 30 | + * |
| 31 | + * The mere transfer of this software does not imply any licenses |
| 32 | + * of trade secrets, proprietary technology, copyrights, patents, |
| 33 | + * trademarks, maskwork rights, or any other form of intellectual |
| 34 | + * property whatsoever. Maxim Integrated Products, Inc. retains all |
| 35 | + * ownership rights. |
| 36 | + * |
| 37 | + * |
| 38 | + *************************************************************************** */ |
| 39 | + |
| 40 | +#ifndef _AES_REGS_H_ |
| 41 | +#define _AES_REGS_H_ |
| 42 | + |
| 43 | +/* **** Includes **** */ |
| 44 | +#include <stdint.h> |
| 45 | + |
| 46 | +#ifdef __cplusplus |
| 47 | +extern "C" { |
| 48 | +#endif |
| 49 | + |
| 50 | +#if defined (__ICCARM__) |
| 51 | + #pragma system_include |
| 52 | +#endif |
| 53 | + |
| 54 | +#if defined (__CC_ARM) |
| 55 | + #pragma anon_unions |
| 56 | +#endif |
| 57 | +/// @cond |
| 58 | +/* |
| 59 | + If types are not defined elsewhere (CMSIS) define them here |
| 60 | +*/ |
| 61 | +#ifndef __IO |
| 62 | +#define __IO volatile |
| 63 | +#endif |
| 64 | +#ifndef __I |
| 65 | +#define __I volatile const |
| 66 | +#endif |
| 67 | +#ifndef __O |
| 68 | +#define __O volatile |
| 69 | +#endif |
| 70 | +#ifndef __R |
| 71 | +#define __R volatile const |
| 72 | +#endif |
| 73 | +/// @endcond |
| 74 | + |
| 75 | +/* **** Definitions **** */ |
| 76 | + |
| 77 | +/** |
| 78 | + * @ingroup aes |
| 79 | + * @defgroup aes_registers AES_Registers |
| 80 | + * @brief Registers, Bit Masks and Bit Positions for the AES Peripheral Module. |
| 81 | + * @details AES Keys. |
| 82 | + */ |
| 83 | + |
| 84 | +/** |
| 85 | + * @ingroup aes_registers |
| 86 | + * Structure type to access the AES Registers. |
| 87 | + */ |
| 88 | +typedef struct { |
| 89 | + __IO uint32_t ctrl; /**< <tt>\b 0x0000:</tt> AES CTRL Register */ |
| 90 | + __IO uint32_t status; /**< <tt>\b 0x0004:</tt> AES STATUS Register */ |
| 91 | + __IO uint32_t intfl; /**< <tt>\b 0x0008:</tt> AES INTFL Register */ |
| 92 | + __IO uint32_t inten; /**< <tt>\b 0x000C:</tt> AES INTEN Register */ |
| 93 | + __IO uint32_t fifo; /**< <tt>\b 0x0010:</tt> AES FIFO Register */ |
| 94 | +} mxc_aes_regs_t; |
| 95 | + |
| 96 | +/* Register offsets for module AES */ |
| 97 | +/** |
| 98 | + * @ingroup aes_registers |
| 99 | + * @defgroup AES_Register_Offsets Register Offsets |
| 100 | + * @brief AES Peripheral Register Offsets from the AES Base Peripheral Address. |
| 101 | + * @{ |
| 102 | + */ |
| 103 | + #define MXC_R_AES_CTRL ((uint32_t)0x00000000UL) /**< Offset from AES Base Address: <tt> 0x0000</tt> */ |
| 104 | + #define MXC_R_AES_STATUS ((uint32_t)0x00000004UL) /**< Offset from AES Base Address: <tt> 0x0004</tt> */ |
| 105 | + #define MXC_R_AES_INTFL ((uint32_t)0x00000008UL) /**< Offset from AES Base Address: <tt> 0x0008</tt> */ |
| 106 | + #define MXC_R_AES_INTEN ((uint32_t)0x0000000CUL) /**< Offset from AES Base Address: <tt> 0x000C</tt> */ |
| 107 | + #define MXC_R_AES_FIFO ((uint32_t)0x00000010UL) /**< Offset from AES Base Address: <tt> 0x0010</tt> */ |
| 108 | +/**@} end of group aes_registers */ |
| 109 | + |
| 110 | +/** |
| 111 | + * @ingroup aes_registers |
| 112 | + * @defgroup AES_CTRL AES_CTRL |
| 113 | + * @brief AES Control Register |
| 114 | + * @{ |
| 115 | + */ |
| 116 | + #define MXC_F_AES_CTRL_EN_POS 0 /**< CTRL_EN Position */ |
| 117 | + #define MXC_F_AES_CTRL_EN ((uint32_t)(0x1UL << MXC_F_AES_CTRL_EN_POS)) /**< CTRL_EN Mask */ |
| 118 | + |
| 119 | + #define MXC_F_AES_CTRL_DMA_RX_EN_POS 1 /**< CTRL_DMA_RX_EN Position */ |
| 120 | + #define MXC_F_AES_CTRL_DMA_RX_EN ((uint32_t)(0x1UL << MXC_F_AES_CTRL_DMA_RX_EN_POS)) /**< CTRL_DMA_RX_EN Mask */ |
| 121 | + |
| 122 | + #define MXC_F_AES_CTRL_DMA_TX_EN_POS 2 /**< CTRL_DMA_TX_EN Position */ |
| 123 | + #define MXC_F_AES_CTRL_DMA_TX_EN ((uint32_t)(0x1UL << MXC_F_AES_CTRL_DMA_TX_EN_POS)) /**< CTRL_DMA_TX_EN Mask */ |
| 124 | + |
| 125 | + #define MXC_F_AES_CTRL_START_POS 3 /**< CTRL_START Position */ |
| 126 | + #define MXC_F_AES_CTRL_START ((uint32_t)(0x1UL << MXC_F_AES_CTRL_START_POS)) /**< CTRL_START Mask */ |
| 127 | + |
| 128 | + #define MXC_F_AES_CTRL_INPUT_FLUSH_POS 4 /**< CTRL_INPUT_FLUSH Position */ |
| 129 | + #define MXC_F_AES_CTRL_INPUT_FLUSH ((uint32_t)(0x1UL << MXC_F_AES_CTRL_INPUT_FLUSH_POS)) /**< CTRL_INPUT_FLUSH Mask */ |
| 130 | + |
| 131 | + #define MXC_F_AES_CTRL_OUTPUT_FLUSH_POS 5 /**< CTRL_OUTPUT_FLUSH Position */ |
| 132 | + #define MXC_F_AES_CTRL_OUTPUT_FLUSH ((uint32_t)(0x1UL << MXC_F_AES_CTRL_OUTPUT_FLUSH_POS)) /**< CTRL_OUTPUT_FLUSH Mask */ |
| 133 | + |
| 134 | + #define MXC_F_AES_CTRL_KEY_SIZE_POS 6 /**< CTRL_KEY_SIZE Position */ |
| 135 | + #define MXC_F_AES_CTRL_KEY_SIZE ((uint32_t)(0x3UL << MXC_F_AES_CTRL_KEY_SIZE_POS)) /**< CTRL_KEY_SIZE Mask */ |
| 136 | + #define MXC_V_AES_CTRL_KEY_SIZE_AES128 ((uint32_t)0x0UL) /**< CTRL_KEY_SIZE_AES128 Value */ |
| 137 | + #define MXC_S_AES_CTRL_KEY_SIZE_AES128 (MXC_V_AES_CTRL_KEY_SIZE_AES128 << MXC_F_AES_CTRL_KEY_SIZE_POS) /**< CTRL_KEY_SIZE_AES128 Setting */ |
| 138 | + #define MXC_V_AES_CTRL_KEY_SIZE_AES192 ((uint32_t)0x1UL) /**< CTRL_KEY_SIZE_AES192 Value */ |
| 139 | + #define MXC_S_AES_CTRL_KEY_SIZE_AES192 (MXC_V_AES_CTRL_KEY_SIZE_AES192 << MXC_F_AES_CTRL_KEY_SIZE_POS) /**< CTRL_KEY_SIZE_AES192 Setting */ |
| 140 | + #define MXC_V_AES_CTRL_KEY_SIZE_AES256 ((uint32_t)0x2UL) /**< CTRL_KEY_SIZE_AES256 Value */ |
| 141 | + #define MXC_S_AES_CTRL_KEY_SIZE_AES256 (MXC_V_AES_CTRL_KEY_SIZE_AES256 << MXC_F_AES_CTRL_KEY_SIZE_POS) /**< CTRL_KEY_SIZE_AES256 Setting */ |
| 142 | + |
| 143 | + #define MXC_F_AES_CTRL_TYPE_POS 8 /**< CTRL_TYPE Position */ |
| 144 | + #define MXC_F_AES_CTRL_TYPE ((uint32_t)(0x3UL << MXC_F_AES_CTRL_TYPE_POS)) /**< CTRL_TYPE Mask */ |
| 145 | + |
| 146 | +/**@} end of group AES_CTRL_Register */ |
| 147 | + |
| 148 | +/** |
| 149 | + * @ingroup aes_registers |
| 150 | + * @defgroup AES_STATUS AES_STATUS |
| 151 | + * @brief AES Status Register |
| 152 | + * @{ |
| 153 | + */ |
| 154 | + #define MXC_F_AES_STATUS_BUSY_POS 0 /**< STATUS_BUSY Position */ |
| 155 | + #define MXC_F_AES_STATUS_BUSY ((uint32_t)(0x1UL << MXC_F_AES_STATUS_BUSY_POS)) /**< STATUS_BUSY Mask */ |
| 156 | + |
| 157 | + #define MXC_F_AES_STATUS_INPUT_EM_POS 1 /**< STATUS_INPUT_EM Position */ |
| 158 | + #define MXC_F_AES_STATUS_INPUT_EM ((uint32_t)(0x1UL << MXC_F_AES_STATUS_INPUT_EM_POS)) /**< STATUS_INPUT_EM Mask */ |
| 159 | + |
| 160 | + #define MXC_F_AES_STATUS_INPUT_FULL_POS 2 /**< STATUS_INPUT_FULL Position */ |
| 161 | + #define MXC_F_AES_STATUS_INPUT_FULL ((uint32_t)(0x1UL << MXC_F_AES_STATUS_INPUT_FULL_POS)) /**< STATUS_INPUT_FULL Mask */ |
| 162 | + |
| 163 | + #define MXC_F_AES_STATUS_OUTPUT_EM_POS 3 /**< STATUS_OUTPUT_EM Position */ |
| 164 | + #define MXC_F_AES_STATUS_OUTPUT_EM ((uint32_t)(0x1UL << MXC_F_AES_STATUS_OUTPUT_EM_POS)) /**< STATUS_OUTPUT_EM Mask */ |
| 165 | + |
| 166 | + #define MXC_F_AES_STATUS_OUTPUT_FULL_POS 4 /**< STATUS_OUTPUT_FULL Position */ |
| 167 | + #define MXC_F_AES_STATUS_OUTPUT_FULL ((uint32_t)(0x1UL << MXC_F_AES_STATUS_OUTPUT_FULL_POS)) /**< STATUS_OUTPUT_FULL Mask */ |
| 168 | + |
| 169 | +/**@} end of group AES_STATUS_Register */ |
| 170 | + |
| 171 | +/** |
| 172 | + * @ingroup aes_registers |
| 173 | + * @defgroup AES_INTFL AES_INTFL |
| 174 | + * @brief AES Interrupt Flag Register |
| 175 | + * @{ |
| 176 | + */ |
| 177 | + #define MXC_F_AES_INTFL_DONE_POS 0 /**< INTFL_DONE Position */ |
| 178 | + #define MXC_F_AES_INTFL_DONE ((uint32_t)(0x1UL << MXC_F_AES_INTFL_DONE_POS)) /**< INTFL_DONE Mask */ |
| 179 | + |
| 180 | + #define MXC_F_AES_INTFL_KEY_CHANGE_POS 1 /**< INTFL_KEY_CHANGE Position */ |
| 181 | + #define MXC_F_AES_INTFL_KEY_CHANGE ((uint32_t)(0x1UL << MXC_F_AES_INTFL_KEY_CHANGE_POS)) /**< INTFL_KEY_CHANGE Mask */ |
| 182 | + |
| 183 | + #define MXC_F_AES_INTFL_KEY_ZERO_POS 2 /**< INTFL_KEY_ZERO Position */ |
| 184 | + #define MXC_F_AES_INTFL_KEY_ZERO ((uint32_t)(0x1UL << MXC_F_AES_INTFL_KEY_ZERO_POS)) /**< INTFL_KEY_ZERO Mask */ |
| 185 | + |
| 186 | + #define MXC_F_AES_INTFL_OV_POS 3 /**< INTFL_OV Position */ |
| 187 | + #define MXC_F_AES_INTFL_OV ((uint32_t)(0x1UL << MXC_F_AES_INTFL_OV_POS)) /**< INTFL_OV Mask */ |
| 188 | + |
| 189 | +/**@} end of group AES_INTFL_Register */ |
| 190 | + |
| 191 | +/** |
| 192 | + * @ingroup aes_registers |
| 193 | + * @defgroup AES_INTEN AES_INTEN |
| 194 | + * @brief AES Interrupt Enable Register |
| 195 | + * @{ |
| 196 | + */ |
| 197 | + #define MXC_F_AES_INTEN_DONE_POS 0 /**< INTEN_DONE Position */ |
| 198 | + #define MXC_F_AES_INTEN_DONE ((uint32_t)(0x1UL << MXC_F_AES_INTEN_DONE_POS)) /**< INTEN_DONE Mask */ |
| 199 | + |
| 200 | + #define MXC_F_AES_INTEN_KEY_CHANGE_POS 1 /**< INTEN_KEY_CHANGE Position */ |
| 201 | + #define MXC_F_AES_INTEN_KEY_CHANGE ((uint32_t)(0x1UL << MXC_F_AES_INTEN_KEY_CHANGE_POS)) /**< INTEN_KEY_CHANGE Mask */ |
| 202 | + |
| 203 | + #define MXC_F_AES_INTEN_KEY_ZERO_POS 2 /**< INTEN_KEY_ZERO Position */ |
| 204 | + #define MXC_F_AES_INTEN_KEY_ZERO ((uint32_t)(0x1UL << MXC_F_AES_INTEN_KEY_ZERO_POS)) /**< INTEN_KEY_ZERO Mask */ |
| 205 | + |
| 206 | + #define MXC_F_AES_INTEN_OV_POS 3 /**< INTEN_OV Position */ |
| 207 | + #define MXC_F_AES_INTEN_OV ((uint32_t)(0x1UL << MXC_F_AES_INTEN_OV_POS)) /**< INTEN_OV Mask */ |
| 208 | + |
| 209 | +/**@} end of group AES_INTEN_Register */ |
| 210 | + |
| 211 | +/** |
| 212 | + * @ingroup aes_registers |
| 213 | + * @defgroup AES_FIFO AES_FIFO |
| 214 | + * @brief AES Data Register |
| 215 | + * @{ |
| 216 | + */ |
| 217 | + #define MXC_F_AES_FIFO_DATA_POS 0 /**< FIFO_DATA Position */ |
| 218 | + #define MXC_F_AES_FIFO_DATA ((uint32_t)(0x1UL << MXC_F_AES_FIFO_DATA_POS)) /**< FIFO_DATA Mask */ |
| 219 | + |
| 220 | +/**@} end of group AES_FIFO_Register */ |
| 221 | + |
| 222 | +#ifdef __cplusplus |
| 223 | +} |
| 224 | +#endif |
| 225 | + |
| 226 | +#endif /* _AES_REGS_H_ */ |
0 commit comments