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

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Kojto
Date:
Wed Aug 05 13:16:35 2015 +0100
Revision:
104:b9ad9a133dc7
Parent:
90:cb3d968589d8
Release 104 of the mbed library:

Changes:
- new platforms: nrf51 microbit
- MAXxxx - fix pwm array search
- LPC8xx - usart enable fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 90:cb3d968589d8 1 /*
Kojto 90:cb3d968589d8 2 ** ###################################################################
Kojto 90:cb3d968589d8 3 ** Compilers: Keil ARM C/C++ Compiler
Kojto 90:cb3d968589d8 4 ** Freescale C/C++ for Embedded ARM
Kojto 90:cb3d968589d8 5 ** GNU C Compiler
Kojto 90:cb3d968589d8 6 ** IAR ANSI C/C++ Compiler for ARM
Kojto 90:cb3d968589d8 7 **
Kojto 90:cb3d968589d8 8 ** Reference manual: K64P144M120SF5RM, Rev.2, January 2014
Kojto 90:cb3d968589d8 9 ** Version: rev. 2.5, 2014-02-10
Kojto 90:cb3d968589d8 10 ** Build: b140604
Kojto 90:cb3d968589d8 11 **
Kojto 90:cb3d968589d8 12 ** Abstract:
Kojto 90:cb3d968589d8 13 ** Extension to the CMSIS register access layer header.
Kojto 90:cb3d968589d8 14 **
Kojto 90:cb3d968589d8 15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
Kojto 90:cb3d968589d8 16 ** All rights reserved.
Kojto 90:cb3d968589d8 17 **
Kojto 90:cb3d968589d8 18 ** Redistribution and use in source and binary forms, with or without modification,
Kojto 90:cb3d968589d8 19 ** are permitted provided that the following conditions are met:
Kojto 90:cb3d968589d8 20 **
Kojto 90:cb3d968589d8 21 ** o Redistributions of source code must retain the above copyright notice, this list
Kojto 90:cb3d968589d8 22 ** of conditions and the following disclaimer.
Kojto 90:cb3d968589d8 23 **
Kojto 90:cb3d968589d8 24 ** o Redistributions in binary form must reproduce the above copyright notice, this
Kojto 90:cb3d968589d8 25 ** list of conditions and the following disclaimer in the documentation and/or
Kojto 90:cb3d968589d8 26 ** other materials provided with the distribution.
Kojto 90:cb3d968589d8 27 **
Kojto 90:cb3d968589d8 28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
Kojto 90:cb3d968589d8 29 ** contributors may be used to endorse or promote products derived from this
Kojto 90:cb3d968589d8 30 ** software without specific prior written permission.
Kojto 90:cb3d968589d8 31 **
Kojto 90:cb3d968589d8 32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
Kojto 90:cb3d968589d8 33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Kojto 90:cb3d968589d8 34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 90:cb3d968589d8 35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
Kojto 90:cb3d968589d8 36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Kojto 90:cb3d968589d8 37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
Kojto 90:cb3d968589d8 38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
Kojto 90:cb3d968589d8 39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Kojto 90:cb3d968589d8 40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
Kojto 90:cb3d968589d8 41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 90:cb3d968589d8 42 **
Kojto 90:cb3d968589d8 43 ** http: www.freescale.com
Kojto 90:cb3d968589d8 44 ** mail: support@freescale.com
Kojto 90:cb3d968589d8 45 **
Kojto 90:cb3d968589d8 46 ** Revisions:
Kojto 90:cb3d968589d8 47 ** - rev. 1.0 (2013-08-12)
Kojto 90:cb3d968589d8 48 ** Initial version.
Kojto 90:cb3d968589d8 49 ** - rev. 2.0 (2013-10-29)
Kojto 90:cb3d968589d8 50 ** Register accessor macros added to the memory map.
Kojto 90:cb3d968589d8 51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
Kojto 90:cb3d968589d8 52 ** Startup file for gcc has been updated according to CMSIS 3.2.
Kojto 90:cb3d968589d8 53 ** System initialization updated.
Kojto 90:cb3d968589d8 54 ** MCG - registers updated.
Kojto 90:cb3d968589d8 55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
Kojto 90:cb3d968589d8 56 ** - rev. 2.1 (2013-10-30)
Kojto 90:cb3d968589d8 57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
Kojto 90:cb3d968589d8 58 ** - rev. 2.2 (2013-12-09)
Kojto 90:cb3d968589d8 59 ** DMA - EARS register removed.
Kojto 90:cb3d968589d8 60 ** AIPS0, AIPS1 - MPRA register updated.
Kojto 90:cb3d968589d8 61 ** - rev. 2.3 (2014-01-24)
Kojto 90:cb3d968589d8 62 ** Update according to reference manual rev. 2
Kojto 90:cb3d968589d8 63 ** ENET, MCG, MCM, SIM, USB - registers updated
Kojto 90:cb3d968589d8 64 ** - rev. 2.4 (2014-02-10)
Kojto 90:cb3d968589d8 65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
Kojto 90:cb3d968589d8 66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
Kojto 90:cb3d968589d8 67 ** - rev. 2.5 (2014-02-10)
Kojto 90:cb3d968589d8 68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
Kojto 90:cb3d968589d8 69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
Kojto 90:cb3d968589d8 70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
Kojto 90:cb3d968589d8 71 **
Kojto 90:cb3d968589d8 72 ** ###################################################################
Kojto 90:cb3d968589d8 73 */
Kojto 90:cb3d968589d8 74
Kojto 90:cb3d968589d8 75 /*
Kojto 90:cb3d968589d8 76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
Kojto 90:cb3d968589d8 77 *
Kojto 90:cb3d968589d8 78 * This file was generated automatically and any changes may be lost.
Kojto 90:cb3d968589d8 79 */
Kojto 90:cb3d968589d8 80 #ifndef __HW_RFVBAT_REGISTERS_H__
Kojto 90:cb3d968589d8 81 #define __HW_RFVBAT_REGISTERS_H__
Kojto 90:cb3d968589d8 82
Kojto 90:cb3d968589d8 83 #include "MK64F12.h"
Kojto 90:cb3d968589d8 84 #include "fsl_bitaccess.h"
Kojto 90:cb3d968589d8 85
Kojto 90:cb3d968589d8 86 /*
Kojto 90:cb3d968589d8 87 * MK64F12 RFVBAT
Kojto 90:cb3d968589d8 88 *
Kojto 90:cb3d968589d8 89 * VBAT register file
Kojto 90:cb3d968589d8 90 *
Kojto 90:cb3d968589d8 91 * Registers defined in this header file:
Kojto 90:cb3d968589d8 92 * - HW_RFVBAT_REGn - VBAT register file register
Kojto 90:cb3d968589d8 93 *
Kojto 90:cb3d968589d8 94 * - hw_rfvbat_t - Struct containing all module registers.
Kojto 90:cb3d968589d8 95 */
Kojto 90:cb3d968589d8 96
Kojto 90:cb3d968589d8 97 #define HW_RFVBAT_INSTANCE_COUNT (1U) /*!< Number of instances of the RFVBAT module. */
Kojto 90:cb3d968589d8 98
Kojto 90:cb3d968589d8 99 /*******************************************************************************
Kojto 90:cb3d968589d8 100 * HW_RFVBAT_REGn - VBAT register file register
Kojto 90:cb3d968589d8 101 ******************************************************************************/
Kojto 90:cb3d968589d8 102
Kojto 90:cb3d968589d8 103 /*!
Kojto 90:cb3d968589d8 104 * @brief HW_RFVBAT_REGn - VBAT register file register (RW)
Kojto 90:cb3d968589d8 105 *
Kojto 90:cb3d968589d8 106 * Reset value: 0x00000000U
Kojto 90:cb3d968589d8 107 *
Kojto 90:cb3d968589d8 108 * Each register can be accessed as 8-, 16-, or 32-bits.
Kojto 90:cb3d968589d8 109 */
Kojto 90:cb3d968589d8 110 typedef union _hw_rfvbat_regn
Kojto 90:cb3d968589d8 111 {
Kojto 90:cb3d968589d8 112 uint32_t U;
Kojto 90:cb3d968589d8 113 struct _hw_rfvbat_regn_bitfields
Kojto 90:cb3d968589d8 114 {
Kojto 90:cb3d968589d8 115 uint32_t LL : 8; /*!< [7:0] */
Kojto 90:cb3d968589d8 116 uint32_t LH : 8; /*!< [15:8] */
Kojto 90:cb3d968589d8 117 uint32_t HL : 8; /*!< [23:16] */
Kojto 90:cb3d968589d8 118 uint32_t HH : 8; /*!< [31:24] */
Kojto 90:cb3d968589d8 119 } B;
Kojto 90:cb3d968589d8 120 } hw_rfvbat_regn_t;
Kojto 90:cb3d968589d8 121
Kojto 90:cb3d968589d8 122 /*!
Kojto 90:cb3d968589d8 123 * @name Constants and macros for entire RFVBAT_REGn register
Kojto 90:cb3d968589d8 124 */
Kojto 90:cb3d968589d8 125 /*@{*/
Kojto 90:cb3d968589d8 126 #define HW_RFVBAT_REGn_COUNT (8U)
Kojto 90:cb3d968589d8 127
Kojto 90:cb3d968589d8 128 #define HW_RFVBAT_REGn_ADDR(x, n) ((x) + 0x0U + (0x4U * (n)))
Kojto 90:cb3d968589d8 129
Kojto 90:cb3d968589d8 130 #define HW_RFVBAT_REGn(x, n) (*(__IO hw_rfvbat_regn_t *) HW_RFVBAT_REGn_ADDR(x, n))
Kojto 90:cb3d968589d8 131 #define HW_RFVBAT_REGn_RD(x, n) (HW_RFVBAT_REGn(x, n).U)
Kojto 90:cb3d968589d8 132 #define HW_RFVBAT_REGn_WR(x, n, v) (HW_RFVBAT_REGn(x, n).U = (v))
Kojto 90:cb3d968589d8 133 #define HW_RFVBAT_REGn_SET(x, n, v) (HW_RFVBAT_REGn_WR(x, n, HW_RFVBAT_REGn_RD(x, n) | (v)))
Kojto 90:cb3d968589d8 134 #define HW_RFVBAT_REGn_CLR(x, n, v) (HW_RFVBAT_REGn_WR(x, n, HW_RFVBAT_REGn_RD(x, n) & ~(v)))
Kojto 90:cb3d968589d8 135 #define HW_RFVBAT_REGn_TOG(x, n, v) (HW_RFVBAT_REGn_WR(x, n, HW_RFVBAT_REGn_RD(x, n) ^ (v)))
Kojto 90:cb3d968589d8 136 /*@}*/
Kojto 90:cb3d968589d8 137
Kojto 90:cb3d968589d8 138 /*
Kojto 90:cb3d968589d8 139 * Constants & macros for individual RFVBAT_REGn bitfields
Kojto 90:cb3d968589d8 140 */
Kojto 90:cb3d968589d8 141
Kojto 90:cb3d968589d8 142 /*!
Kojto 90:cb3d968589d8 143 * @name Register RFVBAT_REGn, field LL[7:0] (RW)
Kojto 90:cb3d968589d8 144 *
Kojto 90:cb3d968589d8 145 * Low lower byte
Kojto 90:cb3d968589d8 146 */
Kojto 90:cb3d968589d8 147 /*@{*/
Kojto 90:cb3d968589d8 148 #define BP_RFVBAT_REGn_LL (0U) /*!< Bit position for RFVBAT_REGn_LL. */
Kojto 90:cb3d968589d8 149 #define BM_RFVBAT_REGn_LL (0x000000FFU) /*!< Bit mask for RFVBAT_REGn_LL. */
Kojto 90:cb3d968589d8 150 #define BS_RFVBAT_REGn_LL (8U) /*!< Bit field size in bits for RFVBAT_REGn_LL. */
Kojto 90:cb3d968589d8 151
Kojto 90:cb3d968589d8 152 /*! @brief Read current value of the RFVBAT_REGn_LL field. */
Kojto 90:cb3d968589d8 153 #define BR_RFVBAT_REGn_LL(x, n) (HW_RFVBAT_REGn(x, n).B.LL)
Kojto 90:cb3d968589d8 154
Kojto 90:cb3d968589d8 155 /*! @brief Format value for bitfield RFVBAT_REGn_LL. */
Kojto 90:cb3d968589d8 156 #define BF_RFVBAT_REGn_LL(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_LL) & BM_RFVBAT_REGn_LL)
Kojto 90:cb3d968589d8 157
Kojto 90:cb3d968589d8 158 /*! @brief Set the LL field to a new value. */
Kojto 90:cb3d968589d8 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)))
Kojto 90:cb3d968589d8 160 /*@}*/
Kojto 90:cb3d968589d8 161
Kojto 90:cb3d968589d8 162 /*!
Kojto 90:cb3d968589d8 163 * @name Register RFVBAT_REGn, field LH[15:8] (RW)
Kojto 90:cb3d968589d8 164 *
Kojto 90:cb3d968589d8 165 * Low higher byte
Kojto 90:cb3d968589d8 166 */
Kojto 90:cb3d968589d8 167 /*@{*/
Kojto 90:cb3d968589d8 168 #define BP_RFVBAT_REGn_LH (8U) /*!< Bit position for RFVBAT_REGn_LH. */
Kojto 90:cb3d968589d8 169 #define BM_RFVBAT_REGn_LH (0x0000FF00U) /*!< Bit mask for RFVBAT_REGn_LH. */
Kojto 90:cb3d968589d8 170 #define BS_RFVBAT_REGn_LH (8U) /*!< Bit field size in bits for RFVBAT_REGn_LH. */
Kojto 90:cb3d968589d8 171
Kojto 90:cb3d968589d8 172 /*! @brief Read current value of the RFVBAT_REGn_LH field. */
Kojto 90:cb3d968589d8 173 #define BR_RFVBAT_REGn_LH(x, n) (HW_RFVBAT_REGn(x, n).B.LH)
Kojto 90:cb3d968589d8 174
Kojto 90:cb3d968589d8 175 /*! @brief Format value for bitfield RFVBAT_REGn_LH. */
Kojto 90:cb3d968589d8 176 #define BF_RFVBAT_REGn_LH(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_LH) & BM_RFVBAT_REGn_LH)
Kojto 90:cb3d968589d8 177
Kojto 90:cb3d968589d8 178 /*! @brief Set the LH field to a new value. */
Kojto 90:cb3d968589d8 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)))
Kojto 90:cb3d968589d8 180 /*@}*/
Kojto 90:cb3d968589d8 181
Kojto 90:cb3d968589d8 182 /*!
Kojto 90:cb3d968589d8 183 * @name Register RFVBAT_REGn, field HL[23:16] (RW)
Kojto 90:cb3d968589d8 184 *
Kojto 90:cb3d968589d8 185 * High lower byte
Kojto 90:cb3d968589d8 186 */
Kojto 90:cb3d968589d8 187 /*@{*/
Kojto 90:cb3d968589d8 188 #define BP_RFVBAT_REGn_HL (16U) /*!< Bit position for RFVBAT_REGn_HL. */
Kojto 90:cb3d968589d8 189 #define BM_RFVBAT_REGn_HL (0x00FF0000U) /*!< Bit mask for RFVBAT_REGn_HL. */
Kojto 90:cb3d968589d8 190 #define BS_RFVBAT_REGn_HL (8U) /*!< Bit field size in bits for RFVBAT_REGn_HL. */
Kojto 90:cb3d968589d8 191
Kojto 90:cb3d968589d8 192 /*! @brief Read current value of the RFVBAT_REGn_HL field. */
Kojto 90:cb3d968589d8 193 #define BR_RFVBAT_REGn_HL(x, n) (HW_RFVBAT_REGn(x, n).B.HL)
Kojto 90:cb3d968589d8 194
Kojto 90:cb3d968589d8 195 /*! @brief Format value for bitfield RFVBAT_REGn_HL. */
Kojto 90:cb3d968589d8 196 #define BF_RFVBAT_REGn_HL(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_HL) & BM_RFVBAT_REGn_HL)
Kojto 90:cb3d968589d8 197
Kojto 90:cb3d968589d8 198 /*! @brief Set the HL field to a new value. */
Kojto 90:cb3d968589d8 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)))
Kojto 90:cb3d968589d8 200 /*@}*/
Kojto 90:cb3d968589d8 201
Kojto 90:cb3d968589d8 202 /*!
Kojto 90:cb3d968589d8 203 * @name Register RFVBAT_REGn, field HH[31:24] (RW)
Kojto 90:cb3d968589d8 204 *
Kojto 90:cb3d968589d8 205 * High higher byte
Kojto 90:cb3d968589d8 206 */
Kojto 90:cb3d968589d8 207 /*@{*/
Kojto 90:cb3d968589d8 208 #define BP_RFVBAT_REGn_HH (24U) /*!< Bit position for RFVBAT_REGn_HH. */
Kojto 90:cb3d968589d8 209 #define BM_RFVBAT_REGn_HH (0xFF000000U) /*!< Bit mask for RFVBAT_REGn_HH. */
Kojto 90:cb3d968589d8 210 #define BS_RFVBAT_REGn_HH (8U) /*!< Bit field size in bits for RFVBAT_REGn_HH. */
Kojto 90:cb3d968589d8 211
Kojto 90:cb3d968589d8 212 /*! @brief Read current value of the RFVBAT_REGn_HH field. */
Kojto 90:cb3d968589d8 213 #define BR_RFVBAT_REGn_HH(x, n) (HW_RFVBAT_REGn(x, n).B.HH)
Kojto 90:cb3d968589d8 214
Kojto 90:cb3d968589d8 215 /*! @brief Format value for bitfield RFVBAT_REGn_HH. */
Kojto 90:cb3d968589d8 216 #define BF_RFVBAT_REGn_HH(v) ((uint32_t)((uint32_t)(v) << BP_RFVBAT_REGn_HH) & BM_RFVBAT_REGn_HH)
Kojto 90:cb3d968589d8 217
Kojto 90:cb3d968589d8 218 /*! @brief Set the HH field to a new value. */
Kojto 90:cb3d968589d8 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)))
Kojto 90:cb3d968589d8 220 /*@}*/
Kojto 90:cb3d968589d8 221
Kojto 90:cb3d968589d8 222 /*******************************************************************************
Kojto 90:cb3d968589d8 223 * hw_rfvbat_t - module struct
Kojto 90:cb3d968589d8 224 ******************************************************************************/
Kojto 90:cb3d968589d8 225 /*!
Kojto 90:cb3d968589d8 226 * @brief All RFVBAT module registers.
Kojto 90:cb3d968589d8 227 */
Kojto 90:cb3d968589d8 228 #pragma pack(1)
Kojto 90:cb3d968589d8 229 typedef struct _hw_rfvbat
Kojto 90:cb3d968589d8 230 {
Kojto 90:cb3d968589d8 231 __IO hw_rfvbat_regn_t REGn[8]; /*!< [0x0] VBAT register file register */
Kojto 90:cb3d968589d8 232 } hw_rfvbat_t;
Kojto 90:cb3d968589d8 233 #pragma pack()
Kojto 90:cb3d968589d8 234
Kojto 90:cb3d968589d8 235 /*! @brief Macro to access all RFVBAT registers. */
Kojto 90:cb3d968589d8 236 /*! @param x RFVBAT module instance base address. */
Kojto 90:cb3d968589d8 237 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
Kojto 90:cb3d968589d8 238 * use the '&' operator, like <code>&HW_RFVBAT(RFVBAT_BASE)</code>. */
Kojto 90:cb3d968589d8 239 #define HW_RFVBAT(x) (*(hw_rfvbat_t *)(x))
Kojto 90:cb3d968589d8 240
Kojto 90:cb3d968589d8 241 #endif /* __HW_RFVBAT_REGISTERS_H__ */
Kojto 90:cb3d968589d8 242 /* EOF */