mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Sep 18 14:00:17 2014 +0100
Revision:
324:406fd2029f23
Synchronized with git revision a73f28e6fbca9559fbed2726410eeb4c0534a4a5

Full URL: https://github.com/mbedmicro/mbed/commit/a73f28e6fbca9559fbed2726410eeb4c0534a4a5/

Extended #476, which does not break ethernet for K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 324:406fd2029f23 1 /*
mbed_official 324:406fd2029f23 2 ** ###################################################################
mbed_official 324:406fd2029f23 3 ** Compilers: Keil ARM C/C++ Compiler
mbed_official 324:406fd2029f23 4 ** Freescale C/C++ for Embedded ARM
mbed_official 324:406fd2029f23 5 ** GNU C Compiler
mbed_official 324:406fd2029f23 6 ** IAR ANSI C/C++ Compiler for ARM
mbed_official 324:406fd2029f23 7 **
mbed_official 324:406fd2029f23 8 ** Reference manual: K22P121M120SF7RM, Rev. 1, March 24, 2014
mbed_official 324:406fd2029f23 9 ** Version: rev. 2.5, 2014-05-06
mbed_official 324:406fd2029f23 10 ** Build: b140604
mbed_official 324:406fd2029f23 11 **
mbed_official 324:406fd2029f23 12 ** Abstract:
mbed_official 324:406fd2029f23 13 ** Extension to the CMSIS register access layer header.
mbed_official 324:406fd2029f23 14 **
mbed_official 324:406fd2029f23 15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
mbed_official 324:406fd2029f23 16 ** All rights reserved.
mbed_official 324:406fd2029f23 17 **
mbed_official 324:406fd2029f23 18 ** Redistribution and use in source and binary forms, with or without modification,
mbed_official 324:406fd2029f23 19 ** are permitted provided that the following conditions are met:
mbed_official 324:406fd2029f23 20 **
mbed_official 324:406fd2029f23 21 ** o Redistributions of source code must retain the above copyright notice, this list
mbed_official 324:406fd2029f23 22 ** of conditions and the following disclaimer.
mbed_official 324:406fd2029f23 23 **
mbed_official 324:406fd2029f23 24 ** o Redistributions in binary form must reproduce the above copyright notice, this
mbed_official 324:406fd2029f23 25 ** list of conditions and the following disclaimer in the documentation and/or
mbed_official 324:406fd2029f23 26 ** other materials provided with the distribution.
mbed_official 324:406fd2029f23 27 **
mbed_official 324:406fd2029f23 28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
mbed_official 324:406fd2029f23 29 ** contributors may be used to endorse or promote products derived from this
mbed_official 324:406fd2029f23 30 ** software without specific prior written permission.
mbed_official 324:406fd2029f23 31 **
mbed_official 324:406fd2029f23 32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 324:406fd2029f23 33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 324:406fd2029f23 34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 324:406fd2029f23 35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
mbed_official 324:406fd2029f23 36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 324:406fd2029f23 37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 324:406fd2029f23 38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
mbed_official 324:406fd2029f23 39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 324:406fd2029f23 40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 324:406fd2029f23 41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 324:406fd2029f23 42 **
mbed_official 324:406fd2029f23 43 ** http: www.freescale.com
mbed_official 324:406fd2029f23 44 ** mail: support@freescale.com
mbed_official 324:406fd2029f23 45 **
mbed_official 324:406fd2029f23 46 ** Revisions:
mbed_official 324:406fd2029f23 47 ** - rev. 1.0 (2013-07-23)
mbed_official 324:406fd2029f23 48 ** Initial version.
mbed_official 324:406fd2029f23 49 ** - rev. 1.1 (2013-09-17)
mbed_official 324:406fd2029f23 50 ** RM rev. 0.4 update.
mbed_official 324:406fd2029f23 51 ** - rev. 2.0 (2013-10-29)
mbed_official 324:406fd2029f23 52 ** Register accessor macros added to the memory map.
mbed_official 324:406fd2029f23 53 ** Symbols for Processor Expert memory map compatibility added to the memory map.
mbed_official 324:406fd2029f23 54 ** Startup file for gcc has been updated according to CMSIS 3.2.
mbed_official 324:406fd2029f23 55 ** System initialization updated.
mbed_official 324:406fd2029f23 56 ** - rev. 2.1 (2013-10-30)
mbed_official 324:406fd2029f23 57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
mbed_official 324:406fd2029f23 58 ** - rev. 2.2 (2013-12-20)
mbed_official 324:406fd2029f23 59 ** Update according to reference manual rev. 0.6,
mbed_official 324:406fd2029f23 60 ** - rev. 2.3 (2014-01-13)
mbed_official 324:406fd2029f23 61 ** Update according to reference manual rev. 0.61,
mbed_official 324:406fd2029f23 62 ** - rev. 2.4 (2014-02-10)
mbed_official 324:406fd2029f23 63 ** The declaration of clock configurations has been moved to separate header file system_MK22F51212.h
mbed_official 324:406fd2029f23 64 ** - rev. 2.5 (2014-05-06)
mbed_official 324:406fd2029f23 65 ** Update according to reference manual rev. 1.0,
mbed_official 324:406fd2029f23 66 ** Update of system and startup files.
mbed_official 324:406fd2029f23 67 ** Module access macro module_BASES replaced by module_BASE_PTRS.
mbed_official 324:406fd2029f23 68 **
mbed_official 324:406fd2029f23 69 ** ###################################################################
mbed_official 324:406fd2029f23 70 */
mbed_official 324:406fd2029f23 71
mbed_official 324:406fd2029f23 72 /*
mbed_official 324:406fd2029f23 73 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
mbed_official 324:406fd2029f23 74 *
mbed_official 324:406fd2029f23 75 * This file was generated automatically and any changes may be lost.
mbed_official 324:406fd2029f23 76 */
mbed_official 324:406fd2029f23 77 #ifndef __HW_RFSYS_REGISTERS_H__
mbed_official 324:406fd2029f23 78 #define __HW_RFSYS_REGISTERS_H__
mbed_official 324:406fd2029f23 79
mbed_official 324:406fd2029f23 80 #include "MK22F51212.h"
mbed_official 324:406fd2029f23 81 #include "fsl_bitaccess.h"
mbed_official 324:406fd2029f23 82
mbed_official 324:406fd2029f23 83 /*
mbed_official 324:406fd2029f23 84 * MK22F51212 RFSYS
mbed_official 324:406fd2029f23 85 *
mbed_official 324:406fd2029f23 86 * System register file
mbed_official 324:406fd2029f23 87 *
mbed_official 324:406fd2029f23 88 * Registers defined in this header file:
mbed_official 324:406fd2029f23 89 * - HW_RFSYS_REGn - Register file register
mbed_official 324:406fd2029f23 90 *
mbed_official 324:406fd2029f23 91 * - hw_rfsys_t - Struct containing all module registers.
mbed_official 324:406fd2029f23 92 */
mbed_official 324:406fd2029f23 93
mbed_official 324:406fd2029f23 94 #define HW_RFSYS_INSTANCE_COUNT (1U) /*!< Number of instances of the RFSYS module. */
mbed_official 324:406fd2029f23 95
mbed_official 324:406fd2029f23 96 /*******************************************************************************
mbed_official 324:406fd2029f23 97 * HW_RFSYS_REGn - Register file register
mbed_official 324:406fd2029f23 98 ******************************************************************************/
mbed_official 324:406fd2029f23 99
mbed_official 324:406fd2029f23 100 /*!
mbed_official 324:406fd2029f23 101 * @brief HW_RFSYS_REGn - Register file register (RW)
mbed_official 324:406fd2029f23 102 *
mbed_official 324:406fd2029f23 103 * Reset value: 0x00000000U
mbed_official 324:406fd2029f23 104 *
mbed_official 324:406fd2029f23 105 * Each register can be accessed as 8-, 16-, or 32-bits.
mbed_official 324:406fd2029f23 106 */
mbed_official 324:406fd2029f23 107 typedef union _hw_rfsys_regn
mbed_official 324:406fd2029f23 108 {
mbed_official 324:406fd2029f23 109 uint32_t U;
mbed_official 324:406fd2029f23 110 struct _hw_rfsys_regn_bitfields
mbed_official 324:406fd2029f23 111 {
mbed_official 324:406fd2029f23 112 uint32_t LL : 8; /*!< [7:0] */
mbed_official 324:406fd2029f23 113 uint32_t LH : 8; /*!< [15:8] */
mbed_official 324:406fd2029f23 114 uint32_t HL : 8; /*!< [23:16] */
mbed_official 324:406fd2029f23 115 uint32_t HH : 8; /*!< [31:24] */
mbed_official 324:406fd2029f23 116 } B;
mbed_official 324:406fd2029f23 117 } hw_rfsys_regn_t;
mbed_official 324:406fd2029f23 118
mbed_official 324:406fd2029f23 119 /*!
mbed_official 324:406fd2029f23 120 * @name Constants and macros for entire RFSYS_REGn register
mbed_official 324:406fd2029f23 121 */
mbed_official 324:406fd2029f23 122 /*@{*/
mbed_official 324:406fd2029f23 123 #define HW_RFSYS_REGn_COUNT (8U)
mbed_official 324:406fd2029f23 124
mbed_official 324:406fd2029f23 125 #define HW_RFSYS_REGn_ADDR(x, n) ((x) + 0x0U + (0x4U * (n)))
mbed_official 324:406fd2029f23 126
mbed_official 324:406fd2029f23 127 #define HW_RFSYS_REGn(x, n) (*(__IO hw_rfsys_regn_t *) HW_RFSYS_REGn_ADDR(x, n))
mbed_official 324:406fd2029f23 128 #define HW_RFSYS_REGn_RD(x, n) (HW_RFSYS_REGn(x, n).U)
mbed_official 324:406fd2029f23 129 #define HW_RFSYS_REGn_WR(x, n, v) (HW_RFSYS_REGn(x, n).U = (v))
mbed_official 324:406fd2029f23 130 #define HW_RFSYS_REGn_SET(x, n, v) (HW_RFSYS_REGn_WR(x, n, HW_RFSYS_REGn_RD(x, n) | (v)))
mbed_official 324:406fd2029f23 131 #define HW_RFSYS_REGn_CLR(x, n, v) (HW_RFSYS_REGn_WR(x, n, HW_RFSYS_REGn_RD(x, n) & ~(v)))
mbed_official 324:406fd2029f23 132 #define HW_RFSYS_REGn_TOG(x, n, v) (HW_RFSYS_REGn_WR(x, n, HW_RFSYS_REGn_RD(x, n) ^ (v)))
mbed_official 324:406fd2029f23 133 /*@}*/
mbed_official 324:406fd2029f23 134
mbed_official 324:406fd2029f23 135 /*
mbed_official 324:406fd2029f23 136 * Constants & macros for individual RFSYS_REGn bitfields
mbed_official 324:406fd2029f23 137 */
mbed_official 324:406fd2029f23 138
mbed_official 324:406fd2029f23 139 /*!
mbed_official 324:406fd2029f23 140 * @name Register RFSYS_REGn, field LL[7:0] (RW)
mbed_official 324:406fd2029f23 141 *
mbed_official 324:406fd2029f23 142 * Low lower byte
mbed_official 324:406fd2029f23 143 */
mbed_official 324:406fd2029f23 144 /*@{*/
mbed_official 324:406fd2029f23 145 #define BP_RFSYS_REGn_LL (0U) /*!< Bit position for RFSYS_REGn_LL. */
mbed_official 324:406fd2029f23 146 #define BM_RFSYS_REGn_LL (0x000000FFU) /*!< Bit mask for RFSYS_REGn_LL. */
mbed_official 324:406fd2029f23 147 #define BS_RFSYS_REGn_LL (8U) /*!< Bit field size in bits for RFSYS_REGn_LL. */
mbed_official 324:406fd2029f23 148
mbed_official 324:406fd2029f23 149 /*! @brief Read current value of the RFSYS_REGn_LL field. */
mbed_official 324:406fd2029f23 150 #define BR_RFSYS_REGn_LL(x, n) (HW_RFSYS_REGn(x, n).B.LL)
mbed_official 324:406fd2029f23 151
mbed_official 324:406fd2029f23 152 /*! @brief Format value for bitfield RFSYS_REGn_LL. */
mbed_official 324:406fd2029f23 153 #define BF_RFSYS_REGn_LL(v) ((uint32_t)((uint32_t)(v) << BP_RFSYS_REGn_LL) & BM_RFSYS_REGn_LL)
mbed_official 324:406fd2029f23 154
mbed_official 324:406fd2029f23 155 /*! @brief Set the LL field to a new value. */
mbed_official 324:406fd2029f23 156 #define BW_RFSYS_REGn_LL(x, n, v) (HW_RFSYS_REGn_WR(x, n, (HW_RFSYS_REGn_RD(x, n) & ~BM_RFSYS_REGn_LL) | BF_RFSYS_REGn_LL(v)))
mbed_official 324:406fd2029f23 157 /*@}*/
mbed_official 324:406fd2029f23 158
mbed_official 324:406fd2029f23 159 /*!
mbed_official 324:406fd2029f23 160 * @name Register RFSYS_REGn, field LH[15:8] (RW)
mbed_official 324:406fd2029f23 161 *
mbed_official 324:406fd2029f23 162 * Low higher byte
mbed_official 324:406fd2029f23 163 */
mbed_official 324:406fd2029f23 164 /*@{*/
mbed_official 324:406fd2029f23 165 #define BP_RFSYS_REGn_LH (8U) /*!< Bit position for RFSYS_REGn_LH. */
mbed_official 324:406fd2029f23 166 #define BM_RFSYS_REGn_LH (0x0000FF00U) /*!< Bit mask for RFSYS_REGn_LH. */
mbed_official 324:406fd2029f23 167 #define BS_RFSYS_REGn_LH (8U) /*!< Bit field size in bits for RFSYS_REGn_LH. */
mbed_official 324:406fd2029f23 168
mbed_official 324:406fd2029f23 169 /*! @brief Read current value of the RFSYS_REGn_LH field. */
mbed_official 324:406fd2029f23 170 #define BR_RFSYS_REGn_LH(x, n) (HW_RFSYS_REGn(x, n).B.LH)
mbed_official 324:406fd2029f23 171
mbed_official 324:406fd2029f23 172 /*! @brief Format value for bitfield RFSYS_REGn_LH. */
mbed_official 324:406fd2029f23 173 #define BF_RFSYS_REGn_LH(v) ((uint32_t)((uint32_t)(v) << BP_RFSYS_REGn_LH) & BM_RFSYS_REGn_LH)
mbed_official 324:406fd2029f23 174
mbed_official 324:406fd2029f23 175 /*! @brief Set the LH field to a new value. */
mbed_official 324:406fd2029f23 176 #define BW_RFSYS_REGn_LH(x, n, v) (HW_RFSYS_REGn_WR(x, n, (HW_RFSYS_REGn_RD(x, n) & ~BM_RFSYS_REGn_LH) | BF_RFSYS_REGn_LH(v)))
mbed_official 324:406fd2029f23 177 /*@}*/
mbed_official 324:406fd2029f23 178
mbed_official 324:406fd2029f23 179 /*!
mbed_official 324:406fd2029f23 180 * @name Register RFSYS_REGn, field HL[23:16] (RW)
mbed_official 324:406fd2029f23 181 *
mbed_official 324:406fd2029f23 182 * High lower byte
mbed_official 324:406fd2029f23 183 */
mbed_official 324:406fd2029f23 184 /*@{*/
mbed_official 324:406fd2029f23 185 #define BP_RFSYS_REGn_HL (16U) /*!< Bit position for RFSYS_REGn_HL. */
mbed_official 324:406fd2029f23 186 #define BM_RFSYS_REGn_HL (0x00FF0000U) /*!< Bit mask for RFSYS_REGn_HL. */
mbed_official 324:406fd2029f23 187 #define BS_RFSYS_REGn_HL (8U) /*!< Bit field size in bits for RFSYS_REGn_HL. */
mbed_official 324:406fd2029f23 188
mbed_official 324:406fd2029f23 189 /*! @brief Read current value of the RFSYS_REGn_HL field. */
mbed_official 324:406fd2029f23 190 #define BR_RFSYS_REGn_HL(x, n) (HW_RFSYS_REGn(x, n).B.HL)
mbed_official 324:406fd2029f23 191
mbed_official 324:406fd2029f23 192 /*! @brief Format value for bitfield RFSYS_REGn_HL. */
mbed_official 324:406fd2029f23 193 #define BF_RFSYS_REGn_HL(v) ((uint32_t)((uint32_t)(v) << BP_RFSYS_REGn_HL) & BM_RFSYS_REGn_HL)
mbed_official 324:406fd2029f23 194
mbed_official 324:406fd2029f23 195 /*! @brief Set the HL field to a new value. */
mbed_official 324:406fd2029f23 196 #define BW_RFSYS_REGn_HL(x, n, v) (HW_RFSYS_REGn_WR(x, n, (HW_RFSYS_REGn_RD(x, n) & ~BM_RFSYS_REGn_HL) | BF_RFSYS_REGn_HL(v)))
mbed_official 324:406fd2029f23 197 /*@}*/
mbed_official 324:406fd2029f23 198
mbed_official 324:406fd2029f23 199 /*!
mbed_official 324:406fd2029f23 200 * @name Register RFSYS_REGn, field HH[31:24] (RW)
mbed_official 324:406fd2029f23 201 *
mbed_official 324:406fd2029f23 202 * High higher byte
mbed_official 324:406fd2029f23 203 */
mbed_official 324:406fd2029f23 204 /*@{*/
mbed_official 324:406fd2029f23 205 #define BP_RFSYS_REGn_HH (24U) /*!< Bit position for RFSYS_REGn_HH. */
mbed_official 324:406fd2029f23 206 #define BM_RFSYS_REGn_HH (0xFF000000U) /*!< Bit mask for RFSYS_REGn_HH. */
mbed_official 324:406fd2029f23 207 #define BS_RFSYS_REGn_HH (8U) /*!< Bit field size in bits for RFSYS_REGn_HH. */
mbed_official 324:406fd2029f23 208
mbed_official 324:406fd2029f23 209 /*! @brief Read current value of the RFSYS_REGn_HH field. */
mbed_official 324:406fd2029f23 210 #define BR_RFSYS_REGn_HH(x, n) (HW_RFSYS_REGn(x, n).B.HH)
mbed_official 324:406fd2029f23 211
mbed_official 324:406fd2029f23 212 /*! @brief Format value for bitfield RFSYS_REGn_HH. */
mbed_official 324:406fd2029f23 213 #define BF_RFSYS_REGn_HH(v) ((uint32_t)((uint32_t)(v) << BP_RFSYS_REGn_HH) & BM_RFSYS_REGn_HH)
mbed_official 324:406fd2029f23 214
mbed_official 324:406fd2029f23 215 /*! @brief Set the HH field to a new value. */
mbed_official 324:406fd2029f23 216 #define BW_RFSYS_REGn_HH(x, n, v) (HW_RFSYS_REGn_WR(x, n, (HW_RFSYS_REGn_RD(x, n) & ~BM_RFSYS_REGn_HH) | BF_RFSYS_REGn_HH(v)))
mbed_official 324:406fd2029f23 217 /*@}*/
mbed_official 324:406fd2029f23 218
mbed_official 324:406fd2029f23 219 /*******************************************************************************
mbed_official 324:406fd2029f23 220 * hw_rfsys_t - module struct
mbed_official 324:406fd2029f23 221 ******************************************************************************/
mbed_official 324:406fd2029f23 222 /*!
mbed_official 324:406fd2029f23 223 * @brief All RFSYS module registers.
mbed_official 324:406fd2029f23 224 */
mbed_official 324:406fd2029f23 225 #pragma pack(1)
mbed_official 324:406fd2029f23 226 typedef struct _hw_rfsys
mbed_official 324:406fd2029f23 227 {
mbed_official 324:406fd2029f23 228 __IO hw_rfsys_regn_t REGn[8]; /*!< [0x0] Register file register */
mbed_official 324:406fd2029f23 229 } hw_rfsys_t;
mbed_official 324:406fd2029f23 230 #pragma pack()
mbed_official 324:406fd2029f23 231
mbed_official 324:406fd2029f23 232 /*! @brief Macro to access all RFSYS registers. */
mbed_official 324:406fd2029f23 233 /*! @param x RFSYS module instance base address. */
mbed_official 324:406fd2029f23 234 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
mbed_official 324:406fd2029f23 235 * use the '&' operator, like <code>&HW_RFSYS(RFSYS_BASE)</code>. */
mbed_official 324:406fd2029f23 236 #define HW_RFSYS(x) (*(hw_rfsys_t *)(x))
mbed_official 324:406fd2029f23 237
mbed_official 324:406fd2029f23 238 #endif /* __HW_RFSYS_REGISTERS_H__ */
mbed_official 324:406fd2029f23 239 /* EOF */