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:
<>
Date:
Tue Mar 14 16:20:51 2017 +0000
Revision:
138:093f2bd7b9eb
Parent:
120:7c328cabac7e
Release 138 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3716: fix for issue #3715: correction in startup files for ARM and IAR, alignment of system_stm32f429xx.c files https://github.com/ARMmbed/mbed-os/pull/3716
3741: STM32 remove warning in hal_tick_32b.c file https://github.com/ARMmbed/mbed-os/pull/3741
3780: STM32L4 : Fix GPIO G port compatibility https://github.com/ARMmbed/mbed-os/pull/3780
3831: NCS36510: SPISLAVE enabled (Conflict resolved) https://github.com/ARMmbed/mbed-os/pull/3831
3836: Allow to redefine nRF's PSTORAGE_NUM_OF_PAGES outside of the mbed-os https://github.com/ARMmbed/mbed-os/pull/3836
3840: STM32: gpio SPEED - always set High Speed by default https://github.com/ARMmbed/mbed-os/pull/3840
3844: STM32 GPIO: Typo correction. Update comment (GPIO_IP_WITHOUT_BRR) https://github.com/ARMmbed/mbed-os/pull/3844
3850: STM32: change spi error to debug warning https://github.com/ARMmbed/mbed-os/pull/3850
3860: Define GPIO_IP_WITHOUT_BRR for xDot platform https://github.com/ARMmbed/mbed-os/pull/3860
3880: DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated https://github.com/ARMmbed/mbed-os/pull/3880
3795: Fix pwm period calc https://github.com/ARMmbed/mbed-os/pull/3795
3828: STM32 CAN API: correct format and type https://github.com/ARMmbed/mbed-os/pull/3828
3842: TARGET_NRF: corrected spi_init() to properly handle re-initialization https://github.com/ARMmbed/mbed-os/pull/3842
3843: STM32L476xG: set APB2 clock to 80MHz (instead of 40MHz) https://github.com/ARMmbed/mbed-os/pull/3843
3879: NUCLEO_F446ZE: Add missing AnalogIn pins on PF_3, PF_5 and PF_10. https://github.com/ARMmbed/mbed-os/pull/3879
3902: Fix heap and stack size for NUCLEO_F746ZG https://github.com/ARMmbed/mbed-os/pull/3902
3829: can_write(): return error code when no tx mailboxes are available https://github.com/ARMmbed/mbed-os/pull/3829

Who changed what in which revision?

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