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