1 | /**************************************************************************//**
|
2 | * @file core_cm4.h
|
3 | * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File
|
4 | * @version V4.30
|
5 | * @date 20. October 2015
|
6 | ******************************************************************************/
|
7 | /* Copyright (c) 2009 - 2015 ARM LIMITED
|
8 |
|
9 | All rights reserved.
|
10 | Redistribution and use in source and binary forms, with or without
|
11 | modification, are permitted provided that the following conditions are met:
|
12 | - Redistributions of source code must retain the above copyright
|
13 | notice, this list of conditions and the following disclaimer.
|
14 | - Redistributions in binary form must reproduce the above copyright
|
15 | notice, this list of conditions and the following disclaimer in the
|
16 | documentation and/or other materials provided with the distribution.
|
17 | - Neither the name of ARM nor the names of its contributors may be used
|
18 | to endorse or promote products derived from this software without
|
19 | specific prior written permission.
|
20 | *
|
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
|
25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
31 | POSSIBILITY OF SUCH DAMAGE.
|
32 | ---------------------------------------------------------------------------*/
|
33 |
|
34 |
|
35 | #if defined ( __ICCARM__ )
|
36 | #pragma system_include /* treat file as system include file for MISRA check */
|
37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
38 | #pragma clang system_header /* treat file as system include file */
|
39 | #endif
|
40 |
|
41 | #ifndef __CORE_CM4_H_GENERIC
|
42 | #define __CORE_CM4_H_GENERIC
|
43 |
|
44 | #include <stdint.h>
|
45 |
|
46 | #ifdef __cplusplus
|
47 | extern "C" {
|
48 | #endif
|
49 |
|
50 | /**
|
51 | \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
|
52 | CMSIS violates the following MISRA-C:2004 rules:
|
53 |
|
54 | \li Required Rule 8.5, object/function definition in header file.<br>
|
55 | Function definitions in header files are used to allow 'inlining'.
|
56 |
|
57 | \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
|
58 | Unions are used for effective representation of core registers.
|
59 |
|
60 | \li Advisory Rule 19.7, Function-like macro defined.<br>
|
61 | Function-like macros are used to allow more efficient code.
|
62 | */
|
63 |
|
64 |
|
65 | /*******************************************************************************
|
66 | * CMSIS definitions
|
67 | ******************************************************************************/
|
68 | /**
|
69 | \ingroup Cortex_M4
|
70 | @{
|
71 | */
|
72 |
|
73 | /* CMSIS CM4 definitions */
|
74 | #define __CM4_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */
|
75 | #define __CM4_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */
|
76 | #define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \
|
77 | __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
|
78 |
|
79 | #define __CORTEX_M (0x04U) /*!< Cortex-M Core */
|
80 |
|
81 |
|
82 | #if defined ( __CC_ARM )
|
83 | #define __ASM __asm /*!< asm keyword for ARM Compiler */
|
84 | #define __INLINE __inline /*!< inline keyword for ARM Compiler */
|
85 | #define __STATIC_INLINE static __inline
|
86 |
|
87 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
88 | #define __ASM __asm /*!< asm keyword for ARM Compiler */
|
89 | #define __INLINE __inline /*!< inline keyword for ARM Compiler */
|
90 | #define __STATIC_INLINE static __inline
|
91 |
|
92 | #elif defined ( __GNUC__ )
|
93 | #define __ASM __asm /*!< asm keyword for GNU Compiler */
|
94 | #define __INLINE inline /*!< inline keyword for GNU Compiler */
|
95 | #define __STATIC_INLINE static inline
|
96 |
|
97 | #elif defined ( __ICCARM__ )
|
98 | #define __ASM __asm /*!< asm keyword for IAR Compiler */
|
99 | #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
|
100 | #define __STATIC_INLINE static inline
|
101 |
|
102 | #elif defined ( __TMS470__ )
|
103 | #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
|
104 | #define __STATIC_INLINE static inline
|
105 |
|
106 | #elif defined ( __TASKING__ )
|
107 | #define __ASM __asm /*!< asm keyword for TASKING Compiler */
|
108 | #define __INLINE inline /*!< inline keyword for TASKING Compiler */
|
109 | #define __STATIC_INLINE static inline
|
110 |
|
111 | #elif defined ( __CSMC__ )
|
112 | #define __packed
|
113 | #define __ASM _asm /*!< asm keyword for COSMIC Compiler */
|
114 | #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */
|
115 | #define __STATIC_INLINE static inline
|
116 |
|
117 | #else
|
118 | #error Unknown compiler
|
119 | #endif
|