PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   Sensitive

Fork of PokittoLib by Jonne Valola

Committer:
spinal
Date:
Wed Oct 18 14:47:54 2017 +0000
Revision:
15:0bbe8f6fae32
Parent:
6:ea7377f3d1af
direct lcd stuff used by sensitive

Who changed what in which revision?

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