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:
AnnaBridge
Date:
Fri May 26 12:30:20 2017 +0100
Revision:
143:86740a56073b
Parent:
142:4eea097334d6
Release 143 of the mbed library.

Who changed what in which revision?

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