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_OSC_REGISTERS_H__
mbed_official 324:406fd2029f23 81 #define __HW_OSC_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 OSC
mbed_official 324:406fd2029f23 88 *
mbed_official 324:406fd2029f23 89 * Oscillator
mbed_official 324:406fd2029f23 90 *
mbed_official 324:406fd2029f23 91 * Registers defined in this header file:
mbed_official 324:406fd2029f23 92 * - HW_OSC_CR - OSC Control Register
mbed_official 324:406fd2029f23 93 *
mbed_official 324:406fd2029f23 94 * - hw_osc_t - Struct containing all module registers.
mbed_official 324:406fd2029f23 95 */
mbed_official 324:406fd2029f23 96
mbed_official 324:406fd2029f23 97 #define HW_OSC_INSTANCE_COUNT (1U) /*!< Number of instances of the OSC module. */
mbed_official 324:406fd2029f23 98
mbed_official 324:406fd2029f23 99 /*******************************************************************************
mbed_official 324:406fd2029f23 100 * HW_OSC_CR - OSC Control Register
mbed_official 324:406fd2029f23 101 ******************************************************************************/
mbed_official 324:406fd2029f23 102
mbed_official 324:406fd2029f23 103 /*!
mbed_official 324:406fd2029f23 104 * @brief HW_OSC_CR - OSC Control Register (RW)
mbed_official 324:406fd2029f23 105 *
mbed_official 324:406fd2029f23 106 * Reset value: 0x00U
mbed_official 324:406fd2029f23 107 *
mbed_official 324:406fd2029f23 108 * After OSC is enabled and starts generating the clocks, the configurations
mbed_official 324:406fd2029f23 109 * such as low power and frequency range, must not be changed.
mbed_official 324:406fd2029f23 110 */
mbed_official 324:406fd2029f23 111 typedef union _hw_osc_cr
mbed_official 324:406fd2029f23 112 {
mbed_official 324:406fd2029f23 113 uint8_t U;
mbed_official 324:406fd2029f23 114 struct _hw_osc_cr_bitfields
mbed_official 324:406fd2029f23 115 {
mbed_official 324:406fd2029f23 116 uint8_t SC16P : 1; /*!< [0] Oscillator 16 pF Capacitor Load Configure
mbed_official 324:406fd2029f23 117 * */
mbed_official 324:406fd2029f23 118 uint8_t SC8P : 1; /*!< [1] Oscillator 8 pF Capacitor Load Configure */
mbed_official 324:406fd2029f23 119 uint8_t SC4P : 1; /*!< [2] Oscillator 4 pF Capacitor Load Configure */
mbed_official 324:406fd2029f23 120 uint8_t SC2P : 1; /*!< [3] Oscillator 2 pF Capacitor Load Configure */
mbed_official 324:406fd2029f23 121 uint8_t RESERVED0 : 1; /*!< [4] */
mbed_official 324:406fd2029f23 122 uint8_t EREFSTEN : 1; /*!< [5] External Reference Stop Enable */
mbed_official 324:406fd2029f23 123 uint8_t RESERVED1 : 1; /*!< [6] */
mbed_official 324:406fd2029f23 124 uint8_t ERCLKEN : 1; /*!< [7] External Reference Enable */
mbed_official 324:406fd2029f23 125 } B;
mbed_official 324:406fd2029f23 126 } hw_osc_cr_t;
mbed_official 324:406fd2029f23 127
mbed_official 324:406fd2029f23 128 /*!
mbed_official 324:406fd2029f23 129 * @name Constants and macros for entire OSC_CR register
mbed_official 324:406fd2029f23 130 */
mbed_official 324:406fd2029f23 131 /*@{*/
mbed_official 324:406fd2029f23 132 #define HW_OSC_CR_ADDR(x) ((x) + 0x0U)
mbed_official 324:406fd2029f23 133
mbed_official 324:406fd2029f23 134 #define HW_OSC_CR(x) (*(__IO hw_osc_cr_t *) HW_OSC_CR_ADDR(x))
mbed_official 324:406fd2029f23 135 #define HW_OSC_CR_RD(x) (HW_OSC_CR(x).U)
mbed_official 324:406fd2029f23 136 #define HW_OSC_CR_WR(x, v) (HW_OSC_CR(x).U = (v))
mbed_official 324:406fd2029f23 137 #define HW_OSC_CR_SET(x, v) (HW_OSC_CR_WR(x, HW_OSC_CR_RD(x) | (v)))
mbed_official 324:406fd2029f23 138 #define HW_OSC_CR_CLR(x, v) (HW_OSC_CR_WR(x, HW_OSC_CR_RD(x) & ~(v)))
mbed_official 324:406fd2029f23 139 #define HW_OSC_CR_TOG(x, v) (HW_OSC_CR_WR(x, HW_OSC_CR_RD(x) ^ (v)))
mbed_official 324:406fd2029f23 140 /*@}*/
mbed_official 324:406fd2029f23 141
mbed_official 324:406fd2029f23 142 /*
mbed_official 324:406fd2029f23 143 * Constants & macros for individual OSC_CR bitfields
mbed_official 324:406fd2029f23 144 */
mbed_official 324:406fd2029f23 145
mbed_official 324:406fd2029f23 146 /*!
mbed_official 324:406fd2029f23 147 * @name Register OSC_CR, field SC16P[0] (RW)
mbed_official 324:406fd2029f23 148 *
mbed_official 324:406fd2029f23 149 * Configures the oscillator load.
mbed_official 324:406fd2029f23 150 *
mbed_official 324:406fd2029f23 151 * Values:
mbed_official 324:406fd2029f23 152 * - 0 - Disable the selection.
mbed_official 324:406fd2029f23 153 * - 1 - Add 16 pF capacitor to the oscillator load.
mbed_official 324:406fd2029f23 154 */
mbed_official 324:406fd2029f23 155 /*@{*/
mbed_official 324:406fd2029f23 156 #define BP_OSC_CR_SC16P (0U) /*!< Bit position for OSC_CR_SC16P. */
mbed_official 324:406fd2029f23 157 #define BM_OSC_CR_SC16P (0x01U) /*!< Bit mask for OSC_CR_SC16P. */
mbed_official 324:406fd2029f23 158 #define BS_OSC_CR_SC16P (1U) /*!< Bit field size in bits for OSC_CR_SC16P. */
mbed_official 324:406fd2029f23 159
mbed_official 324:406fd2029f23 160 /*! @brief Read current value of the OSC_CR_SC16P field. */
mbed_official 324:406fd2029f23 161 #define BR_OSC_CR_SC16P(x) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC16P))
mbed_official 324:406fd2029f23 162
mbed_official 324:406fd2029f23 163 /*! @brief Format value for bitfield OSC_CR_SC16P. */
mbed_official 324:406fd2029f23 164 #define BF_OSC_CR_SC16P(v) ((uint8_t)((uint8_t)(v) << BP_OSC_CR_SC16P) & BM_OSC_CR_SC16P)
mbed_official 324:406fd2029f23 165
mbed_official 324:406fd2029f23 166 /*! @brief Set the SC16P field to a new value. */
mbed_official 324:406fd2029f23 167 #define BW_OSC_CR_SC16P(x, v) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC16P) = (v))
mbed_official 324:406fd2029f23 168 /*@}*/
mbed_official 324:406fd2029f23 169
mbed_official 324:406fd2029f23 170 /*!
mbed_official 324:406fd2029f23 171 * @name Register OSC_CR, field SC8P[1] (RW)
mbed_official 324:406fd2029f23 172 *
mbed_official 324:406fd2029f23 173 * Configures the oscillator load.
mbed_official 324:406fd2029f23 174 *
mbed_official 324:406fd2029f23 175 * Values:
mbed_official 324:406fd2029f23 176 * - 0 - Disable the selection.
mbed_official 324:406fd2029f23 177 * - 1 - Add 8 pF capacitor to the oscillator load.
mbed_official 324:406fd2029f23 178 */
mbed_official 324:406fd2029f23 179 /*@{*/
mbed_official 324:406fd2029f23 180 #define BP_OSC_CR_SC8P (1U) /*!< Bit position for OSC_CR_SC8P. */
mbed_official 324:406fd2029f23 181 #define BM_OSC_CR_SC8P (0x02U) /*!< Bit mask for OSC_CR_SC8P. */
mbed_official 324:406fd2029f23 182 #define BS_OSC_CR_SC8P (1U) /*!< Bit field size in bits for OSC_CR_SC8P. */
mbed_official 324:406fd2029f23 183
mbed_official 324:406fd2029f23 184 /*! @brief Read current value of the OSC_CR_SC8P field. */
mbed_official 324:406fd2029f23 185 #define BR_OSC_CR_SC8P(x) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC8P))
mbed_official 324:406fd2029f23 186
mbed_official 324:406fd2029f23 187 /*! @brief Format value for bitfield OSC_CR_SC8P. */
mbed_official 324:406fd2029f23 188 #define BF_OSC_CR_SC8P(v) ((uint8_t)((uint8_t)(v) << BP_OSC_CR_SC8P) & BM_OSC_CR_SC8P)
mbed_official 324:406fd2029f23 189
mbed_official 324:406fd2029f23 190 /*! @brief Set the SC8P field to a new value. */
mbed_official 324:406fd2029f23 191 #define BW_OSC_CR_SC8P(x, v) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC8P) = (v))
mbed_official 324:406fd2029f23 192 /*@}*/
mbed_official 324:406fd2029f23 193
mbed_official 324:406fd2029f23 194 /*!
mbed_official 324:406fd2029f23 195 * @name Register OSC_CR, field SC4P[2] (RW)
mbed_official 324:406fd2029f23 196 *
mbed_official 324:406fd2029f23 197 * Configures the oscillator load.
mbed_official 324:406fd2029f23 198 *
mbed_official 324:406fd2029f23 199 * Values:
mbed_official 324:406fd2029f23 200 * - 0 - Disable the selection.
mbed_official 324:406fd2029f23 201 * - 1 - Add 4 pF capacitor to the oscillator load.
mbed_official 324:406fd2029f23 202 */
mbed_official 324:406fd2029f23 203 /*@{*/
mbed_official 324:406fd2029f23 204 #define BP_OSC_CR_SC4P (2U) /*!< Bit position for OSC_CR_SC4P. */
mbed_official 324:406fd2029f23 205 #define BM_OSC_CR_SC4P (0x04U) /*!< Bit mask for OSC_CR_SC4P. */
mbed_official 324:406fd2029f23 206 #define BS_OSC_CR_SC4P (1U) /*!< Bit field size in bits for OSC_CR_SC4P. */
mbed_official 324:406fd2029f23 207
mbed_official 324:406fd2029f23 208 /*! @brief Read current value of the OSC_CR_SC4P field. */
mbed_official 324:406fd2029f23 209 #define BR_OSC_CR_SC4P(x) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC4P))
mbed_official 324:406fd2029f23 210
mbed_official 324:406fd2029f23 211 /*! @brief Format value for bitfield OSC_CR_SC4P. */
mbed_official 324:406fd2029f23 212 #define BF_OSC_CR_SC4P(v) ((uint8_t)((uint8_t)(v) << BP_OSC_CR_SC4P) & BM_OSC_CR_SC4P)
mbed_official 324:406fd2029f23 213
mbed_official 324:406fd2029f23 214 /*! @brief Set the SC4P field to a new value. */
mbed_official 324:406fd2029f23 215 #define BW_OSC_CR_SC4P(x, v) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC4P) = (v))
mbed_official 324:406fd2029f23 216 /*@}*/
mbed_official 324:406fd2029f23 217
mbed_official 324:406fd2029f23 218 /*!
mbed_official 324:406fd2029f23 219 * @name Register OSC_CR, field SC2P[3] (RW)
mbed_official 324:406fd2029f23 220 *
mbed_official 324:406fd2029f23 221 * Configures the oscillator load.
mbed_official 324:406fd2029f23 222 *
mbed_official 324:406fd2029f23 223 * Values:
mbed_official 324:406fd2029f23 224 * - 0 - Disable the selection.
mbed_official 324:406fd2029f23 225 * - 1 - Add 2 pF capacitor to the oscillator load.
mbed_official 324:406fd2029f23 226 */
mbed_official 324:406fd2029f23 227 /*@{*/
mbed_official 324:406fd2029f23 228 #define BP_OSC_CR_SC2P (3U) /*!< Bit position for OSC_CR_SC2P. */
mbed_official 324:406fd2029f23 229 #define BM_OSC_CR_SC2P (0x08U) /*!< Bit mask for OSC_CR_SC2P. */
mbed_official 324:406fd2029f23 230 #define BS_OSC_CR_SC2P (1U) /*!< Bit field size in bits for OSC_CR_SC2P. */
mbed_official 324:406fd2029f23 231
mbed_official 324:406fd2029f23 232 /*! @brief Read current value of the OSC_CR_SC2P field. */
mbed_official 324:406fd2029f23 233 #define BR_OSC_CR_SC2P(x) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC2P))
mbed_official 324:406fd2029f23 234
mbed_official 324:406fd2029f23 235 /*! @brief Format value for bitfield OSC_CR_SC2P. */
mbed_official 324:406fd2029f23 236 #define BF_OSC_CR_SC2P(v) ((uint8_t)((uint8_t)(v) << BP_OSC_CR_SC2P) & BM_OSC_CR_SC2P)
mbed_official 324:406fd2029f23 237
mbed_official 324:406fd2029f23 238 /*! @brief Set the SC2P field to a new value. */
mbed_official 324:406fd2029f23 239 #define BW_OSC_CR_SC2P(x, v) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_SC2P) = (v))
mbed_official 324:406fd2029f23 240 /*@}*/
mbed_official 324:406fd2029f23 241
mbed_official 324:406fd2029f23 242 /*!
mbed_official 324:406fd2029f23 243 * @name Register OSC_CR, field EREFSTEN[5] (RW)
mbed_official 324:406fd2029f23 244 *
mbed_official 324:406fd2029f23 245 * Controls whether or not the external reference clock (OSCERCLK) remains
mbed_official 324:406fd2029f23 246 * enabled when MCU enters Stop mode.
mbed_official 324:406fd2029f23 247 *
mbed_official 324:406fd2029f23 248 * Values:
mbed_official 324:406fd2029f23 249 * - 0 - External reference clock is disabled in Stop mode.
mbed_official 324:406fd2029f23 250 * - 1 - External reference clock stays enabled in Stop mode if ERCLKEN is set
mbed_official 324:406fd2029f23 251 * before entering Stop mode.
mbed_official 324:406fd2029f23 252 */
mbed_official 324:406fd2029f23 253 /*@{*/
mbed_official 324:406fd2029f23 254 #define BP_OSC_CR_EREFSTEN (5U) /*!< Bit position for OSC_CR_EREFSTEN. */
mbed_official 324:406fd2029f23 255 #define BM_OSC_CR_EREFSTEN (0x20U) /*!< Bit mask for OSC_CR_EREFSTEN. */
mbed_official 324:406fd2029f23 256 #define BS_OSC_CR_EREFSTEN (1U) /*!< Bit field size in bits for OSC_CR_EREFSTEN. */
mbed_official 324:406fd2029f23 257
mbed_official 324:406fd2029f23 258 /*! @brief Read current value of the OSC_CR_EREFSTEN field. */
mbed_official 324:406fd2029f23 259 #define BR_OSC_CR_EREFSTEN(x) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_EREFSTEN))
mbed_official 324:406fd2029f23 260
mbed_official 324:406fd2029f23 261 /*! @brief Format value for bitfield OSC_CR_EREFSTEN. */
mbed_official 324:406fd2029f23 262 #define BF_OSC_CR_EREFSTEN(v) ((uint8_t)((uint8_t)(v) << BP_OSC_CR_EREFSTEN) & BM_OSC_CR_EREFSTEN)
mbed_official 324:406fd2029f23 263
mbed_official 324:406fd2029f23 264 /*! @brief Set the EREFSTEN field to a new value. */
mbed_official 324:406fd2029f23 265 #define BW_OSC_CR_EREFSTEN(x, v) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_EREFSTEN) = (v))
mbed_official 324:406fd2029f23 266 /*@}*/
mbed_official 324:406fd2029f23 267
mbed_official 324:406fd2029f23 268 /*!
mbed_official 324:406fd2029f23 269 * @name Register OSC_CR, field ERCLKEN[7] (RW)
mbed_official 324:406fd2029f23 270 *
mbed_official 324:406fd2029f23 271 * Enables external reference clock (OSCERCLK).
mbed_official 324:406fd2029f23 272 *
mbed_official 324:406fd2029f23 273 * Values:
mbed_official 324:406fd2029f23 274 * - 0 - External reference clock is inactive.
mbed_official 324:406fd2029f23 275 * - 1 - External reference clock is enabled.
mbed_official 324:406fd2029f23 276 */
mbed_official 324:406fd2029f23 277 /*@{*/
mbed_official 324:406fd2029f23 278 #define BP_OSC_CR_ERCLKEN (7U) /*!< Bit position for OSC_CR_ERCLKEN. */
mbed_official 324:406fd2029f23 279 #define BM_OSC_CR_ERCLKEN (0x80U) /*!< Bit mask for OSC_CR_ERCLKEN. */
mbed_official 324:406fd2029f23 280 #define BS_OSC_CR_ERCLKEN (1U) /*!< Bit field size in bits for OSC_CR_ERCLKEN. */
mbed_official 324:406fd2029f23 281
mbed_official 324:406fd2029f23 282 /*! @brief Read current value of the OSC_CR_ERCLKEN field. */
mbed_official 324:406fd2029f23 283 #define BR_OSC_CR_ERCLKEN(x) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_ERCLKEN))
mbed_official 324:406fd2029f23 284
mbed_official 324:406fd2029f23 285 /*! @brief Format value for bitfield OSC_CR_ERCLKEN. */
mbed_official 324:406fd2029f23 286 #define BF_OSC_CR_ERCLKEN(v) ((uint8_t)((uint8_t)(v) << BP_OSC_CR_ERCLKEN) & BM_OSC_CR_ERCLKEN)
mbed_official 324:406fd2029f23 287
mbed_official 324:406fd2029f23 288 /*! @brief Set the ERCLKEN field to a new value. */
mbed_official 324:406fd2029f23 289 #define BW_OSC_CR_ERCLKEN(x, v) (BITBAND_ACCESS8(HW_OSC_CR_ADDR(x), BP_OSC_CR_ERCLKEN) = (v))
mbed_official 324:406fd2029f23 290 /*@}*/
mbed_official 324:406fd2029f23 291
mbed_official 324:406fd2029f23 292 /*******************************************************************************
mbed_official 324:406fd2029f23 293 * hw_osc_t - module struct
mbed_official 324:406fd2029f23 294 ******************************************************************************/
mbed_official 324:406fd2029f23 295 /*!
mbed_official 324:406fd2029f23 296 * @brief All OSC module registers.
mbed_official 324:406fd2029f23 297 */
mbed_official 324:406fd2029f23 298 #pragma pack(1)
mbed_official 324:406fd2029f23 299 typedef struct _hw_osc
mbed_official 324:406fd2029f23 300 {
mbed_official 324:406fd2029f23 301 __IO hw_osc_cr_t CR; /*!< [0x0] OSC Control Register */
mbed_official 324:406fd2029f23 302 } hw_osc_t;
mbed_official 324:406fd2029f23 303 #pragma pack()
mbed_official 324:406fd2029f23 304
mbed_official 324:406fd2029f23 305 /*! @brief Macro to access all OSC registers. */
mbed_official 324:406fd2029f23 306 /*! @param x OSC module instance base address. */
mbed_official 324:406fd2029f23 307 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
mbed_official 324:406fd2029f23 308 * use the '&' operator, like <code>&HW_OSC(OSC_BASE)</code>. */
mbed_official 324:406fd2029f23 309 #define HW_OSC(x) (*(hw_osc_t *)(x))
mbed_official 324:406fd2029f23 310
mbed_official 324:406fd2029f23 311 #endif /* __HW_OSC_REGISTERS_H__ */
mbed_official 324:406fd2029f23 312 /* EOF */