A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.

Dependencies:   C12832

Committer:
tushki7
Date:
Sun Apr 12 15:45:52 2015 +0000
Revision:
1:eb68c94a8ee5
Parent:
0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;

Who changed what in which revision?

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