Describes predefine macros for mbed online compiler (armcc)

Committer:
MACRUM
Date:
Thu Mar 16 21:58:09 2017 +0900
Revision:
6:40e873bbc5f7
Add licence header info

Who changed what in which revision?

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