DHT11

Committer:
jhon309
Date:
Thu Aug 13 00:21:57 2015 +0000
Revision:
0:c52df770855b
DHT11

Who changed what in which revision?

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