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: K64P144M120SF5RM, Rev.2, January 2014
mbed_official 324:406fd2029f23 9 ** Version: rev. 2.5, 2014-02-10
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-08-12)
mbed_official 324:406fd2029f23 48 ** Initial version.
mbed_official 324:406fd2029f23 49 ** - rev. 2.0 (2013-10-29)
mbed_official 324:406fd2029f23 50 ** Register accessor macros added to the memory map.
mbed_official 324:406fd2029f23 51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
mbed_official 324:406fd2029f23 52 ** Startup file for gcc has been updated according to CMSIS 3.2.
mbed_official 324:406fd2029f23 53 ** System initialization updated.
mbed_official 324:406fd2029f23 54 ** MCG - registers updated.
mbed_official 324:406fd2029f23 55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
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-09)
mbed_official 324:406fd2029f23 59 ** DMA - EARS register removed.
mbed_official 324:406fd2029f23 60 ** AIPS0, AIPS1 - MPRA register updated.
mbed_official 324:406fd2029f23 61 ** - rev. 2.3 (2014-01-24)
mbed_official 324:406fd2029f23 62 ** Update according to reference manual rev. 2
mbed_official 324:406fd2029f23 63 ** ENET, MCG, MCM, SIM, USB - registers updated
mbed_official 324:406fd2029f23 64 ** - rev. 2.4 (2014-02-10)
mbed_official 324:406fd2029f23 65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
mbed_official 324:406fd2029f23 66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
mbed_official 324:406fd2029f23 67 ** - rev. 2.5 (2014-02-10)
mbed_official 324:406fd2029f23 68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
mbed_official 324:406fd2029f23 69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
mbed_official 324:406fd2029f23 70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
mbed_official 324:406fd2029f23 71 **
mbed_official 324:406fd2029f23 72 ** ###################################################################
mbed_official 324:406fd2029f23 73 */
mbed_official 324:406fd2029f23 74
mbed_official 324:406fd2029f23 75 /*
mbed_official 324:406fd2029f23 76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
mbed_official 324:406fd2029f23 77 *
mbed_official 324:406fd2029f23 78 * This file was generated automatically and any changes may be lost.
mbed_official 324:406fd2029f23 79 */
mbed_official 324:406fd2029f23 80 #ifndef __HW_RFVBAT_REGISTERS_H__
mbed_official 324:406fd2029f23 81 #define __HW_RFVBAT_REGISTERS_H__
mbed_official 324:406fd2029f23 82
mbed_official 324:406fd2029f23 83 #include "MK64F12.h"
mbed_official 324:406fd2029f23 84 #include "fsl_bitaccess.h"
mbed_official 324:406fd2029f23 85
mbed_official 324:406fd2029f23 86 /*
mbed_official 324:406fd2029f23 87 * MK64F12 RFVBAT
mbed_official 324:406fd2029f23 88 *
mbed_official 324:406fd2029f23 89 * VBAT register file
mbed_official 324:406fd2029f23 90 *
mbed_official 324:406fd2029f23 91 * Registers defined in this header file:
mbed_official 324:406fd2029f23 92 * - HW_RFVBAT_REGn - VBAT register file register
mbed_official 324:406fd2029f23 93 *
mbed_official 324:406fd2029f23 94 * - hw_rfvbat_t - Struct containing all module registers.
mbed_official 324:406fd2029f23 95 */
mbed_official 324:406fd2029f23 96
mbed_official 324:406fd2029f23 97 #define HW_RFVBAT_INSTANCE_COUNT (1U) /*!< Number of instances of the RFVBAT module. */
mbed_official 324:406fd2029f23 98
mbed_official 324:406fd2029f23 99 /*******************************************************************************
mbed_official 324:406fd2029f23 100 * HW_RFVBAT_REGn - VBAT register file register
mbed_official 324:406fd2029f23 101 ******************************************************************************/
mbed_official 324:406fd2029f23 102
mbed_official 324:406fd2029f23 103 /*!
mbed_official 324:406fd2029f23 104 * @brief HW_RFVBAT_REGn - VBAT register file register (RW)
mbed_official 324:406fd2029f23 105 *
mbed_official 324:406fd2029f23 106 * Reset value: 0x00000000U
mbed_official 324:406fd2029f23 107 *
mbed_official 324:406fd2029f23 108 * Each register can be accessed as 8-, 16-, or 32-bits.
mbed_official 324:406fd2029f23 109 */
mbed_official 324:406fd2029f23 110 typedef union _hw_rfvbat_regn
mbed_official 324:406fd2029f23 111 {
mbed_official 324:406fd2029f23 112 uint32_t U;
mbed_official 324:406fd2029f23 113 struct _hw_rfvbat_regn_bitfields
mbed_official 324:406fd2029f23 114 {
mbed_official 324:406fd2029f23 115 uint32_t LL : 8; /*!< [7:0] */
mbed_official 324:406fd2029f23 116 uint32_t LH : 8; /*!< [15:8] */
mbed_official 324:406fd2029f23 117 uint32_t HL : 8; /*!< [23:16] */
mbed_official 324:406fd2029f23 118 uint32_t HH : 8; /*!< [31:24] */
mbed_official 324:406fd2029f23 119 } B;
mbed_official 324:406fd2029f23 120 } hw_rfvbat_regn_t;
mbed_official 324:406fd2029f23 121
mbed_official 324:406fd2029f23 122 /*!
mbed_official 324:406fd2029f23 123 * @name Constants and macros for entire RFVBAT_REGn register
mbed_official 324:406fd2029f23 124 */
mbed_official 324:406fd2029f23 125 /*@{*/
mbed_official 324:406fd2029f23 126 #define HW_RFVBAT_REGn_COUNT (8U)
mbed_official 324:406fd2029f23 127
mbed_official 324:406fd2029f23 128 #define HW_RFVBAT_REGn_ADDR(x, n) ((x) + 0x0U + (0x4U * (n)))
mbed_official 324:406fd2029f23 129
mbed_official 324:406fd2029f23 130 #define HW_RFVBAT_REGn(x, n) (*(__IO hw_rfvbat_regn_t *) HW_RFVBAT_REGn_ADDR(x, n))
mbed_official 324:406fd2029f23 131 #define HW_RFVBAT_REGn_RD(x, n) (HW_RFVBAT_REGn(x, n).U)
mbed_official 324:406fd2029f23 132 #define HW_RFVBAT_REGn_WR(x, n, v) (HW_RFVBAT_REGn(x, n).U = (v))
mbed_official 324:406fd2029f23 133 #define HW_RFVBAT_REGn_SET(x, n, v) (HW_RFVBAT_REGn_WR(x, n, HW_RFVBAT_REGn_RD(x, n) | (v)))
mbed_official 324:406fd2029f23 134 #define HW_RFVBAT_REGn_CLR(x, n, v) (HW_RFVBAT_REGn_WR(x, n, HW_RFVBAT_REGn_RD(x, n) & ~(v)))
mbed_official 324:406fd2029f23 135 #define HW_RFVBAT_REGn_TOG(x, n, v) (HW_RFVBAT_REGn_WR(x, n, HW_RFVBAT_REGn_RD(x, n) ^ (v)))
mbed_official 324:406fd2029f23 136 /*@}*/
mbed_official 324:406fd2029f23 137
mbed_official 324:406fd2029f23 138 /*
mbed_official 324:406fd2029f23 139 * Constants & macros for individual RFVBAT_REGn bitfields
mbed_official 324:406fd2029f23 140 */
mbed_official 324:406fd2029f23 141
mbed_official 324:406fd2029f23 142 /*!
mbed_official 324:406fd2029f23 143 * @name Register RFVBAT_REGn, field LL[7:0] (RW)
mbed_official 324:406fd2029f23 144 *
mbed_official 324:406fd2029f23 145 * Low lower byte
mbed_official 324:406fd2029f23 146 */
mbed_official 324:406fd2029f23 147 /*@{*/
mbed_official 324:406fd2029f23 148 #define BP_RFVBAT_REGn_LL (0U) /*!< Bit position for RFVBAT_REGn_LL. */
mbed_official 324:406fd2029f23 149 #define BM_RFVBAT_REGn_LL (0x000000FFU) /*!< Bit mask for RFVBAT_REGn_LL. */
mbed_official 324:406fd2029f23 150 #define BS_RFVBAT_REGn_LL (8U) /*!< Bit field size in bits for RFVBAT_REGn_LL. */
mbed_official 324:406fd2029f23 151
mbed_official 324:406fd2029f23 152 /*! @brief Read current value of the RFVBAT_REGn_LL field. */
mbed_official 324:406fd2029f23 153 #define BR_RFVBAT_REGn_LL(x, n) (HW_RFVBAT_REGn(x, n).B.LL)
mbed_official 324:406fd2029f23 154
mbed_official 324:406fd2029f23 155 /*! @brief Format value for bitfield RFVBAT_REGn_LL. */
mbed_official 324:406fd2029f23 156 #define BF_RFVBAT_REGn_LL(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_LL) & BM_RFVBAT_REGn_LL)
mbed_official 324:406fd2029f23 157
mbed_official 324:406fd2029f23 158 /*! @brief Set the LL field to a new value. */
mbed_official 324:406fd2029f23 159 #define BW_RFVBAT_REGn_LL(x, n, v) (HW_RFVBAT_REGn_WR(x, n, (HW_RFVBAT_REGn_RD(x, n) & ~BM_RFVBAT_REGn_LL) | BF_RFVBAT_REGn_LL(v)))
mbed_official 324:406fd2029f23 160 /*@}*/
mbed_official 324:406fd2029f23 161
mbed_official 324:406fd2029f23 162 /*!
mbed_official 324:406fd2029f23 163 * @name Register RFVBAT_REGn, field LH[15:8] (RW)
mbed_official 324:406fd2029f23 164 *
mbed_official 324:406fd2029f23 165 * Low higher byte
mbed_official 324:406fd2029f23 166 */
mbed_official 324:406fd2029f23 167 /*@{*/
mbed_official 324:406fd2029f23 168 #define BP_RFVBAT_REGn_LH (8U) /*!< Bit position for RFVBAT_REGn_LH. */
mbed_official 324:406fd2029f23 169 #define BM_RFVBAT_REGn_LH (0x0000FF00U) /*!< Bit mask for RFVBAT_REGn_LH. */
mbed_official 324:406fd2029f23 170 #define BS_RFVBAT_REGn_LH (8U) /*!< Bit field size in bits for RFVBAT_REGn_LH. */
mbed_official 324:406fd2029f23 171
mbed_official 324:406fd2029f23 172 /*! @brief Read current value of the RFVBAT_REGn_LH field. */
mbed_official 324:406fd2029f23 173 #define BR_RFVBAT_REGn_LH(x, n) (HW_RFVBAT_REGn(x, n).B.LH)
mbed_official 324:406fd2029f23 174
mbed_official 324:406fd2029f23 175 /*! @brief Format value for bitfield RFVBAT_REGn_LH. */
mbed_official 324:406fd2029f23 176 #define BF_RFVBAT_REGn_LH(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_LH) & BM_RFVBAT_REGn_LH)
mbed_official 324:406fd2029f23 177
mbed_official 324:406fd2029f23 178 /*! @brief Set the LH field to a new value. */
mbed_official 324:406fd2029f23 179 #define BW_RFVBAT_REGn_LH(x, n, v) (HW_RFVBAT_REGn_WR(x, n, (HW_RFVBAT_REGn_RD(x, n) & ~BM_RFVBAT_REGn_LH) | BF_RFVBAT_REGn_LH(v)))
mbed_official 324:406fd2029f23 180 /*@}*/
mbed_official 324:406fd2029f23 181
mbed_official 324:406fd2029f23 182 /*!
mbed_official 324:406fd2029f23 183 * @name Register RFVBAT_REGn, field HL[23:16] (RW)
mbed_official 324:406fd2029f23 184 *
mbed_official 324:406fd2029f23 185 * High lower byte
mbed_official 324:406fd2029f23 186 */
mbed_official 324:406fd2029f23 187 /*@{*/
mbed_official 324:406fd2029f23 188 #define BP_RFVBAT_REGn_HL (16U) /*!< Bit position for RFVBAT_REGn_HL. */
mbed_official 324:406fd2029f23 189 #define BM_RFVBAT_REGn_HL (0x00FF0000U) /*!< Bit mask for RFVBAT_REGn_HL. */
mbed_official 324:406fd2029f23 190 #define BS_RFVBAT_REGn_HL (8U) /*!< Bit field size in bits for RFVBAT_REGn_HL. */
mbed_official 324:406fd2029f23 191
mbed_official 324:406fd2029f23 192 /*! @brief Read current value of the RFVBAT_REGn_HL field. */
mbed_official 324:406fd2029f23 193 #define BR_RFVBAT_REGn_HL(x, n) (HW_RFVBAT_REGn(x, n).B.HL)
mbed_official 324:406fd2029f23 194
mbed_official 324:406fd2029f23 195 /*! @brief Format value for bitfield RFVBAT_REGn_HL. */
mbed_official 324:406fd2029f23 196 #define BF_RFVBAT_REGn_HL(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_HL) & BM_RFVBAT_REGn_HL)
mbed_official 324:406fd2029f23 197
mbed_official 324:406fd2029f23 198 /*! @brief Set the HL field to a new value. */
mbed_official 324:406fd2029f23 199 #define BW_RFVBAT_REGn_HL(x, n, v) (HW_RFVBAT_REGn_WR(x, n, (HW_RFVBAT_REGn_RD(x, n) & ~BM_RFVBAT_REGn_HL) | BF_RFVBAT_REGn_HL(v)))
mbed_official 324:406fd2029f23 200 /*@}*/
mbed_official 324:406fd2029f23 201
mbed_official 324:406fd2029f23 202 /*!
mbed_official 324:406fd2029f23 203 * @name Register RFVBAT_REGn, field HH[31:24] (RW)
mbed_official 324:406fd2029f23 204 *
mbed_official 324:406fd2029f23 205 * High higher byte
mbed_official 324:406fd2029f23 206 */
mbed_official 324:406fd2029f23 207 /*@{*/
mbed_official 324:406fd2029f23 208 #define BP_RFVBAT_REGn_HH (24U) /*!< Bit position for RFVBAT_REGn_HH. */
mbed_official 324:406fd2029f23 209 #define BM_RFVBAT_REGn_HH (0xFF000000U) /*!< Bit mask for RFVBAT_REGn_HH. */
mbed_official 324:406fd2029f23 210 #define BS_RFVBAT_REGn_HH (8U) /*!< Bit field size in bits for RFVBAT_REGn_HH. */
mbed_official 324:406fd2029f23 211
mbed_official 324:406fd2029f23 212 /*! @brief Read current value of the RFVBAT_REGn_HH field. */
mbed_official 324:406fd2029f23 213 #define BR_RFVBAT_REGn_HH(x, n) (HW_RFVBAT_REGn(x, n).B.HH)
mbed_official 324:406fd2029f23 214
mbed_official 324:406fd2029f23 215 /*! @brief Format value for bitfield RFVBAT_REGn_HH. */
mbed_official 324:406fd2029f23 216 #define BF_RFVBAT_REGn_HH(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_HH) & BM_RFVBAT_REGn_HH)
mbed_official 324:406fd2029f23 217
mbed_official 324:406fd2029f23 218 /*! @brief Set the HH field to a new value. */
mbed_official 324:406fd2029f23 219 #define BW_RFVBAT_REGn_HH(x, n, v) (HW_RFVBAT_REGn_WR(x, n, (HW_RFVBAT_REGn_RD(x, n) & ~BM_RFVBAT_REGn_HH) | BF_RFVBAT_REGn_HH(v)))
mbed_official 324:406fd2029f23 220 /*@}*/
mbed_official 324:406fd2029f23 221
mbed_official 324:406fd2029f23 222 /*******************************************************************************
mbed_official 324:406fd2029f23 223 * hw_rfvbat_t - module struct
mbed_official 324:406fd2029f23 224 ******************************************************************************/
mbed_official 324:406fd2029f23 225 /*!
mbed_official 324:406fd2029f23 226 * @brief All RFVBAT module registers.
mbed_official 324:406fd2029f23 227 */
mbed_official 324:406fd2029f23 228 #pragma pack(1)
mbed_official 324:406fd2029f23 229 typedef struct _hw_rfvbat
mbed_official 324:406fd2029f23 230 {
mbed_official 324:406fd2029f23 231 __IO hw_rfvbat_regn_t REGn[8]; /*!< [0x0] VBAT register file register */
mbed_official 324:406fd2029f23 232 } hw_rfvbat_t;
mbed_official 324:406fd2029f23 233 #pragma pack()
mbed_official 324:406fd2029f23 234
mbed_official 324:406fd2029f23 235 /*! @brief Macro to access all RFVBAT registers. */
mbed_official 324:406fd2029f23 236 /*! @param x RFVBAT module instance base address. */
mbed_official 324:406fd2029f23 237 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
mbed_official 324:406fd2029f23 238 * use the '&' operator, like <code>&HW_RFVBAT(RFVBAT_BASE)</code>. */
mbed_official 324:406fd2029f23 239 #define HW_RFVBAT(x) (*(hw_rfvbat_t *)(x))
mbed_official 324:406fd2029f23 240
mbed_official 324:406fd2029f23 241 #endif /* __HW_RFVBAT_REGISTERS_H__ */
mbed_official 324:406fd2029f23 242 /* EOF */