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:
Fri Oct 02 07:35:07 2015 +0200
Revision:
108:34e6b704fe68
Child:
115:87f2f5183dfb
Release 108  of the mbed library

Changes:
- new platforms - ELMO_F411RE, WIZNET_7500P, ARM_MPS2_BEID
- EFM32 - bugfixes in rtc, serial
- Cortex A cmsis - update files
- STML4 - RAM fixes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 108:34e6b704fe68 1 /**************************************************************************//**
Kojto 108:34e6b704fe68 2 * @file core_ca9.h
Kojto 108:34e6b704fe68 3 * @brief CMSIS Cortex-A9 Core Peripheral Access Layer Header File
Kojto 108:34e6b704fe68 4 * @version
Kojto 108:34e6b704fe68 5 * @date 25 March 2013
Kojto 108:34e6b704fe68 6 *
Kojto 108:34e6b704fe68 7 * @note
Kojto 108:34e6b704fe68 8 *
Kojto 108:34e6b704fe68 9 ******************************************************************************/
Kojto 108:34e6b704fe68 10 /* Copyright (c) 2009 - 2012 ARM LIMITED
Kojto 108:34e6b704fe68 11
Kojto 108:34e6b704fe68 12 All rights reserved.
Kojto 108:34e6b704fe68 13 Redistribution and use in source and binary forms, with or without
Kojto 108:34e6b704fe68 14 modification, are permitted provided that the following conditions are met:
Kojto 108:34e6b704fe68 15 - Redistributions of source code must retain the above copyright
Kojto 108:34e6b704fe68 16 notice, this list of conditions and the following disclaimer.
Kojto 108:34e6b704fe68 17 - Redistributions in binary form must reproduce the above copyright
Kojto 108:34e6b704fe68 18 notice, this list of conditions and the following disclaimer in the
Kojto 108:34e6b704fe68 19 documentation and/or other materials provided with the distribution.
Kojto 108:34e6b704fe68 20 - Neither the name of ARM nor the names of its contributors may be used
Kojto 108:34e6b704fe68 21 to endorse or promote products derived from this software without
Kojto 108:34e6b704fe68 22 specific prior written permission.
Kojto 108:34e6b704fe68 23 *
Kojto 108:34e6b704fe68 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 108:34e6b704fe68 25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 108:34e6b704fe68 26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Kojto 108:34e6b704fe68 27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
Kojto 108:34e6b704fe68 28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Kojto 108:34e6b704fe68 29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Kojto 108:34e6b704fe68 30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Kojto 108:34e6b704fe68 31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Kojto 108:34e6b704fe68 32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Kojto 108:34e6b704fe68 33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Kojto 108:34e6b704fe68 34 POSSIBILITY OF SUCH DAMAGE.
Kojto 108:34e6b704fe68 35 ---------------------------------------------------------------------------*/
Kojto 108:34e6b704fe68 36
Kojto 108:34e6b704fe68 37
Kojto 108:34e6b704fe68 38 #if defined ( __ICCARM__ )
Kojto 108:34e6b704fe68 39 #pragma system_include /* treat file as system include file for MISRA check */
Kojto 108:34e6b704fe68 40 #endif
Kojto 108:34e6b704fe68 41
Kojto 108:34e6b704fe68 42 #ifdef __cplusplus
Kojto 108:34e6b704fe68 43 extern "C" {
Kojto 108:34e6b704fe68 44 #endif
Kojto 108:34e6b704fe68 45
Kojto 108:34e6b704fe68 46 #ifndef __CORE_CA9_H_GENERIC
Kojto 108:34e6b704fe68 47 #define __CORE_CA9_H_GENERIC
Kojto 108:34e6b704fe68 48
Kojto 108:34e6b704fe68 49
Kojto 108:34e6b704fe68 50 /** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
Kojto 108:34e6b704fe68 51 CMSIS violates the following MISRA-C:2004 rules:
Kojto 108:34e6b704fe68 52
Kojto 108:34e6b704fe68 53 \li Required Rule 8.5, object/function definition in header file.<br>
Kojto 108:34e6b704fe68 54 Function definitions in header files are used to allow 'inlining'.
Kojto 108:34e6b704fe68 55
Kojto 108:34e6b704fe68 56 \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
Kojto 108:34e6b704fe68 57 Unions are used for effective representation of core registers.
Kojto 108:34e6b704fe68 58
Kojto 108:34e6b704fe68 59 \li Advisory Rule 19.7, Function-like macro defined.<br>
Kojto 108:34e6b704fe68 60 Function-like macros are used to allow more efficient code.
Kojto 108:34e6b704fe68 61 */
Kojto 108:34e6b704fe68 62
Kojto 108:34e6b704fe68 63
Kojto 108:34e6b704fe68 64 /*******************************************************************************
Kojto 108:34e6b704fe68 65 * CMSIS definitions
Kojto 108:34e6b704fe68 66 ******************************************************************************/
Kojto 108:34e6b704fe68 67 /** \ingroup Cortex_A9
Kojto 108:34e6b704fe68 68 @{
Kojto 108:34e6b704fe68 69 */
Kojto 108:34e6b704fe68 70
Kojto 108:34e6b704fe68 71 /* CMSIS CA9 definitions */
Kojto 108:34e6b704fe68 72 #define __CA9_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
Kojto 108:34e6b704fe68 73 #define __CA9_CMSIS_VERSION_SUB (0x10) /*!< [15:0] CMSIS HAL sub version */
Kojto 108:34e6b704fe68 74 #define __CA9_CMSIS_VERSION ((__CA9_CMSIS_VERSION_MAIN << 16) | \
Kojto 108:34e6b704fe68 75 __CA9_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
Kojto 108:34e6b704fe68 76
Kojto 108:34e6b704fe68 77 #define __CORTEX_A (0x09) /*!< Cortex-A Core */
Kojto 108:34e6b704fe68 78
Kojto 108:34e6b704fe68 79
Kojto 108:34e6b704fe68 80 #if defined ( __CC_ARM )
Kojto 108:34e6b704fe68 81 #define __ASM __asm /*!< asm keyword for ARM Compiler */
Kojto 108:34e6b704fe68 82 #define __INLINE __inline /*!< inline keyword for ARM Compiler */
Kojto 108:34e6b704fe68 83 #define __STATIC_INLINE static __inline
Kojto 108:34e6b704fe68 84 #define __STATIC_ASM static __asm
Kojto 108:34e6b704fe68 85
Kojto 108:34e6b704fe68 86 #elif defined ( __ICCARM__ )
Kojto 108:34e6b704fe68 87 #define __ASM __asm /*!< asm keyword for IAR Compiler */
Kojto 108:34e6b704fe68 88 #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
Kojto 108:34e6b704fe68 89 #define __STATIC_INLINE static inline
Kojto 108:34e6b704fe68 90 #define __STATIC_ASM static __asm
Kojto 108:34e6b704fe68 91
Kojto 108:34e6b704fe68 92 #elif defined ( __TMS470__ )
Kojto 108:34e6b704fe68 93 #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
Kojto 108:34e6b704fe68 94 #define __STATIC_INLINE static inline
Kojto 108:34e6b704fe68 95 #define __STATIC_ASM static __asm
Kojto 108:34e6b704fe68 96
Kojto 108:34e6b704fe68 97 #elif defined ( __GNUC__ )
Kojto 108:34e6b704fe68 98 #define __ASM __asm /*!< asm keyword for GNU Compiler */
Kojto 108:34e6b704fe68 99 #define __INLINE inline /*!< inline keyword for GNU Compiler */
Kojto 108:34e6b704fe68 100 #define __STATIC_INLINE static inline
Kojto 108:34e6b704fe68 101 #define __STATIC_ASM static __asm
Kojto 108:34e6b704fe68 102
Kojto 108:34e6b704fe68 103 #elif defined ( __TASKING__ )
Kojto 108:34e6b704fe68 104 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
Kojto 108:34e6b704fe68 105 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
Kojto 108:34e6b704fe68 106 #define __STATIC_INLINE static inline
Kojto 108:34e6b704fe68 107 #define __STATIC_ASM static __asm
Kojto 108:34e6b704fe68 108
Kojto 108:34e6b704fe68 109 #endif
Kojto 108:34e6b704fe68 110
Kojto 108:34e6b704fe68 111 /** __FPU_USED indicates whether an FPU is used or not. For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.
Kojto 108:34e6b704fe68 112 */
Kojto 108:34e6b704fe68 113 #if defined ( __CC_ARM )
Kojto 108:34e6b704fe68 114 #if defined __TARGET_FPU_VFP
Kojto 108:34e6b704fe68 115 #if (__FPU_PRESENT == 1)
Kojto 108:34e6b704fe68 116 #define __FPU_USED 1
Kojto 108:34e6b704fe68 117 #else
Kojto 108:34e6b704fe68 118 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 108:34e6b704fe68 119 #define __FPU_USED 0
Kojto 108:34e6b704fe68 120 #endif
Kojto 108:34e6b704fe68 121 #else
Kojto 108:34e6b704fe68 122 #define __FPU_USED 0
Kojto 108:34e6b704fe68 123 #endif
Kojto 108:34e6b704fe68 124
Kojto 108:34e6b704fe68 125 #elif defined ( __ICCARM__ )
Kojto 108:34e6b704fe68 126 #if defined __ARMVFP__
Kojto 108:34e6b704fe68 127 #if (__FPU_PRESENT == 1)
Kojto 108:34e6b704fe68 128 #define __FPU_USED 1
Kojto 108:34e6b704fe68 129 #else
Kojto 108:34e6b704fe68 130 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 108:34e6b704fe68 131 #define __FPU_USED 0
Kojto 108:34e6b704fe68 132 #endif
Kojto 108:34e6b704fe68 133 #else
Kojto 108:34e6b704fe68 134 #define __FPU_USED 0
Kojto 108:34e6b704fe68 135 #endif
Kojto 108:34e6b704fe68 136
Kojto 108:34e6b704fe68 137 #elif defined ( __TMS470__ )
Kojto 108:34e6b704fe68 138 #if defined __TI_VFP_SUPPORT__
Kojto 108:34e6b704fe68 139 #if (__FPU_PRESENT == 1)
Kojto 108:34e6b704fe68 140 #define __FPU_USED 1
Kojto 108:34e6b704fe68 141 #else
Kojto 108:34e6b704fe68 142 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 108:34e6b704fe68 143 #define __FPU_USED 0
Kojto 108:34e6b704fe68 144 #endif
Kojto 108:34e6b704fe68 145 #else
Kojto 108:34e6b704fe68 146 #define __FPU_USED 0
Kojto 108:34e6b704fe68 147 #endif
Kojto 108:34e6b704fe68 148
Kojto 108:34e6b704fe68 149 #elif defined ( __GNUC__ )
Kojto 108:34e6b704fe68 150 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
Kojto 108:34e6b704fe68 151 #if (__FPU_PRESENT == 1)
Kojto 108:34e6b704fe68 152 #define __FPU_USED 1
Kojto 108:34e6b704fe68 153 #else
Kojto 108:34e6b704fe68 154 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 108:34e6b704fe68 155 #define __FPU_USED 0
Kojto 108:34e6b704fe68 156 #endif
Kojto 108:34e6b704fe68 157 #else
Kojto 108:34e6b704fe68 158 #define __FPU_USED 0
Kojto 108:34e6b704fe68 159 #endif
Kojto 108:34e6b704fe68 160
Kojto 108:34e6b704fe68 161 #elif defined ( __TASKING__ )
Kojto 108:34e6b704fe68 162 #if defined __FPU_VFP__
Kojto 108:34e6b704fe68 163 #if (__FPU_PRESENT == 1)
Kojto 108:34e6b704fe68 164 #define __FPU_USED 1
Kojto 108:34e6b704fe68 165 #else
Kojto 108:34e6b704fe68 166 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 108:34e6b704fe68 167 #define __FPU_USED 0
Kojto 108:34e6b704fe68 168 #endif
Kojto 108:34e6b704fe68 169 #else
Kojto 108:34e6b704fe68 170 #define __FPU_USED 0
Kojto 108:34e6b704fe68 171 #endif
Kojto 108:34e6b704fe68 172 #endif
Kojto 108:34e6b704fe68 173
Kojto 108:34e6b704fe68 174 #include <stdint.h> /*!< standard types definitions */
Kojto 108:34e6b704fe68 175 #include "core_caInstr.h" /*!< Core Instruction Access */
Kojto 108:34e6b704fe68 176 #include "core_caFunc.h" /*!< Core Function Access */
Kojto 108:34e6b704fe68 177 #include "core_cm4_simd.h" /*!< Compiler specific SIMD Intrinsics */
Kojto 108:34e6b704fe68 178
Kojto 108:34e6b704fe68 179 #endif /* __CORE_CA9_H_GENERIC */
Kojto 108:34e6b704fe68 180
Kojto 108:34e6b704fe68 181 #ifndef __CMSIS_GENERIC
Kojto 108:34e6b704fe68 182
Kojto 108:34e6b704fe68 183 #ifndef __CORE_CA9_H_DEPENDANT
Kojto 108:34e6b704fe68 184 #define __CORE_CA9_H_DEPENDANT
Kojto 108:34e6b704fe68 185
Kojto 108:34e6b704fe68 186 /* check device defines and use defaults */
Kojto 108:34e6b704fe68 187 #if defined __CHECK_DEVICE_DEFINES
Kojto 108:34e6b704fe68 188 #ifndef __CA9_REV
Kojto 108:34e6b704fe68 189 #define __CA9_REV 0x0000
Kojto 108:34e6b704fe68 190 #warning "__CA9_REV not defined in device header file; using default!"
Kojto 108:34e6b704fe68 191 #endif
Kojto 108:34e6b704fe68 192
Kojto 108:34e6b704fe68 193 #ifndef __FPU_PRESENT
Kojto 108:34e6b704fe68 194 #define __FPU_PRESENT 1
Kojto 108:34e6b704fe68 195 #warning "__FPU_PRESENT not defined in device header file; using default!"
Kojto 108:34e6b704fe68 196 #endif
Kojto 108:34e6b704fe68 197
Kojto 108:34e6b704fe68 198 #ifndef __Vendor_SysTickConfig
Kojto 108:34e6b704fe68 199 #define __Vendor_SysTickConfig 1
Kojto 108:34e6b704fe68 200 #endif
Kojto 108:34e6b704fe68 201
Kojto 108:34e6b704fe68 202 #if __Vendor_SysTickConfig == 0
Kojto 108:34e6b704fe68 203 #error "__Vendor_SysTickConfig set to 0, but vendor systick timer must be supplied for Cortex-A9"
Kojto 108:34e6b704fe68 204 #endif
Kojto 108:34e6b704fe68 205 #endif
Kojto 108:34e6b704fe68 206
Kojto 108:34e6b704fe68 207 /* IO definitions (access restrictions to peripheral registers) */
Kojto 108:34e6b704fe68 208 /**
Kojto 108:34e6b704fe68 209 \defgroup CMSIS_glob_defs CMSIS Global Defines
Kojto 108:34e6b704fe68 210
Kojto 108:34e6b704fe68 211 <strong>IO Type Qualifiers</strong> are used
Kojto 108:34e6b704fe68 212 \li to specify the access to peripheral variables.
Kojto 108:34e6b704fe68 213 \li for automatic generation of peripheral register debug information.
Kojto 108:34e6b704fe68 214 */
Kojto 108:34e6b704fe68 215 #ifdef __cplusplus
Kojto 108:34e6b704fe68 216 #define __I volatile /*!< Defines 'read only' permissions */
Kojto 108:34e6b704fe68 217 #else
Kojto 108:34e6b704fe68 218 #define __I volatile const /*!< Defines 'read only' permissions */
Kojto 108:34e6b704fe68 219 #endif
Kojto 108:34e6b704fe68 220 #define __O volatile /*!< Defines 'write only' permissions */
Kojto 108:34e6b704fe68 221 #define __IO volatile /*!< Defines 'read / write' permissions */
Kojto 108:34e6b704fe68 222
Kojto 108:34e6b704fe68 223 /*@} end of group Cortex_A9 */
Kojto 108:34e6b704fe68 224
Kojto 108:34e6b704fe68 225
Kojto 108:34e6b704fe68 226 /*******************************************************************************
Kojto 108:34e6b704fe68 227 * Register Abstraction
Kojto 108:34e6b704fe68 228 ******************************************************************************/
Kojto 108:34e6b704fe68 229 /** \defgroup CMSIS_core_register Defines and Type Definitions
Kojto 108:34e6b704fe68 230 \brief Type definitions and defines for Cortex-A processor based devices.
Kojto 108:34e6b704fe68 231 */
Kojto 108:34e6b704fe68 232
Kojto 108:34e6b704fe68 233 /** \ingroup CMSIS_core_register
Kojto 108:34e6b704fe68 234 \defgroup CMSIS_CORE Status and Control Registers
Kojto 108:34e6b704fe68 235 \brief Core Register type definitions.
Kojto 108:34e6b704fe68 236 @{
Kojto 108:34e6b704fe68 237 */
Kojto 108:34e6b704fe68 238
Kojto 108:34e6b704fe68 239 /** \brief Union type to access the Application Program Status Register (APSR).
Kojto 108:34e6b704fe68 240 */
Kojto 108:34e6b704fe68 241 typedef union
Kojto 108:34e6b704fe68 242 {
Kojto 108:34e6b704fe68 243 struct
Kojto 108:34e6b704fe68 244 {
Kojto 108:34e6b704fe68 245 uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
Kojto 108:34e6b704fe68 246 uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
Kojto 108:34e6b704fe68 247 uint32_t reserved1:7; /*!< bit: 20..23 Reserved */
Kojto 108:34e6b704fe68 248 uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
Kojto 108:34e6b704fe68 249 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
Kojto 108:34e6b704fe68 250 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
Kojto 108:34e6b704fe68 251 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
Kojto 108:34e6b704fe68 252 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
Kojto 108:34e6b704fe68 253 } b; /*!< Structure used for bit access */
Kojto 108:34e6b704fe68 254 uint32_t w; /*!< Type used for word access */
Kojto 108:34e6b704fe68 255 } APSR_Type;
Kojto 108:34e6b704fe68 256
Kojto 108:34e6b704fe68 257
Kojto 108:34e6b704fe68 258 /*@} end of group CMSIS_CORE */
Kojto 108:34e6b704fe68 259
Kojto 108:34e6b704fe68 260 /*@} end of CMSIS_Core_FPUFunctions */
Kojto 108:34e6b704fe68 261
Kojto 108:34e6b704fe68 262
Kojto 108:34e6b704fe68 263 #endif /* __CORE_CA9_H_GENERIC */
Kojto 108:34e6b704fe68 264
Kojto 108:34e6b704fe68 265 #endif /* __CMSIS_GENERIC */
Kojto 108:34e6b704fe68 266
Kojto 108:34e6b704fe68 267 #ifdef __cplusplus
Kojto 108:34e6b704fe68 268 }
Kojto 108:34e6b704fe68 269
Kojto 108:34e6b704fe68 270
Kojto 108:34e6b704fe68 271 #endif