PokittoLib with changes to lcd refresh etc.

Dependents:   Pokittris

Fork of Pokitto by Pokitto Community Team

This is a fork by user @Spinal, and is used in Pokittris for testing. Do not import this to your own program.

Committer:
Pokitto
Date:
Sat Oct 07 21:31:12 2017 +0000
Revision:
5:7e5c566b1760
mbed-pokitto integrated

Who changed what in which revision?

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