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:
Tue Feb 02 14:43:35 2016 +0000
Revision:
113:f141b2784e32
Child:
115:87f2f5183dfb
Release 113 of the mbed library

Changes:
- new targets - Silabs Perl Gecko, TY51822
- Silabs - emlib update to 4.1.0, various bugfixes as result
- STM B96B_F446VE - add async serial support
- Freescale KLXX - rtc lock fix
- LPC11U68 and LPC1549 - pwm bugfixes - duty cycle

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 113:f141b2784e32 92 #elif defined ( __TMS470__ )
Kojto 113:f141b2784e32 93 #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
Kojto 113:f141b2784e32 94 #define __STATIC_INLINE static inline
Kojto 113:f141b2784e32 95 #define __STATIC_ASM static __asm
Kojto 113:f141b2784e32 96
Kojto 113:f141b2784e32 97 #elif defined ( __GNUC__ )
Kojto 113:f141b2784e32 98 #define __ASM __asm /*!< asm keyword for GNU Compiler */
Kojto 113:f141b2784e32 99 #define __INLINE inline /*!< inline keyword for GNU Compiler */
Kojto 113:f141b2784e32 100 #define __STATIC_INLINE static inline
Kojto 113:f141b2784e32 101 #define __STATIC_ASM static __asm
Kojto 113:f141b2784e32 102
Kojto 113:f141b2784e32 103 #elif defined ( __TASKING__ )
Kojto 113:f141b2784e32 104 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
Kojto 113:f141b2784e32 105 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
Kojto 113:f141b2784e32 106 #define __STATIC_INLINE static inline
Kojto 113:f141b2784e32 107 #define __STATIC_ASM static __asm
Kojto 113:f141b2784e32 108
Kojto 113:f141b2784e32 109 #endif
Kojto 113:f141b2784e32 110
Kojto 113:f141b2784e32 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 113:f141b2784e32 112 */
Kojto 113:f141b2784e32 113 #if defined ( __CC_ARM )
Kojto 113:f141b2784e32 114 #if defined __TARGET_FPU_VFP
Kojto 113:f141b2784e32 115 #if (__FPU_PRESENT == 1)
Kojto 113:f141b2784e32 116 #define __FPU_USED 1
Kojto 113:f141b2784e32 117 #else
Kojto 113:f141b2784e32 118 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 113:f141b2784e32 119 #define __FPU_USED 0
Kojto 113:f141b2784e32 120 #endif
Kojto 113:f141b2784e32 121 #else
Kojto 113:f141b2784e32 122 #define __FPU_USED 0
Kojto 113:f141b2784e32 123 #endif
Kojto 113:f141b2784e32 124
Kojto 113:f141b2784e32 125 #elif defined ( __ICCARM__ )
Kojto 113:f141b2784e32 126 #if defined __ARMVFP__
Kojto 113:f141b2784e32 127 #if (__FPU_PRESENT == 1)
Kojto 113:f141b2784e32 128 #define __FPU_USED 1
Kojto 113:f141b2784e32 129 #else
Kojto 113:f141b2784e32 130 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 113:f141b2784e32 131 #define __FPU_USED 0
Kojto 113:f141b2784e32 132 #endif
Kojto 113:f141b2784e32 133 #else
Kojto 113:f141b2784e32 134 #define __FPU_USED 0
Kojto 113:f141b2784e32 135 #endif
Kojto 113:f141b2784e32 136
Kojto 113:f141b2784e32 137 #elif defined ( __TMS470__ )
Kojto 113:f141b2784e32 138 #if defined __TI_VFP_SUPPORT__
Kojto 113:f141b2784e32 139 #if (__FPU_PRESENT == 1)
Kojto 113:f141b2784e32 140 #define __FPU_USED 1
Kojto 113:f141b2784e32 141 #else
Kojto 113:f141b2784e32 142 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 113:f141b2784e32 143 #define __FPU_USED 0
Kojto 113:f141b2784e32 144 #endif
Kojto 113:f141b2784e32 145 #else
Kojto 113:f141b2784e32 146 #define __FPU_USED 0
Kojto 113:f141b2784e32 147 #endif
Kojto 113:f141b2784e32 148
Kojto 113:f141b2784e32 149 #elif defined ( __GNUC__ )
Kojto 113:f141b2784e32 150 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
Kojto 113:f141b2784e32 151 #if (__FPU_PRESENT == 1)
Kojto 113:f141b2784e32 152 #define __FPU_USED 1
Kojto 113:f141b2784e32 153 #else
Kojto 113:f141b2784e32 154 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 113:f141b2784e32 155 #define __FPU_USED 0
Kojto 113:f141b2784e32 156 #endif
Kojto 113:f141b2784e32 157 #else
Kojto 113:f141b2784e32 158 #define __FPU_USED 0
Kojto 113:f141b2784e32 159 #endif
Kojto 113:f141b2784e32 160
Kojto 113:f141b2784e32 161 #elif defined ( __TASKING__ )
Kojto 113:f141b2784e32 162 #if defined __FPU_VFP__
Kojto 113:f141b2784e32 163 #if (__FPU_PRESENT == 1)
Kojto 113:f141b2784e32 164 #define __FPU_USED 1
Kojto 113:f141b2784e32 165 #else
Kojto 113:f141b2784e32 166 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
Kojto 113:f141b2784e32 167 #define __FPU_USED 0
Kojto 113:f141b2784e32 168 #endif
Kojto 113:f141b2784e32 169 #else
Kojto 113:f141b2784e32 170 #define __FPU_USED 0
Kojto 113:f141b2784e32 171 #endif
Kojto 113:f141b2784e32 172 #endif
Kojto 113:f141b2784e32 173
Kojto 113:f141b2784e32 174 #include <stdint.h> /*!< standard types definitions */
Kojto 113:f141b2784e32 175 #include "core_caInstr.h" /*!< Core Instruction Access */
Kojto 113:f141b2784e32 176 #include "core_caFunc.h" /*!< Core Function Access */
Kojto 113:f141b2784e32 177 #include "core_cm4_simd.h" /*!< Compiler specific SIMD Intrinsics */
Kojto 113:f141b2784e32 178
Kojto 113:f141b2784e32 179 #endif /* __CORE_CA9_H_GENERIC */
Kojto 113:f141b2784e32 180
Kojto 113:f141b2784e32 181 #ifndef __CMSIS_GENERIC
Kojto 113:f141b2784e32 182
Kojto 113:f141b2784e32 183 #ifndef __CORE_CA9_H_DEPENDANT
Kojto 113:f141b2784e32 184 #define __CORE_CA9_H_DEPENDANT
Kojto 113:f141b2784e32 185
Kojto 113:f141b2784e32 186 /* check device defines and use defaults */
Kojto 113:f141b2784e32 187 #if defined __CHECK_DEVICE_DEFINES
Kojto 113:f141b2784e32 188 #ifndef __CA9_REV
Kojto 113:f141b2784e32 189 #define __CA9_REV 0x0000
Kojto 113:f141b2784e32 190 #warning "__CA9_REV not defined in device header file; using default!"
Kojto 113:f141b2784e32 191 #endif
Kojto 113:f141b2784e32 192
Kojto 113:f141b2784e32 193 #ifndef __FPU_PRESENT
Kojto 113:f141b2784e32 194 #define __FPU_PRESENT 1
Kojto 113:f141b2784e32 195 #warning "__FPU_PRESENT not defined in device header file; using default!"
Kojto 113:f141b2784e32 196 #endif
Kojto 113:f141b2784e32 197
Kojto 113:f141b2784e32 198 #ifndef __Vendor_SysTickConfig
Kojto 113:f141b2784e32 199 #define __Vendor_SysTickConfig 1
Kojto 113:f141b2784e32 200 #endif
Kojto 113:f141b2784e32 201
Kojto 113:f141b2784e32 202 #if __Vendor_SysTickConfig == 0
Kojto 113:f141b2784e32 203 #error "__Vendor_SysTickConfig set to 0, but vendor systick timer must be supplied for Cortex-A9"
Kojto 113:f141b2784e32 204 #endif
Kojto 113:f141b2784e32 205 #endif
Kojto 113:f141b2784e32 206
Kojto 113:f141b2784e32 207 /* IO definitions (access restrictions to peripheral registers) */
Kojto 113:f141b2784e32 208 /**
Kojto 113:f141b2784e32 209 \defgroup CMSIS_glob_defs CMSIS Global Defines
Kojto 113:f141b2784e32 210
Kojto 113:f141b2784e32 211 <strong>IO Type Qualifiers</strong> are used
Kojto 113:f141b2784e32 212 \li to specify the access to peripheral variables.
Kojto 113:f141b2784e32 213 \li for automatic generation of peripheral register debug information.
Kojto 113:f141b2784e32 214 */
Kojto 113:f141b2784e32 215 #ifdef __cplusplus
Kojto 113:f141b2784e32 216 #define __I volatile /*!< Defines 'read only' permissions */
Kojto 113:f141b2784e32 217 #else
Kojto 113:f141b2784e32 218 #define __I volatile const /*!< Defines 'read only' permissions */
Kojto 113:f141b2784e32 219 #endif
Kojto 113:f141b2784e32 220 #define __O volatile /*!< Defines 'write only' permissions */
Kojto 113:f141b2784e32 221 #define __IO volatile /*!< Defines 'read / write' permissions */
Kojto 113:f141b2784e32 222
Kojto 113:f141b2784e32 223 /*@} end of group Cortex_A9 */
Kojto 113:f141b2784e32 224
Kojto 113:f141b2784e32 225
Kojto 113:f141b2784e32 226 /*******************************************************************************
Kojto 113:f141b2784e32 227 * Register Abstraction
Kojto 113:f141b2784e32 228 ******************************************************************************/
Kojto 113:f141b2784e32 229 /** \defgroup CMSIS_core_register Defines and Type Definitions
Kojto 113:f141b2784e32 230 \brief Type definitions and defines for Cortex-A processor based devices.
Kojto 113:f141b2784e32 231 */
Kojto 113:f141b2784e32 232
Kojto 113:f141b2784e32 233 /** \ingroup CMSIS_core_register
Kojto 113:f141b2784e32 234 \defgroup CMSIS_CORE Status and Control Registers
Kojto 113:f141b2784e32 235 \brief Core Register type definitions.
Kojto 113:f141b2784e32 236 @{
Kojto 113:f141b2784e32 237 */
Kojto 113:f141b2784e32 238
Kojto 113:f141b2784e32 239 /** \brief Union type to access the Application Program Status Register (APSR).
Kojto 113:f141b2784e32 240 */
Kojto 113:f141b2784e32 241 typedef union
Kojto 113:f141b2784e32 242 {
Kojto 113:f141b2784e32 243 struct
Kojto 113:f141b2784e32 244 {
Kojto 113:f141b2784e32 245 uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
Kojto 113:f141b2784e32 246 uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
Kojto 113:f141b2784e32 247 uint32_t reserved1:7; /*!< bit: 20..23 Reserved */
Kojto 113:f141b2784e32 248 uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
Kojto 113:f141b2784e32 249 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
Kojto 113:f141b2784e32 250 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
Kojto 113:f141b2784e32 251 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
Kojto 113:f141b2784e32 252 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
Kojto 113:f141b2784e32 253 } b; /*!< Structure used for bit access */
Kojto 113:f141b2784e32 254 uint32_t w; /*!< Type used for word access */
Kojto 113:f141b2784e32 255 } APSR_Type;
Kojto 113:f141b2784e32 256
Kojto 113:f141b2784e32 257
Kojto 113:f141b2784e32 258 /*@} end of group CMSIS_CORE */
Kojto 113:f141b2784e32 259
Kojto 113:f141b2784e32 260 /*@} end of CMSIS_Core_FPUFunctions */
Kojto 113:f141b2784e32 261
Kojto 113:f141b2784e32 262
Kojto 113:f141b2784e32 263 #endif /* __CORE_CA9_H_GENERIC */
Kojto 113:f141b2784e32 264
Kojto 113:f141b2784e32 265 #endif /* __CMSIS_GENERIC */
Kojto 113:f141b2784e32 266
Kojto 113:f141b2784e32 267 #ifdef __cplusplus
Kojto 113:f141b2784e32 268 }
Kojto 113:f141b2784e32 269
Kojto 113:f141b2784e32 270
Kojto 113:f141b2784e32 271 #endif