1 /**************************************************************************//**
3 * @brief CMSIS Cortex-A9 Core Peripheral Access Layer Header File
9 ******************************************************************************/
10 /* Copyright (c) 2009 - 2012 ARM LIMITED
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 - Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 - Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 - Neither the name of ARM nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ---------------------------------------------------------------------------*/
38 #if defined ( __ICCARM__ )
39 #pragma system_include /* treat file as system include file for MISRA check */
46 #ifndef __CORE_CA9_H_GENERIC
47 #define __CORE_CA9_H_GENERIC
50 /** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
51 CMSIS violates the following MISRA-C:2004 rules:
53 \li Required Rule 8.5, object/function definition in header file.<br>
54 Function definitions in header files are used to allow 'inlining'.
56 \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
57 Unions are used for effective representation of core registers.
59 \li Advisory Rule 19.7, Function-like macro defined.<br>
60 Function-like macros are used to allow more efficient code.
64 /*******************************************************************************
66 ******************************************************************************/
67 /** \ingroup Cortex_A9
71 /* CMSIS CA9 definitions */
72 #define __CA9_CMSIS_VERSION_MAIN (0x03) /*!< [31:16] CMSIS HAL main version */
73 #define __CA9_CMSIS_VERSION_SUB (0x10) /*!< [15:0] CMSIS HAL sub version */
74 #define __CA9_CMSIS_VERSION ((__CA9_CMSIS_VERSION_MAIN << 16) | \
75 __CA9_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
77 #define __CORTEX_A (0x09) /*!< Cortex-A Core */
80 #if defined ( __CC_ARM )
81 #define __ASM __asm /*!< asm keyword for ARM Compiler */
82 #define __INLINE __inline /*!< inline keyword for ARM Compiler */
83 #define __STATIC_INLINE static __inline
84 #define __STATIC_ASM static __asm
86 #elif defined ( __ICCARM__ )
87 #define __ASM __asm /*!< asm keyword for IAR Compiler */
88 #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
89 #define __STATIC_INLINE static inline
90 #define __STATIC_ASM static __asm
92 #elif defined ( __TMS470__ )
93 #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
94 #define __STATIC_INLINE static inline
95 #define __STATIC_ASM static __asm
97 #elif defined ( __GNUC__ )
98 #define __ASM __asm /*!< asm keyword for GNU Compiler */
99 #define __INLINE inline /*!< inline keyword for GNU Compiler */
100 #define __STATIC_INLINE static inline
101 #define __STATIC_ASM static __asm
103 #elif defined ( __TASKING__ )
104 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
105 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
106 #define __STATIC_INLINE static inline
107 #define __STATIC_ASM static __asm
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.
113 #if defined ( __CC_ARM )
114 #if defined __TARGET_FPU_VFP
115 #if (__FPU_PRESENT == 1)
118 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
125 #elif defined ( __ICCARM__ )
126 #if defined __ARMVFP__
127 #if (__FPU_PRESENT == 1)
130 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
137 #elif defined ( __TMS470__ )
138 #if defined __TI_VFP_SUPPORT__
139 #if (__FPU_PRESENT == 1)
142 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
149 #elif defined ( __GNUC__ )
150 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
151 #if (__FPU_PRESENT == 1)
154 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
161 #elif defined ( __TASKING__ )
162 #if defined __FPU_VFP__
163 #if (__FPU_PRESENT == 1)
166 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
174 #include <stdint.h> /*!< standard types definitions */
175 #include "core_caInstr.h" /*!< Core Instruction Access */
176 #include "core_caFunc.h" /*!< Core Function Access */
177 #include "core_cm4_simd.h" /*!< Compiler specific SIMD Intrinsics */
179 #endif /* __CORE_CA9_H_GENERIC */
181 #ifndef __CMSIS_GENERIC
183 #ifndef __CORE_CA9_H_DEPENDANT
184 #define __CORE_CA9_H_DEPENDANT
186 /* check device defines and use defaults */
187 #if defined __CHECK_DEVICE_DEFINES
189 #define __CA9_REV 0x0000
190 #warning "__CA9_REV not defined in device header file; using default!"
193 #ifndef __FPU_PRESENT
194 #define __FPU_PRESENT 1
195 #warning "__FPU_PRESENT not defined in device header file; using default!"
198 #ifndef __Vendor_SysTickConfig
199 #define __Vendor_SysTickConfig 1
202 #if __Vendor_SysTickConfig == 0
203 #error "__Vendor_SysTickConfig set to 0, but vendor systick timer must be supplied for Cortex-A9"
207 /* IO definitions (access restrictions to peripheral registers) */
209 \defgroup CMSIS_glob_defs CMSIS Global Defines
211 <strong>IO Type Qualifiers</strong> are used
212 \li to specify the access to peripheral variables.
213 \li for automatic generation of peripheral register debug information.
216 #define __I volatile /*!< Defines 'read only' permissions */
218 #define __I volatile const /*!< Defines 'read only' permissions */
220 #define __O volatile /*!< Defines 'write only' permissions */
221 #define __IO volatile /*!< Defines 'read / write' permissions */
223 /*@} end of group Cortex_A9 */
226 /*******************************************************************************
227 * Register Abstraction
228 ******************************************************************************/
229 /** \defgroup CMSIS_core_register Defines and Type Definitions
230 \brief Type definitions and defines for Cortex-A processor based devices.
233 /** \ingroup CMSIS_core_register
234 \defgroup CMSIS_CORE Status and Control Registers
235 \brief Core Register type definitions.
239 /** \brief Union type to access the Application Program Status Register (APSR).
245 uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
246 uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
247 uint32_t reserved1:7; /*!< bit: 20..23 Reserved */
248 uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
249 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
250 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
251 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
252 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
253 } b; /*!< Structure used for bit access */
254 uint32_t w; /*!< Type used for word access */
258 /*@} end of group CMSIS_CORE */
260 /*@} end of CMSIS_Core_FPUFunctions */
263 #endif /* __CORE_CA9_H_GENERIC */
265 #endif /* __CMSIS_GENERIC */