I2C_EEPROM

Committer:
jhon309
Date:
Thu Aug 13 00:23:16 2015 +0000
Revision:
0:ac8863619623
I2C

Who changed what in which revision?

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