USB Serial application

Fork of USBSerial_HelloWorld by Samuel Mokrani

Committer:
Zaitsev
Date:
Tue Jan 10 20:42:26 2017 +0000
Revision:
10:41552d038a69
USB Serial bi-directional bridge

Who changed what in which revision?

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