mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Tue Jun 09 14:29:26 2015 +0100
Revision:
101:7cff1c4259d7
Release 101 of the mbed library

Changes:
- new platform: APPNEARME_MICRONFCBOARD, MTS_DRAGONFLY_F411RE, MAX32600MBED, WIZwiki_W7500
- Silabs memory optimization in gpio, pwm fixes
- SPI - ssel documentation fixes and its use

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 101:7cff1c4259d7 1 /*******************************************************************************
Kojto 101:7cff1c4259d7 2 * Copyright (C) 2015 Maxim Integrated Products, Inc., All Rights Reserved.
Kojto 101:7cff1c4259d7 3 *
Kojto 101:7cff1c4259d7 4 * Permission is hereby granted, free of charge, to any person obtaining a
Kojto 101:7cff1c4259d7 5 * copy of this software and associated documentation files (the "Software"),
Kojto 101:7cff1c4259d7 6 * to deal in the Software without restriction, including without limitation
Kojto 101:7cff1c4259d7 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
Kojto 101:7cff1c4259d7 8 * and/or sell copies of the Software, and to permit persons to whom the
Kojto 101:7cff1c4259d7 9 * Software is furnished to do so, subject to the following conditions:
Kojto 101:7cff1c4259d7 10 *
Kojto 101:7cff1c4259d7 11 * The above copyright notice and this permission notice shall be included
Kojto 101:7cff1c4259d7 12 * in all copies or substantial portions of the Software.
Kojto 101:7cff1c4259d7 13 *
Kojto 101:7cff1c4259d7 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
Kojto 101:7cff1c4259d7 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Kojto 101:7cff1c4259d7 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Kojto 101:7cff1c4259d7 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
Kojto 101:7cff1c4259d7 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
Kojto 101:7cff1c4259d7 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
Kojto 101:7cff1c4259d7 20 * OTHER DEALINGS IN THE SOFTWARE.
Kojto 101:7cff1c4259d7 21 *
Kojto 101:7cff1c4259d7 22 * Except as contained in this notice, the name of Maxim Integrated
Kojto 101:7cff1c4259d7 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
Kojto 101:7cff1c4259d7 24 * Products, Inc. Branding Policy.
Kojto 101:7cff1c4259d7 25 *
Kojto 101:7cff1c4259d7 26 * The mere transfer of this software does not imply any licenses
Kojto 101:7cff1c4259d7 27 * of trade secrets, proprietary technology, copyrights, patents,
Kojto 101:7cff1c4259d7 28 * trademarks, maskwork rights, or any other form of intellectual
Kojto 101:7cff1c4259d7 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
Kojto 101:7cff1c4259d7 30 * ownership rights.
Kojto 101:7cff1c4259d7 31 *******************************************************************************
Kojto 101:7cff1c4259d7 32 */
Kojto 101:7cff1c4259d7 33
Kojto 101:7cff1c4259d7 34 #ifndef _MXC_AES_REGS_H_
Kojto 101:7cff1c4259d7 35 #define _MXC_AES_REGS_H_
Kojto 101:7cff1c4259d7 36
Kojto 101:7cff1c4259d7 37 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 38 extern "C" {
Kojto 101:7cff1c4259d7 39 #endif
Kojto 101:7cff1c4259d7 40
Kojto 101:7cff1c4259d7 41 #include <stdint.h>
Kojto 101:7cff1c4259d7 42
Kojto 101:7cff1c4259d7 43 /**
Kojto 101:7cff1c4259d7 44 * @file aes_regs.h
Kojto 101:7cff1c4259d7 45 * @addtogroup aes AES
Kojto 101:7cff1c4259d7 46 * @{
Kojto 101:7cff1c4259d7 47 */
Kojto 101:7cff1c4259d7 48
Kojto 101:7cff1c4259d7 49 /**
Kojto 101:7cff1c4259d7 50 * @brief Settings for AES_CTRL.CRYPT_MODE
Kojto 101:7cff1c4259d7 51 */
Kojto 101:7cff1c4259d7 52 typedef enum {
Kojto 101:7cff1c4259d7 53 MXC_E_AES_CTRL_ENCRYPT_MODE = 0,
Kojto 101:7cff1c4259d7 54 MXC_E_AES_CTRL_DECRYPT_MODE = 1
Kojto 101:7cff1c4259d7 55 } mxc_aes_ctrl_crypt_mode_t;
Kojto 101:7cff1c4259d7 56
Kojto 101:7cff1c4259d7 57 /**
Kojto 101:7cff1c4259d7 58 * @brief Settings for AES_CTRL.EXP_KEY_MODE
Kojto 101:7cff1c4259d7 59 */
Kojto 101:7cff1c4259d7 60 typedef enum {
Kojto 101:7cff1c4259d7 61 MXC_E_AES_CTRL_CALC_NEW_EXP_KEY = 0,
Kojto 101:7cff1c4259d7 62 MXC_E_AES_CTRL_USE_LAST_EXP_KEY = 1
Kojto 101:7cff1c4259d7 63 } mxc_aes_ctrl_exp_key_mode_t;
Kojto 101:7cff1c4259d7 64
Kojto 101:7cff1c4259d7 65 /**
Kojto 101:7cff1c4259d7 66 * @brief Settings for AES_CTRL.KEY_SIZE
Kojto 101:7cff1c4259d7 67 */
Kojto 101:7cff1c4259d7 68 typedef enum {
Kojto 101:7cff1c4259d7 69 MXC_E_AES_CTRL_KEY_SIZE_128 = 0,
Kojto 101:7cff1c4259d7 70 MXC_E_AES_CTRL_KEY_SIZE_192 = 1,
Kojto 101:7cff1c4259d7 71 MXC_E_AES_CTRL_KEY_SIZE_256 = 2
Kojto 101:7cff1c4259d7 72 } mxc_aes_ctrl_key_size_t;
Kojto 101:7cff1c4259d7 73
Kojto 101:7cff1c4259d7 74 /* Offset Register Description
Kojto 101:7cff1c4259d7 75 ====== =========================================================== */
Kojto 101:7cff1c4259d7 76 typedef struct {
Kojto 101:7cff1c4259d7 77 __IO uint32_t ctrl; /* 0x0000 AES Control and Status */
Kojto 101:7cff1c4259d7 78 __I uint32_t rsv004; /* 0x0004 */
Kojto 101:7cff1c4259d7 79 __IO uint32_t erase_all; /* 0x0008 Write to Trigger AES Memory Erase */
Kojto 101:7cff1c4259d7 80 } mxc_aes_regs_t;
Kojto 101:7cff1c4259d7 81
Kojto 101:7cff1c4259d7 82 /* Offset Register Description
Kojto 101:7cff1c4259d7 83 ====== =========================================================== */
Kojto 101:7cff1c4259d7 84 typedef struct {
Kojto 101:7cff1c4259d7 85 __IO uint32_t inp[4]; /* 0x0000 AES Input 0..3 */
Kojto 101:7cff1c4259d7 86 __IO uint32_t key[8]; /* 0x0010 AES Key 0..7 */
Kojto 101:7cff1c4259d7 87 __IO uint32_t out[4]; /* 0x0030 AES Output 0..3 */
Kojto 101:7cff1c4259d7 88 __IO uint32_t expkey[8]; /* 0x0040 AES Expanded Key Data 0..7 */
Kojto 101:7cff1c4259d7 89 } mxc_aes_mem_regs_t;
Kojto 101:7cff1c4259d7 90
Kojto 101:7cff1c4259d7 91 /*
Kojto 101:7cff1c4259d7 92 Register offsets for module AES.
Kojto 101:7cff1c4259d7 93 */
Kojto 101:7cff1c4259d7 94 #define MXC_R_AES_OFFS_CTRL ((uint32_t)0x00000000UL)
Kojto 101:7cff1c4259d7 95 #define MXC_R_AES_OFFS_ERASE_ALL ((uint32_t)0x00000008UL)
Kojto 101:7cff1c4259d7 96 #define MXC_R_AES_MEM_OFFS_INP0 ((uint32_t)0x00000000UL)
Kojto 101:7cff1c4259d7 97 #define MXC_R_AES_MEM_OFFS_INP1 ((uint32_t)0x00000004UL)
Kojto 101:7cff1c4259d7 98 #define MXC_R_AES_MEM_OFFS_INP2 ((uint32_t)0x00000008UL)
Kojto 101:7cff1c4259d7 99 #define MXC_R_AES_MEM_OFFS_INP3 ((uint32_t)0x0000000CUL)
Kojto 101:7cff1c4259d7 100 #define MXC_R_AES_MEM_OFFS_KEY0 ((uint32_t)0x00000010UL)
Kojto 101:7cff1c4259d7 101 #define MXC_R_AES_MEM_OFFS_KEY1 ((uint32_t)0x00000014UL)
Kojto 101:7cff1c4259d7 102 #define MXC_R_AES_MEM_OFFS_KEY2 ((uint32_t)0x00000018UL)
Kojto 101:7cff1c4259d7 103 #define MXC_R_AES_MEM_OFFS_KEY3 ((uint32_t)0x0000001CUL)
Kojto 101:7cff1c4259d7 104 #define MXC_R_AES_MEM_OFFS_KEY4 ((uint32_t)0x00000020UL)
Kojto 101:7cff1c4259d7 105 #define MXC_R_AES_MEM_OFFS_KEY5 ((uint32_t)0x00000024UL)
Kojto 101:7cff1c4259d7 106 #define MXC_R_AES_MEM_OFFS_KEY6 ((uint32_t)0x00000028UL)
Kojto 101:7cff1c4259d7 107 #define MXC_R_AES_MEM_OFFS_KEY7 ((uint32_t)0x0000002CUL)
Kojto 101:7cff1c4259d7 108 #define MXC_R_AES_MEM_OFFS_OUT0 ((uint32_t)0x00000030UL)
Kojto 101:7cff1c4259d7 109 #define MXC_R_AES_MEM_OFFS_OUT1 ((uint32_t)0x00000034UL)
Kojto 101:7cff1c4259d7 110 #define MXC_R_AES_MEM_OFFS_OUT2 ((uint32_t)0x00000038UL)
Kojto 101:7cff1c4259d7 111 #define MXC_R_AES_MEM_OFFS_OUT3 ((uint32_t)0x0000003CUL)
Kojto 101:7cff1c4259d7 112 #define MXC_R_AES_MEM_OFFS_EXPKEY0 ((uint32_t)0x00000040UL)
Kojto 101:7cff1c4259d7 113 #define MXC_R_AES_MEM_OFFS_EXPKEY1 ((uint32_t)0x00000044UL)
Kojto 101:7cff1c4259d7 114 #define MXC_R_AES_MEM_OFFS_EXPKEY2 ((uint32_t)0x00000048UL)
Kojto 101:7cff1c4259d7 115 #define MXC_R_AES_MEM_OFFS_EXPKEY3 ((uint32_t)0x0000004CUL)
Kojto 101:7cff1c4259d7 116 #define MXC_R_AES_MEM_OFFS_EXPKEY4 ((uint32_t)0x00000050UL)
Kojto 101:7cff1c4259d7 117 #define MXC_R_AES_MEM_OFFS_EXPKEY5 ((uint32_t)0x00000054UL)
Kojto 101:7cff1c4259d7 118 #define MXC_R_AES_MEM_OFFS_EXPKEY6 ((uint32_t)0x00000058UL)
Kojto 101:7cff1c4259d7 119 #define MXC_R_AES_MEM_OFFS_EXPKEY7 ((uint32_t)0x0000005CUL)
Kojto 101:7cff1c4259d7 120
Kojto 101:7cff1c4259d7 121 #define MXC_F_AES_CTRL_START_POS 0
Kojto 101:7cff1c4259d7 122 #define MXC_F_AES_CTRL_START ((uint32_t)(0x00000001UL << MXC_F_AES_CTRL_START_POS))
Kojto 101:7cff1c4259d7 123 #define MXC_F_AES_CTRL_CRYPT_MODE_POS 1
Kojto 101:7cff1c4259d7 124 #define MXC_F_AES_CTRL_CRYPT_MODE ((uint32_t)(0x00000001UL << MXC_F_AES_CTRL_CRYPT_MODE_POS))
Kojto 101:7cff1c4259d7 125 #define MXC_F_AES_CTRL_EXP_KEY_MODE_POS 2
Kojto 101:7cff1c4259d7 126 #define MXC_F_AES_CTRL_EXP_KEY_MODE ((uint32_t)(0x00000001UL << MXC_F_AES_CTRL_EXP_KEY_MODE_POS))
Kojto 101:7cff1c4259d7 127 #define MXC_F_AES_CTRL_KEY_SIZE_POS 3
Kojto 101:7cff1c4259d7 128 #define MXC_F_AES_CTRL_KEY_SIZE ((uint32_t)(0x00000003UL << MXC_F_AES_CTRL_KEY_SIZE_POS))
Kojto 101:7cff1c4259d7 129 #define MXC_F_AES_CTRL_INTEN_POS 5
Kojto 101:7cff1c4259d7 130 #define MXC_F_AES_CTRL_INTEN ((uint32_t)(0x00000001UL << MXC_F_AES_CTRL_INTEN_POS))
Kojto 101:7cff1c4259d7 131 #define MXC_F_AES_CTRL_INTFL_POS 6
Kojto 101:7cff1c4259d7 132 #define MXC_F_AES_CTRL_INTFL ((uint32_t)(0x00000001UL << MXC_F_AES_CTRL_INTFL_POS))
Kojto 101:7cff1c4259d7 133
Kojto 101:7cff1c4259d7 134 #define MXC_V_AES_CTRL_ENCRYPT_MODE 0
Kojto 101:7cff1c4259d7 135 #define MXC_V_AES_CTRL_DECRYPT_MODE 1
Kojto 101:7cff1c4259d7 136 #define MXC_S_AES_CTRL_ENCRYPT_MODE ((uint32_t)(MXC_V_AES_CTRL_ENCRYPT_MODE << MXC_F_AES_CTRL_CRYPT_MODE_POS))
Kojto 101:7cff1c4259d7 137 #define MXC_S_AES_CTRL_DECRYPT_MODE ((uint32_t)(MXC_V_AES_CTRL_DECRYPT_MODE << MXC_F_AES_CTRL_CRYPT_MODE_POS))
Kojto 101:7cff1c4259d7 138
Kojto 101:7cff1c4259d7 139 #define MXC_V_AES_CTRL_CALC_NEW_EXP_KEY 0
Kojto 101:7cff1c4259d7 140 #define MXC_V_AES_CTRL_USE_LAST_EXP_KEY 1
Kojto 101:7cff1c4259d7 141 #define MXC_S_AES_CTRL_CALC_NEW_EXP_KEY ((uint32_t)(MXC_V_AES_CTRL_CALC_NEW_EXP_KEY << MXC_F_AES_CTRL_EXP_KEY_MODE_POS))
Kojto 101:7cff1c4259d7 142 #define MXC_S_AES_CTRL_USE_LAST_EXP_KEY ((uint32_t)(MXC_V_AES_CTRL_USE_LAST_EXP_KEY << MXC_F_AES_CTRL_EXP_KEY_MODE_POS))
Kojto 101:7cff1c4259d7 143
Kojto 101:7cff1c4259d7 144 #define MXC_V_AES_CTRL_KEY_SIZE_128 0
Kojto 101:7cff1c4259d7 145 #define MXC_V_AES_CTRL_KEY_SIZE_192 1
Kojto 101:7cff1c4259d7 146 #define MXC_V_AES_CTRL_KEY_SIZE_256 2
Kojto 101:7cff1c4259d7 147 #define MXC_S_AES_CTRL_KEY_SIZE_128 ((uint32_t)(MXC_V_AES_CTRL_KEY_SIZE_128 << MXC_F_AES_CTRL_KEY_SIZE_POS))
Kojto 101:7cff1c4259d7 148 #define MXC_S_AES_CTRL_KEY_SIZE_192 ((uint32_t)(MXC_V_AES_CTRL_KEY_SIZE_192 << MXC_F_AES_CTRL_KEY_SIZE_POS))
Kojto 101:7cff1c4259d7 149 #define MXC_S_AES_CTRL_KEY_SIZE_256 ((uint32_t)(MXC_V_AES_CTRL_KEY_SIZE_256 << MXC_F_AES_CTRL_KEY_SIZE_POS))
Kojto 101:7cff1c4259d7 150
Kojto 101:7cff1c4259d7 151 #ifdef __cplusplus
Kojto 101:7cff1c4259d7 152 }
Kojto 101:7cff1c4259d7 153 #endif
Kojto 101:7cff1c4259d7 154
Kojto 101:7cff1c4259d7 155 /**
Kojto 101:7cff1c4259d7 156 * @}
Kojto 101:7cff1c4259d7 157 */
Kojto 101:7cff1c4259d7 158
Kojto 101:7cff1c4259d7 159 #endif /* _MXC_AES_REGS_H_ */