Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Jan 13 09:48:29 2016 +0000
Revision:
112:6f327212ef96
Child:
115:87f2f5183dfb
Release 112 of the mbed library

Changes:
- new platforms - STM32 B96B F446, MOTE_L152RC
- nrf51 - fix serial init bug (character sent)
- stm all devices - fix RTC clocking in the init
- stm f0 - SystemInit clock fix, for SetVector()
- RawSerial - fix for microlib (vsnprintf with size 0)

Who changed what in which revision?

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