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:
122:f9eeca106725
Release 143 of the mbed library.

Who changed what in which revision?

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