Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /**************************************************************************//**
sahilmgandhi 18:6a4db94011d3 2 * @file core_cm0.h
sahilmgandhi 18:6a4db94011d3 3 * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
sahilmgandhi 18:6a4db94011d3 4 * @version V4.10
sahilmgandhi 18:6a4db94011d3 5 * @date 18. March 2015
sahilmgandhi 18:6a4db94011d3 6 *
sahilmgandhi 18:6a4db94011d3 7 * @note
sahilmgandhi 18:6a4db94011d3 8 *
sahilmgandhi 18:6a4db94011d3 9 ******************************************************************************/
sahilmgandhi 18:6a4db94011d3 10 /* Copyright (c) 2009 - 2015 ARM LIMITED
sahilmgandhi 18:6a4db94011d3 11
sahilmgandhi 18:6a4db94011d3 12 All rights reserved.
sahilmgandhi 18:6a4db94011d3 13 Redistribution and use in source and binary forms, with or without
sahilmgandhi 18:6a4db94011d3 14 modification, are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 15 - Redistributions of source code must retain the above copyright
sahilmgandhi 18:6a4db94011d3 16 notice, this list of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 17 - Redistributions in binary form must reproduce the above copyright
sahilmgandhi 18:6a4db94011d3 18 notice, this list of conditions and the following disclaimer in the
sahilmgandhi 18:6a4db94011d3 19 documentation and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 20 - Neither the name of ARM nor the names of its contributors may be used
sahilmgandhi 18:6a4db94011d3 21 to endorse or promote products derived from this software without
sahilmgandhi 18:6a4db94011d3 22 specific prior written permission.
sahilmgandhi 18:6a4db94011d3 23 *
sahilmgandhi 18:6a4db94011d3 24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
sahilmgandhi 18:6a4db94011d3 25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
sahilmgandhi 18:6a4db94011d3 26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
sahilmgandhi 18:6a4db94011d3 27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
sahilmgandhi 18:6a4db94011d3 28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
sahilmgandhi 18:6a4db94011d3 29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
sahilmgandhi 18:6a4db94011d3 30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
sahilmgandhi 18:6a4db94011d3 31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
sahilmgandhi 18:6a4db94011d3 32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
sahilmgandhi 18:6a4db94011d3 33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
sahilmgandhi 18:6a4db94011d3 34 POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 35 ---------------------------------------------------------------------------*/
sahilmgandhi 18:6a4db94011d3 36
sahilmgandhi 18:6a4db94011d3 37
sahilmgandhi 18:6a4db94011d3 38 #if defined ( __ICCARM__ )
sahilmgandhi 18:6a4db94011d3 39 #pragma system_include /* treat file as system include file for MISRA check */
sahilmgandhi 18:6a4db94011d3 40 #endif
sahilmgandhi 18:6a4db94011d3 41
sahilmgandhi 18:6a4db94011d3 42 #ifndef __CORE_CM0_H_GENERIC
sahilmgandhi 18:6a4db94011d3 43 #define __CORE_CM0_H_GENERIC
sahilmgandhi 18:6a4db94011d3 44
sahilmgandhi 18:6a4db94011d3 45 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 46 extern "C" {
sahilmgandhi 18:6a4db94011d3 47 #endif
sahilmgandhi 18:6a4db94011d3 48
sahilmgandhi 18:6a4db94011d3 49 /** \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
sahilmgandhi 18:6a4db94011d3 50 CMSIS violates the following MISRA-C:2004 rules:
sahilmgandhi 18:6a4db94011d3 51
sahilmgandhi 18:6a4db94011d3 52 \li Required Rule 8.5, object/function definition in header file.<br>
sahilmgandhi 18:6a4db94011d3 53 Function definitions in header files are used to allow 'inlining'.
sahilmgandhi 18:6a4db94011d3 54
sahilmgandhi 18:6a4db94011d3 55 \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
sahilmgandhi 18:6a4db94011d3 56 Unions are used for effective representation of core registers.
sahilmgandhi 18:6a4db94011d3 57
sahilmgandhi 18:6a4db94011d3 58 \li Advisory Rule 19.7, Function-like macro defined.<br>
sahilmgandhi 18:6a4db94011d3 59 Function-like macros are used to allow more efficient code.
sahilmgandhi 18:6a4db94011d3 60 */
sahilmgandhi 18:6a4db94011d3 61
sahilmgandhi 18:6a4db94011d3 62
sahilmgandhi 18:6a4db94011d3 63 /*******************************************************************************
sahilmgandhi 18:6a4db94011d3 64 * CMSIS definitions
sahilmgandhi 18:6a4db94011d3 65 ******************************************************************************/
sahilmgandhi 18:6a4db94011d3 66 /** \ingroup Cortex_M0
sahilmgandhi 18:6a4db94011d3 67 @{
sahilmgandhi 18:6a4db94011d3 68 */
sahilmgandhi 18:6a4db94011d3 69
sahilmgandhi 18:6a4db94011d3 70 /* CMSIS CM0 definitions */
sahilmgandhi 18:6a4db94011d3 71 #define __CM0_CMSIS_VERSION_MAIN (0x04) /*!< [31:16] CMSIS HAL main version */
sahilmgandhi 18:6a4db94011d3 72 #define __CM0_CMSIS_VERSION_SUB (0x00) /*!< [15:0] CMSIS HAL sub version */
sahilmgandhi 18:6a4db94011d3 73 #define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | \
sahilmgandhi 18:6a4db94011d3 74 __CM0_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */
sahilmgandhi 18:6a4db94011d3 75
sahilmgandhi 18:6a4db94011d3 76 #define __CORTEX_M (0x00) /*!< Cortex-M Core */
sahilmgandhi 18:6a4db94011d3 77
sahilmgandhi 18:6a4db94011d3 78
sahilmgandhi 18:6a4db94011d3 79 #if defined ( __CC_ARM )
sahilmgandhi 18:6a4db94011d3 80 #define __ASM __asm /*!< asm keyword for ARM Compiler */
sahilmgandhi 18:6a4db94011d3 81 #define __INLINE __inline /*!< inline keyword for ARM Compiler */
sahilmgandhi 18:6a4db94011d3 82 #define __STATIC_INLINE static __inline
sahilmgandhi 18:6a4db94011d3 83
sahilmgandhi 18:6a4db94011d3 84 #elif defined ( __GNUC__ )
sahilmgandhi 18:6a4db94011d3 85 #define __ASM __asm /*!< asm keyword for GNU Compiler */
sahilmgandhi 18:6a4db94011d3 86 #define __INLINE inline /*!< inline keyword for GNU Compiler */
sahilmgandhi 18:6a4db94011d3 87 #define __STATIC_INLINE static inline
sahilmgandhi 18:6a4db94011d3 88
sahilmgandhi 18:6a4db94011d3 89 #elif defined ( __ICCARM__ )
sahilmgandhi 18:6a4db94011d3 90 #define __ASM __asm /*!< asm keyword for IAR Compiler */
sahilmgandhi 18:6a4db94011d3 91 #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
sahilmgandhi 18:6a4db94011d3 92 #define __STATIC_INLINE static inline
sahilmgandhi 18:6a4db94011d3 93
sahilmgandhi 18:6a4db94011d3 94 #elif defined ( __TMS470__ )
sahilmgandhi 18:6a4db94011d3 95 #define __ASM __asm /*!< asm keyword for TI CCS Compiler */
sahilmgandhi 18:6a4db94011d3 96 #define __STATIC_INLINE static inline
sahilmgandhi 18:6a4db94011d3 97
sahilmgandhi 18:6a4db94011d3 98 #elif defined ( __TASKING__ )
sahilmgandhi 18:6a4db94011d3 99 #define __ASM __asm /*!< asm keyword for TASKING Compiler */
sahilmgandhi 18:6a4db94011d3 100 #define __INLINE inline /*!< inline keyword for TASKING Compiler */
sahilmgandhi 18:6a4db94011d3 101 #define __STATIC_INLINE static inline
sahilmgandhi 18:6a4db94011d3 102
sahilmgandhi 18:6a4db94011d3 103 #elif defined ( __CSMC__ )
sahilmgandhi 18:6a4db94011d3 104 #define __packed
sahilmgandhi 18:6a4db94011d3 105 #define __ASM _asm /*!< asm keyword for COSMIC Compiler */
sahilmgandhi 18:6a4db94011d3 106 #define __INLINE inline /*use -pc99 on compile line !< inline keyword for COSMIC Compiler */
sahilmgandhi 18:6a4db94011d3 107 #define __STATIC_INLINE static inline
sahilmgandhi 18:6a4db94011d3 108
sahilmgandhi 18:6a4db94011d3 109 #endif
sahilmgandhi 18:6a4db94011d3 110
sahilmgandhi 18:6a4db94011d3 111 /** __FPU_USED indicates whether an FPU is used or not.
sahilmgandhi 18:6a4db94011d3 112 This core does not support an FPU at all
sahilmgandhi 18:6a4db94011d3 113 */
sahilmgandhi 18:6a4db94011d3 114 #define __FPU_USED 0
sahilmgandhi 18:6a4db94011d3 115
sahilmgandhi 18:6a4db94011d3 116 #if defined ( __CC_ARM )
sahilmgandhi 18:6a4db94011d3 117 #if defined __TARGET_FPU_VFP
sahilmgandhi 18:6a4db94011d3 118 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
sahilmgandhi 18:6a4db94011d3 119 #endif
sahilmgandhi 18:6a4db94011d3 120
sahilmgandhi 18:6a4db94011d3 121 #elif defined ( __GNUC__ )
sahilmgandhi 18:6a4db94011d3 122 #if defined (__VFP_FP__) && !defined(__SOFTFP__)
sahilmgandhi 18:6a4db94011d3 123 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
sahilmgandhi 18:6a4db94011d3 124 #endif
sahilmgandhi 18:6a4db94011d3 125
sahilmgandhi 18:6a4db94011d3 126 #elif defined ( __ICCARM__ )
sahilmgandhi 18:6a4db94011d3 127 #if defined __ARMVFP__
sahilmgandhi 18:6a4db94011d3 128 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
sahilmgandhi 18:6a4db94011d3 129 #endif
sahilmgandhi 18:6a4db94011d3 130
sahilmgandhi 18:6a4db94011d3 131 #elif defined ( __TMS470__ )
sahilmgandhi 18:6a4db94011d3 132 #if defined __TI__VFP_SUPPORT____
sahilmgandhi 18:6a4db94011d3 133 #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
sahilmgandhi 18:6a4db94011d3 134 #endif
sahilmgandhi 18:6a4db94011d3 135
sahilmgandhi 18:6a4db94011d3 136 #elif defined ( __TASKING__ )
sahilmgandhi 18:6a4db94011d3 137 #if defined __FPU_VFP__
sahilmgandhi 18:6a4db94011d3 138 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
sahilmgandhi 18:6a4db94011d3 139 #endif
sahilmgandhi 18:6a4db94011d3 140
sahilmgandhi 18:6a4db94011d3 141 #elif defined ( __CSMC__ ) /* Cosmic */
sahilmgandhi 18:6a4db94011d3 142 #if ( __CSMC__ & 0x400) // FPU present for parser
sahilmgandhi 18:6a4db94011d3 143 #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
sahilmgandhi 18:6a4db94011d3 144 #endif
sahilmgandhi 18:6a4db94011d3 145 #endif
sahilmgandhi 18:6a4db94011d3 146
sahilmgandhi 18:6a4db94011d3 147 #include <stdint.h> /* standard types definitions */
sahilmgandhi 18:6a4db94011d3 148 #include <core_cmInstr.h> /* Core Instruction Access */
sahilmgandhi 18:6a4db94011d3 149 #include <core_cmFunc.h> /* Core Function Access */
sahilmgandhi 18:6a4db94011d3 150
sahilmgandhi 18:6a4db94011d3 151 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 152 }
sahilmgandhi 18:6a4db94011d3 153 #endif
sahilmgandhi 18:6a4db94011d3 154
sahilmgandhi 18:6a4db94011d3 155 #endif /* __CORE_CM0_H_GENERIC */
sahilmgandhi 18:6a4db94011d3 156
sahilmgandhi 18:6a4db94011d3 157 #ifndef __CMSIS_GENERIC
sahilmgandhi 18:6a4db94011d3 158
sahilmgandhi 18:6a4db94011d3 159 #ifndef __CORE_CM0_H_DEPENDANT
sahilmgandhi 18:6a4db94011d3 160 #define __CORE_CM0_H_DEPENDANT
sahilmgandhi 18:6a4db94011d3 161
sahilmgandhi 18:6a4db94011d3 162 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 163 extern "C" {
sahilmgandhi 18:6a4db94011d3 164 #endif
sahilmgandhi 18:6a4db94011d3 165
sahilmgandhi 18:6a4db94011d3 166 /* check device defines and use defaults */
sahilmgandhi 18:6a4db94011d3 167 #if defined __CHECK_DEVICE_DEFINES
sahilmgandhi 18:6a4db94011d3 168 #ifndef __CM0_REV
sahilmgandhi 18:6a4db94011d3 169 #define __CM0_REV 0x0000
sahilmgandhi 18:6a4db94011d3 170 #warning "__CM0_REV not defined in device header file; using default!"
sahilmgandhi 18:6a4db94011d3 171 #endif
sahilmgandhi 18:6a4db94011d3 172
sahilmgandhi 18:6a4db94011d3 173 #ifndef __NVIC_PRIO_BITS
sahilmgandhi 18:6a4db94011d3 174 #define __NVIC_PRIO_BITS 2
sahilmgandhi 18:6a4db94011d3 175 #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
sahilmgandhi 18:6a4db94011d3 176 #endif
sahilmgandhi 18:6a4db94011d3 177
sahilmgandhi 18:6a4db94011d3 178 #ifndef __Vendor_SysTickConfig
sahilmgandhi 18:6a4db94011d3 179 #define __Vendor_SysTickConfig 0
sahilmgandhi 18:6a4db94011d3 180 #warning "__Vendor_SysTickConfig not defined in device header file; using default!"
sahilmgandhi 18:6a4db94011d3 181 #endif
sahilmgandhi 18:6a4db94011d3 182 #endif
sahilmgandhi 18:6a4db94011d3 183
sahilmgandhi 18:6a4db94011d3 184 /* IO definitions (access restrictions to peripheral registers) */
sahilmgandhi 18:6a4db94011d3 185 /**
sahilmgandhi 18:6a4db94011d3 186 \defgroup CMSIS_glob_defs CMSIS Global Defines
sahilmgandhi 18:6a4db94011d3 187
sahilmgandhi 18:6a4db94011d3 188 <strong>IO Type Qualifiers</strong> are used
sahilmgandhi 18:6a4db94011d3 189 \li to specify the access to peripheral variables.
sahilmgandhi 18:6a4db94011d3 190 \li for automatic generation of peripheral register debug information.
sahilmgandhi 18:6a4db94011d3 191 */
sahilmgandhi 18:6a4db94011d3 192 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 193 #define __I volatile /*!< Defines 'read only' permissions */
sahilmgandhi 18:6a4db94011d3 194 #else
sahilmgandhi 18:6a4db94011d3 195 #define __I volatile const /*!< Defines 'read only' permissions */
sahilmgandhi 18:6a4db94011d3 196 #endif
sahilmgandhi 18:6a4db94011d3 197 #define __O volatile /*!< Defines 'write only' permissions */
sahilmgandhi 18:6a4db94011d3 198 #define __IO volatile /*!< Defines 'read / write' permissions */
sahilmgandhi 18:6a4db94011d3 199
sahilmgandhi 18:6a4db94011d3 200 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 201 #define __IM volatile /*!< Defines 'read only' permissions */
sahilmgandhi 18:6a4db94011d3 202 #else
sahilmgandhi 18:6a4db94011d3 203 #define __IM volatile const /*!< Defines 'read only' permissions */
sahilmgandhi 18:6a4db94011d3 204 #endif
sahilmgandhi 18:6a4db94011d3 205 #define __OM volatile /*!< Defines 'write only' permissions */
sahilmgandhi 18:6a4db94011d3 206 #define __IOM volatile /*!< Defines 'read / write' permissions */
sahilmgandhi 18:6a4db94011d3 207
sahilmgandhi 18:6a4db94011d3 208 /*@} end of group Cortex_M0 */
sahilmgandhi 18:6a4db94011d3 209
sahilmgandhi 18:6a4db94011d3 210
sahilmgandhi 18:6a4db94011d3 211
sahilmgandhi 18:6a4db94011d3 212 /*******************************************************************************
sahilmgandhi 18:6a4db94011d3 213 * Register Abstraction
sahilmgandhi 18:6a4db94011d3 214 Core Register contain:
sahilmgandhi 18:6a4db94011d3 215 - Core Register
sahilmgandhi 18:6a4db94011d3 216 - Core NVIC Register
sahilmgandhi 18:6a4db94011d3 217 - Core SCB Register
sahilmgandhi 18:6a4db94011d3 218 - Core SysTick Register
sahilmgandhi 18:6a4db94011d3 219 ******************************************************************************/
sahilmgandhi 18:6a4db94011d3 220 /** \defgroup CMSIS_core_register Defines and Type Definitions
sahilmgandhi 18:6a4db94011d3 221 \brief Type definitions and defines for Cortex-M processor based devices.
sahilmgandhi 18:6a4db94011d3 222 */
sahilmgandhi 18:6a4db94011d3 223
sahilmgandhi 18:6a4db94011d3 224 /** \ingroup CMSIS_core_register
sahilmgandhi 18:6a4db94011d3 225 \defgroup CMSIS_CORE Status and Control Registers
sahilmgandhi 18:6a4db94011d3 226 \brief Core Register type definitions.
sahilmgandhi 18:6a4db94011d3 227 @{
sahilmgandhi 18:6a4db94011d3 228 */
sahilmgandhi 18:6a4db94011d3 229
sahilmgandhi 18:6a4db94011d3 230 /** \brief Union type to access the Application Program Status Register (APSR).
sahilmgandhi 18:6a4db94011d3 231 */
sahilmgandhi 18:6a4db94011d3 232 typedef union
sahilmgandhi 18:6a4db94011d3 233 {
sahilmgandhi 18:6a4db94011d3 234 struct
sahilmgandhi 18:6a4db94011d3 235 {
sahilmgandhi 18:6a4db94011d3 236 uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */
sahilmgandhi 18:6a4db94011d3 237 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
sahilmgandhi 18:6a4db94011d3 238 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
sahilmgandhi 18:6a4db94011d3 239 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
sahilmgandhi 18:6a4db94011d3 240 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
sahilmgandhi 18:6a4db94011d3 241 } b; /*!< Structure used for bit access */
sahilmgandhi 18:6a4db94011d3 242 uint32_t w; /*!< Type used for word access */
sahilmgandhi 18:6a4db94011d3 243 } APSR_Type;
sahilmgandhi 18:6a4db94011d3 244
sahilmgandhi 18:6a4db94011d3 245 /* APSR Register Definitions */
sahilmgandhi 18:6a4db94011d3 246 #define APSR_N_Pos 31 /*!< APSR: N Position */
sahilmgandhi 18:6a4db94011d3 247 #define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
sahilmgandhi 18:6a4db94011d3 248
sahilmgandhi 18:6a4db94011d3 249 #define APSR_Z_Pos 30 /*!< APSR: Z Position */
sahilmgandhi 18:6a4db94011d3 250 #define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
sahilmgandhi 18:6a4db94011d3 251
sahilmgandhi 18:6a4db94011d3 252 #define APSR_C_Pos 29 /*!< APSR: C Position */
sahilmgandhi 18:6a4db94011d3 253 #define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
sahilmgandhi 18:6a4db94011d3 254
sahilmgandhi 18:6a4db94011d3 255 #define APSR_V_Pos 28 /*!< APSR: V Position */
sahilmgandhi 18:6a4db94011d3 256 #define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
sahilmgandhi 18:6a4db94011d3 257
sahilmgandhi 18:6a4db94011d3 258
sahilmgandhi 18:6a4db94011d3 259 /** \brief Union type to access the Interrupt Program Status Register (IPSR).
sahilmgandhi 18:6a4db94011d3 260 */
sahilmgandhi 18:6a4db94011d3 261 typedef union
sahilmgandhi 18:6a4db94011d3 262 {
sahilmgandhi 18:6a4db94011d3 263 struct
sahilmgandhi 18:6a4db94011d3 264 {
sahilmgandhi 18:6a4db94011d3 265 uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
sahilmgandhi 18:6a4db94011d3 266 uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
sahilmgandhi 18:6a4db94011d3 267 } b; /*!< Structure used for bit access */
sahilmgandhi 18:6a4db94011d3 268 uint32_t w; /*!< Type used for word access */
sahilmgandhi 18:6a4db94011d3 269 } IPSR_Type;
sahilmgandhi 18:6a4db94011d3 270
sahilmgandhi 18:6a4db94011d3 271 /* IPSR Register Definitions */
sahilmgandhi 18:6a4db94011d3 272 #define IPSR_ISR_Pos 0 /*!< IPSR: ISR Position */
sahilmgandhi 18:6a4db94011d3 273 #define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
sahilmgandhi 18:6a4db94011d3 274
sahilmgandhi 18:6a4db94011d3 275
sahilmgandhi 18:6a4db94011d3 276 /** \brief Union type to access the Special-Purpose Program Status Registers (xPSR).
sahilmgandhi 18:6a4db94011d3 277 */
sahilmgandhi 18:6a4db94011d3 278 typedef union
sahilmgandhi 18:6a4db94011d3 279 {
sahilmgandhi 18:6a4db94011d3 280 struct
sahilmgandhi 18:6a4db94011d3 281 {
sahilmgandhi 18:6a4db94011d3 282 uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
sahilmgandhi 18:6a4db94011d3 283 uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
sahilmgandhi 18:6a4db94011d3 284 uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
sahilmgandhi 18:6a4db94011d3 285 uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
sahilmgandhi 18:6a4db94011d3 286 uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
sahilmgandhi 18:6a4db94011d3 287 uint32_t C:1; /*!< bit: 29 Carry condition code flag */
sahilmgandhi 18:6a4db94011d3 288 uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
sahilmgandhi 18:6a4db94011d3 289 uint32_t N:1; /*!< bit: 31 Negative condition code flag */
sahilmgandhi 18:6a4db94011d3 290 } b; /*!< Structure used for bit access */
sahilmgandhi 18:6a4db94011d3 291 uint32_t w; /*!< Type used for word access */
sahilmgandhi 18:6a4db94011d3 292 } xPSR_Type;
sahilmgandhi 18:6a4db94011d3 293
sahilmgandhi 18:6a4db94011d3 294 /* xPSR Register Definitions */
sahilmgandhi 18:6a4db94011d3 295 #define xPSR_N_Pos 31 /*!< xPSR: N Position */
sahilmgandhi 18:6a4db94011d3 296 #define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
sahilmgandhi 18:6a4db94011d3 297
sahilmgandhi 18:6a4db94011d3 298 #define xPSR_Z_Pos 30 /*!< xPSR: Z Position */
sahilmgandhi 18:6a4db94011d3 299 #define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
sahilmgandhi 18:6a4db94011d3 300
sahilmgandhi 18:6a4db94011d3 301 #define xPSR_C_Pos 29 /*!< xPSR: C Position */
sahilmgandhi 18:6a4db94011d3 302 #define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
sahilmgandhi 18:6a4db94011d3 303
sahilmgandhi 18:6a4db94011d3 304 #define xPSR_V_Pos 28 /*!< xPSR: V Position */
sahilmgandhi 18:6a4db94011d3 305 #define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
sahilmgandhi 18:6a4db94011d3 306
sahilmgandhi 18:6a4db94011d3 307 #define xPSR_T_Pos 24 /*!< xPSR: T Position */
sahilmgandhi 18:6a4db94011d3 308 #define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
sahilmgandhi 18:6a4db94011d3 309
sahilmgandhi 18:6a4db94011d3 310 #define xPSR_ISR_Pos 0 /*!< xPSR: ISR Position */
sahilmgandhi 18:6a4db94011d3 311 #define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
sahilmgandhi 18:6a4db94011d3 312
sahilmgandhi 18:6a4db94011d3 313
sahilmgandhi 18:6a4db94011d3 314 /** \brief Union type to access the Control Registers (CONTROL).
sahilmgandhi 18:6a4db94011d3 315 */
sahilmgandhi 18:6a4db94011d3 316 typedef union
sahilmgandhi 18:6a4db94011d3 317 {
sahilmgandhi 18:6a4db94011d3 318 struct
sahilmgandhi 18:6a4db94011d3 319 {
sahilmgandhi 18:6a4db94011d3 320 uint32_t _reserved0:1; /*!< bit: 0 Reserved */
sahilmgandhi 18:6a4db94011d3 321 uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
sahilmgandhi 18:6a4db94011d3 322 uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
sahilmgandhi 18:6a4db94011d3 323 } b; /*!< Structure used for bit access */
sahilmgandhi 18:6a4db94011d3 324 uint32_t w; /*!< Type used for word access */
sahilmgandhi 18:6a4db94011d3 325 } CONTROL_Type;
sahilmgandhi 18:6a4db94011d3 326
sahilmgandhi 18:6a4db94011d3 327 /* CONTROL Register Definitions */
sahilmgandhi 18:6a4db94011d3 328 #define CONTROL_SPSEL_Pos 1 /*!< CONTROL: SPSEL Position */
sahilmgandhi 18:6a4db94011d3 329 #define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
sahilmgandhi 18:6a4db94011d3 330
sahilmgandhi 18:6a4db94011d3 331 /*@} end of group CMSIS_CORE */
sahilmgandhi 18:6a4db94011d3 332
sahilmgandhi 18:6a4db94011d3 333
sahilmgandhi 18:6a4db94011d3 334 /** \ingroup CMSIS_core_register
sahilmgandhi 18:6a4db94011d3 335 \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
sahilmgandhi 18:6a4db94011d3 336 \brief Type definitions for the NVIC Registers
sahilmgandhi 18:6a4db94011d3 337 @{
sahilmgandhi 18:6a4db94011d3 338 */
sahilmgandhi 18:6a4db94011d3 339
sahilmgandhi 18:6a4db94011d3 340 /** \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
sahilmgandhi 18:6a4db94011d3 341 */
sahilmgandhi 18:6a4db94011d3 342 typedef struct
sahilmgandhi 18:6a4db94011d3 343 {
sahilmgandhi 18:6a4db94011d3 344 __IO uint32_t ISER[1]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
sahilmgandhi 18:6a4db94011d3 345 uint32_t RESERVED0[31];
sahilmgandhi 18:6a4db94011d3 346 __IO uint32_t ICER[1]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
sahilmgandhi 18:6a4db94011d3 347 uint32_t RSERVED1[31];
sahilmgandhi 18:6a4db94011d3 348 __IO uint32_t ISPR[1]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
sahilmgandhi 18:6a4db94011d3 349 uint32_t RESERVED2[31];
sahilmgandhi 18:6a4db94011d3 350 __IO uint32_t ICPR[1]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
sahilmgandhi 18:6a4db94011d3 351 uint32_t RESERVED3[31];
sahilmgandhi 18:6a4db94011d3 352 uint32_t RESERVED4[64];
sahilmgandhi 18:6a4db94011d3 353 __IO uint32_t IP[8]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
sahilmgandhi 18:6a4db94011d3 354 } NVIC_Type;
sahilmgandhi 18:6a4db94011d3 355
sahilmgandhi 18:6a4db94011d3 356 /*@} end of group CMSIS_NVIC */
sahilmgandhi 18:6a4db94011d3 357
sahilmgandhi 18:6a4db94011d3 358
sahilmgandhi 18:6a4db94011d3 359 /** \ingroup CMSIS_core_register
sahilmgandhi 18:6a4db94011d3 360 \defgroup CMSIS_SCB System Control Block (SCB)
sahilmgandhi 18:6a4db94011d3 361 \brief Type definitions for the System Control Block Registers
sahilmgandhi 18:6a4db94011d3 362 @{
sahilmgandhi 18:6a4db94011d3 363 */
sahilmgandhi 18:6a4db94011d3 364
sahilmgandhi 18:6a4db94011d3 365 /** \brief Structure type to access the System Control Block (SCB).
sahilmgandhi 18:6a4db94011d3 366 */
sahilmgandhi 18:6a4db94011d3 367 typedef struct
sahilmgandhi 18:6a4db94011d3 368 {
sahilmgandhi 18:6a4db94011d3 369 __I uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
sahilmgandhi 18:6a4db94011d3 370 __IO uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
sahilmgandhi 18:6a4db94011d3 371 uint32_t RESERVED0;
sahilmgandhi 18:6a4db94011d3 372 __IO uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
sahilmgandhi 18:6a4db94011d3 373 __IO uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
sahilmgandhi 18:6a4db94011d3 374 __IO uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
sahilmgandhi 18:6a4db94011d3 375 uint32_t RESERVED1;
sahilmgandhi 18:6a4db94011d3 376 __IO uint32_t SHP[2]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
sahilmgandhi 18:6a4db94011d3 377 __IO uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
sahilmgandhi 18:6a4db94011d3 378 } SCB_Type;
sahilmgandhi 18:6a4db94011d3 379
sahilmgandhi 18:6a4db94011d3 380 /* SCB CPUID Register Definitions */
sahilmgandhi 18:6a4db94011d3 381 #define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
sahilmgandhi 18:6a4db94011d3 382 #define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
sahilmgandhi 18:6a4db94011d3 383
sahilmgandhi 18:6a4db94011d3 384 #define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
sahilmgandhi 18:6a4db94011d3 385 #define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
sahilmgandhi 18:6a4db94011d3 386
sahilmgandhi 18:6a4db94011d3 387 #define SCB_CPUID_ARCHITECTURE_Pos 16 /*!< SCB CPUID: ARCHITECTURE Position */
sahilmgandhi 18:6a4db94011d3 388 #define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
sahilmgandhi 18:6a4db94011d3 389
sahilmgandhi 18:6a4db94011d3 390 #define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
sahilmgandhi 18:6a4db94011d3 391 #define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
sahilmgandhi 18:6a4db94011d3 392
sahilmgandhi 18:6a4db94011d3 393 #define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
sahilmgandhi 18:6a4db94011d3 394 #define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
sahilmgandhi 18:6a4db94011d3 395
sahilmgandhi 18:6a4db94011d3 396 /* SCB Interrupt Control State Register Definitions */
sahilmgandhi 18:6a4db94011d3 397 #define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
sahilmgandhi 18:6a4db94011d3 398 #define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
sahilmgandhi 18:6a4db94011d3 399
sahilmgandhi 18:6a4db94011d3 400 #define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
sahilmgandhi 18:6a4db94011d3 401 #define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
sahilmgandhi 18:6a4db94011d3 402
sahilmgandhi 18:6a4db94011d3 403 #define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
sahilmgandhi 18:6a4db94011d3 404 #define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
sahilmgandhi 18:6a4db94011d3 405
sahilmgandhi 18:6a4db94011d3 406 #define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
sahilmgandhi 18:6a4db94011d3 407 #define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
sahilmgandhi 18:6a4db94011d3 408
sahilmgandhi 18:6a4db94011d3 409 #define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
sahilmgandhi 18:6a4db94011d3 410 #define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
sahilmgandhi 18:6a4db94011d3 411
sahilmgandhi 18:6a4db94011d3 412 #define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
sahilmgandhi 18:6a4db94011d3 413 #define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
sahilmgandhi 18:6a4db94011d3 414
sahilmgandhi 18:6a4db94011d3 415 #define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
sahilmgandhi 18:6a4db94011d3 416 #define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
sahilmgandhi 18:6a4db94011d3 417
sahilmgandhi 18:6a4db94011d3 418 #define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
sahilmgandhi 18:6a4db94011d3 419 #define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
sahilmgandhi 18:6a4db94011d3 420
sahilmgandhi 18:6a4db94011d3 421 #define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
sahilmgandhi 18:6a4db94011d3 422 #define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
sahilmgandhi 18:6a4db94011d3 423
sahilmgandhi 18:6a4db94011d3 424 /* SCB Application Interrupt and Reset Control Register Definitions */
sahilmgandhi 18:6a4db94011d3 425 #define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
sahilmgandhi 18:6a4db94011d3 426 #define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
sahilmgandhi 18:6a4db94011d3 427
sahilmgandhi 18:6a4db94011d3 428 #define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
sahilmgandhi 18:6a4db94011d3 429 #define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
sahilmgandhi 18:6a4db94011d3 430
sahilmgandhi 18:6a4db94011d3 431 #define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
sahilmgandhi 18:6a4db94011d3 432 #define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
sahilmgandhi 18:6a4db94011d3 433
sahilmgandhi 18:6a4db94011d3 434 #define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
sahilmgandhi 18:6a4db94011d3 435 #define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
sahilmgandhi 18:6a4db94011d3 436
sahilmgandhi 18:6a4db94011d3 437 #define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
sahilmgandhi 18:6a4db94011d3 438 #define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
sahilmgandhi 18:6a4db94011d3 439
sahilmgandhi 18:6a4db94011d3 440 /* SCB System Control Register Definitions */
sahilmgandhi 18:6a4db94011d3 441 #define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
sahilmgandhi 18:6a4db94011d3 442 #define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
sahilmgandhi 18:6a4db94011d3 443
sahilmgandhi 18:6a4db94011d3 444 #define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
sahilmgandhi 18:6a4db94011d3 445 #define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
sahilmgandhi 18:6a4db94011d3 446
sahilmgandhi 18:6a4db94011d3 447 #define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
sahilmgandhi 18:6a4db94011d3 448 #define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
sahilmgandhi 18:6a4db94011d3 449
sahilmgandhi 18:6a4db94011d3 450 /* SCB Configuration Control Register Definitions */
sahilmgandhi 18:6a4db94011d3 451 #define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
sahilmgandhi 18:6a4db94011d3 452 #define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
sahilmgandhi 18:6a4db94011d3 453
sahilmgandhi 18:6a4db94011d3 454 #define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
sahilmgandhi 18:6a4db94011d3 455 #define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
sahilmgandhi 18:6a4db94011d3 456
sahilmgandhi 18:6a4db94011d3 457 /* SCB System Handler Control and State Register Definitions */
sahilmgandhi 18:6a4db94011d3 458 #define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
sahilmgandhi 18:6a4db94011d3 459 #define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
sahilmgandhi 18:6a4db94011d3 460
sahilmgandhi 18:6a4db94011d3 461 /*@} end of group CMSIS_SCB */
sahilmgandhi 18:6a4db94011d3 462
sahilmgandhi 18:6a4db94011d3 463
sahilmgandhi 18:6a4db94011d3 464 /** \ingroup CMSIS_core_register
sahilmgandhi 18:6a4db94011d3 465 \defgroup CMSIS_SysTick System Tick Timer (SysTick)
sahilmgandhi 18:6a4db94011d3 466 \brief Type definitions for the System Timer Registers.
sahilmgandhi 18:6a4db94011d3 467 @{
sahilmgandhi 18:6a4db94011d3 468 */
sahilmgandhi 18:6a4db94011d3 469
sahilmgandhi 18:6a4db94011d3 470 /** \brief Structure type to access the System Timer (SysTick).
sahilmgandhi 18:6a4db94011d3 471 */
sahilmgandhi 18:6a4db94011d3 472 typedef struct
sahilmgandhi 18:6a4db94011d3 473 {
sahilmgandhi 18:6a4db94011d3 474 __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
sahilmgandhi 18:6a4db94011d3 475 __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
sahilmgandhi 18:6a4db94011d3 476 __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
sahilmgandhi 18:6a4db94011d3 477 __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
sahilmgandhi 18:6a4db94011d3 478 } SysTick_Type;
sahilmgandhi 18:6a4db94011d3 479
sahilmgandhi 18:6a4db94011d3 480 /* SysTick Control / Status Register Definitions */
sahilmgandhi 18:6a4db94011d3 481 #define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
sahilmgandhi 18:6a4db94011d3 482 #define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
sahilmgandhi 18:6a4db94011d3 483
sahilmgandhi 18:6a4db94011d3 484 #define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
sahilmgandhi 18:6a4db94011d3 485 #define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
sahilmgandhi 18:6a4db94011d3 486
sahilmgandhi 18:6a4db94011d3 487 #define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
sahilmgandhi 18:6a4db94011d3 488 #define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
sahilmgandhi 18:6a4db94011d3 489
sahilmgandhi 18:6a4db94011d3 490 #define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
sahilmgandhi 18:6a4db94011d3 491 #define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
sahilmgandhi 18:6a4db94011d3 492
sahilmgandhi 18:6a4db94011d3 493 /* SysTick Reload Register Definitions */
sahilmgandhi 18:6a4db94011d3 494 #define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
sahilmgandhi 18:6a4db94011d3 495 #define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
sahilmgandhi 18:6a4db94011d3 496
sahilmgandhi 18:6a4db94011d3 497 /* SysTick Current Register Definitions */
sahilmgandhi 18:6a4db94011d3 498 #define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
sahilmgandhi 18:6a4db94011d3 499 #define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
sahilmgandhi 18:6a4db94011d3 500
sahilmgandhi 18:6a4db94011d3 501 /* SysTick Calibration Register Definitions */
sahilmgandhi 18:6a4db94011d3 502 #define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
sahilmgandhi 18:6a4db94011d3 503 #define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
sahilmgandhi 18:6a4db94011d3 504
sahilmgandhi 18:6a4db94011d3 505 #define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
sahilmgandhi 18:6a4db94011d3 506 #define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
sahilmgandhi 18:6a4db94011d3 507
sahilmgandhi 18:6a4db94011d3 508 #define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
sahilmgandhi 18:6a4db94011d3 509 #define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
sahilmgandhi 18:6a4db94011d3 510
sahilmgandhi 18:6a4db94011d3 511 /*@} end of group CMSIS_SysTick */
sahilmgandhi 18:6a4db94011d3 512
sahilmgandhi 18:6a4db94011d3 513
sahilmgandhi 18:6a4db94011d3 514 /** \ingroup CMSIS_core_register
sahilmgandhi 18:6a4db94011d3 515 \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
sahilmgandhi 18:6a4db94011d3 516 \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR)
sahilmgandhi 18:6a4db94011d3 517 are only accessible over DAP and not via processor. Therefore
sahilmgandhi 18:6a4db94011d3 518 they are not covered by the Cortex-M0 header file.
sahilmgandhi 18:6a4db94011d3 519 @{
sahilmgandhi 18:6a4db94011d3 520 */
sahilmgandhi 18:6a4db94011d3 521 /*@} end of group CMSIS_CoreDebug */
sahilmgandhi 18:6a4db94011d3 522
sahilmgandhi 18:6a4db94011d3 523
sahilmgandhi 18:6a4db94011d3 524 /** \ingroup CMSIS_core_register
sahilmgandhi 18:6a4db94011d3 525 \defgroup CMSIS_core_base Core Definitions
sahilmgandhi 18:6a4db94011d3 526 \brief Definitions for base addresses, unions, and structures.
sahilmgandhi 18:6a4db94011d3 527 @{
sahilmgandhi 18:6a4db94011d3 528 */
sahilmgandhi 18:6a4db94011d3 529
sahilmgandhi 18:6a4db94011d3 530 /* Memory mapping of Cortex-M0 Hardware */
sahilmgandhi 18:6a4db94011d3 531 #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
sahilmgandhi 18:6a4db94011d3 532 #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
sahilmgandhi 18:6a4db94011d3 533 #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
sahilmgandhi 18:6a4db94011d3 534 #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
sahilmgandhi 18:6a4db94011d3 535
sahilmgandhi 18:6a4db94011d3 536 #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
sahilmgandhi 18:6a4db94011d3 537 #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
sahilmgandhi 18:6a4db94011d3 538 #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
sahilmgandhi 18:6a4db94011d3 539
sahilmgandhi 18:6a4db94011d3 540
sahilmgandhi 18:6a4db94011d3 541 /*@} */
sahilmgandhi 18:6a4db94011d3 542
sahilmgandhi 18:6a4db94011d3 543
sahilmgandhi 18:6a4db94011d3 544
sahilmgandhi 18:6a4db94011d3 545 /*******************************************************************************
sahilmgandhi 18:6a4db94011d3 546 * Hardware Abstraction Layer
sahilmgandhi 18:6a4db94011d3 547 Core Function Interface contains:
sahilmgandhi 18:6a4db94011d3 548 - Core NVIC Functions
sahilmgandhi 18:6a4db94011d3 549 - Core SysTick Functions
sahilmgandhi 18:6a4db94011d3 550 - Core Register Access Functions
sahilmgandhi 18:6a4db94011d3 551 ******************************************************************************/
sahilmgandhi 18:6a4db94011d3 552 /** \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
sahilmgandhi 18:6a4db94011d3 553 */
sahilmgandhi 18:6a4db94011d3 554
sahilmgandhi 18:6a4db94011d3 555
sahilmgandhi 18:6a4db94011d3 556
sahilmgandhi 18:6a4db94011d3 557 /* ########################## NVIC functions #################################### */
sahilmgandhi 18:6a4db94011d3 558 /** \ingroup CMSIS_Core_FunctionInterface
sahilmgandhi 18:6a4db94011d3 559 \defgroup CMSIS_Core_NVICFunctions NVIC Functions
sahilmgandhi 18:6a4db94011d3 560 \brief Functions that manage interrupts and exceptions via the NVIC.
sahilmgandhi 18:6a4db94011d3 561 @{
sahilmgandhi 18:6a4db94011d3 562 */
sahilmgandhi 18:6a4db94011d3 563
sahilmgandhi 18:6a4db94011d3 564 /* Interrupt Priorities are WORD accessible only under ARMv6M */
sahilmgandhi 18:6a4db94011d3 565 /* The following MACROS handle generation of the register offset and byte masks */
sahilmgandhi 18:6a4db94011d3 566 #define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
sahilmgandhi 18:6a4db94011d3 567 #define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
sahilmgandhi 18:6a4db94011d3 568 #define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
sahilmgandhi 18:6a4db94011d3 569
sahilmgandhi 18:6a4db94011d3 570
sahilmgandhi 18:6a4db94011d3 571 /** \brief Enable External Interrupt
sahilmgandhi 18:6a4db94011d3 572
sahilmgandhi 18:6a4db94011d3 573 The function enables a device-specific interrupt in the NVIC interrupt controller.
sahilmgandhi 18:6a4db94011d3 574
sahilmgandhi 18:6a4db94011d3 575 \param [in] IRQn External interrupt number. Value cannot be negative.
sahilmgandhi 18:6a4db94011d3 576 */
sahilmgandhi 18:6a4db94011d3 577 __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
sahilmgandhi 18:6a4db94011d3 578 {
sahilmgandhi 18:6a4db94011d3 579 NVIC->ISER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
sahilmgandhi 18:6a4db94011d3 580 }
sahilmgandhi 18:6a4db94011d3 581
sahilmgandhi 18:6a4db94011d3 582
sahilmgandhi 18:6a4db94011d3 583 /** \brief Disable External Interrupt
sahilmgandhi 18:6a4db94011d3 584
sahilmgandhi 18:6a4db94011d3 585 The function disables a device-specific interrupt in the NVIC interrupt controller.
sahilmgandhi 18:6a4db94011d3 586
sahilmgandhi 18:6a4db94011d3 587 \param [in] IRQn External interrupt number. Value cannot be negative.
sahilmgandhi 18:6a4db94011d3 588 */
sahilmgandhi 18:6a4db94011d3 589 __STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
sahilmgandhi 18:6a4db94011d3 590 {
sahilmgandhi 18:6a4db94011d3 591 NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
sahilmgandhi 18:6a4db94011d3 592 __DSB();
sahilmgandhi 18:6a4db94011d3 593 __ISB();
sahilmgandhi 18:6a4db94011d3 594 }
sahilmgandhi 18:6a4db94011d3 595
sahilmgandhi 18:6a4db94011d3 596
sahilmgandhi 18:6a4db94011d3 597 /** \brief Get Pending Interrupt
sahilmgandhi 18:6a4db94011d3 598
sahilmgandhi 18:6a4db94011d3 599 The function reads the pending register in the NVIC and returns the pending bit
sahilmgandhi 18:6a4db94011d3 600 for the specified interrupt.
sahilmgandhi 18:6a4db94011d3 601
sahilmgandhi 18:6a4db94011d3 602 \param [in] IRQn Interrupt number.
sahilmgandhi 18:6a4db94011d3 603
sahilmgandhi 18:6a4db94011d3 604 \return 0 Interrupt status is not pending.
sahilmgandhi 18:6a4db94011d3 605 \return 1 Interrupt status is pending.
sahilmgandhi 18:6a4db94011d3 606 */
sahilmgandhi 18:6a4db94011d3 607 __STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
sahilmgandhi 18:6a4db94011d3 608 {
sahilmgandhi 18:6a4db94011d3 609 return((uint32_t)(((NVIC->ISPR[0] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
sahilmgandhi 18:6a4db94011d3 610 }
sahilmgandhi 18:6a4db94011d3 611
sahilmgandhi 18:6a4db94011d3 612
sahilmgandhi 18:6a4db94011d3 613 /** \brief Set Pending Interrupt
sahilmgandhi 18:6a4db94011d3 614
sahilmgandhi 18:6a4db94011d3 615 The function sets the pending bit of an external interrupt.
sahilmgandhi 18:6a4db94011d3 616
sahilmgandhi 18:6a4db94011d3 617 \param [in] IRQn Interrupt number. Value cannot be negative.
sahilmgandhi 18:6a4db94011d3 618 */
sahilmgandhi 18:6a4db94011d3 619 __STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
sahilmgandhi 18:6a4db94011d3 620 {
sahilmgandhi 18:6a4db94011d3 621 NVIC->ISPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
sahilmgandhi 18:6a4db94011d3 622 }
sahilmgandhi 18:6a4db94011d3 623
sahilmgandhi 18:6a4db94011d3 624
sahilmgandhi 18:6a4db94011d3 625 /** \brief Clear Pending Interrupt
sahilmgandhi 18:6a4db94011d3 626
sahilmgandhi 18:6a4db94011d3 627 The function clears the pending bit of an external interrupt.
sahilmgandhi 18:6a4db94011d3 628
sahilmgandhi 18:6a4db94011d3 629 \param [in] IRQn External interrupt number. Value cannot be negative.
sahilmgandhi 18:6a4db94011d3 630 */
sahilmgandhi 18:6a4db94011d3 631 __STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
sahilmgandhi 18:6a4db94011d3 632 {
sahilmgandhi 18:6a4db94011d3 633 NVIC->ICPR[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
sahilmgandhi 18:6a4db94011d3 634 }
sahilmgandhi 18:6a4db94011d3 635
sahilmgandhi 18:6a4db94011d3 636
sahilmgandhi 18:6a4db94011d3 637 /** \brief Set Interrupt Priority
sahilmgandhi 18:6a4db94011d3 638
sahilmgandhi 18:6a4db94011d3 639 The function sets the priority of an interrupt.
sahilmgandhi 18:6a4db94011d3 640
sahilmgandhi 18:6a4db94011d3 641 \note The priority cannot be set for every core interrupt.
sahilmgandhi 18:6a4db94011d3 642
sahilmgandhi 18:6a4db94011d3 643 \param [in] IRQn Interrupt number.
sahilmgandhi 18:6a4db94011d3 644 \param [in] priority Priority to set.
sahilmgandhi 18:6a4db94011d3 645 */
sahilmgandhi 18:6a4db94011d3 646 __STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
sahilmgandhi 18:6a4db94011d3 647 {
sahilmgandhi 18:6a4db94011d3 648 if((int32_t)(IRQn) < 0) {
sahilmgandhi 18:6a4db94011d3 649 SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
sahilmgandhi 18:6a4db94011d3 650 (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
sahilmgandhi 18:6a4db94011d3 651 }
sahilmgandhi 18:6a4db94011d3 652 else {
sahilmgandhi 18:6a4db94011d3 653 NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
sahilmgandhi 18:6a4db94011d3 654 (((priority << (8 - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
sahilmgandhi 18:6a4db94011d3 655 }
sahilmgandhi 18:6a4db94011d3 656 }
sahilmgandhi 18:6a4db94011d3 657
sahilmgandhi 18:6a4db94011d3 658
sahilmgandhi 18:6a4db94011d3 659 /** \brief Get Interrupt Priority
sahilmgandhi 18:6a4db94011d3 660
sahilmgandhi 18:6a4db94011d3 661 The function reads the priority of an interrupt. The interrupt
sahilmgandhi 18:6a4db94011d3 662 number can be positive to specify an external (device specific)
sahilmgandhi 18:6a4db94011d3 663 interrupt, or negative to specify an internal (core) interrupt.
sahilmgandhi 18:6a4db94011d3 664
sahilmgandhi 18:6a4db94011d3 665
sahilmgandhi 18:6a4db94011d3 666 \param [in] IRQn Interrupt number.
sahilmgandhi 18:6a4db94011d3 667 \return Interrupt Priority. Value is aligned automatically to the implemented
sahilmgandhi 18:6a4db94011d3 668 priority bits of the microcontroller.
sahilmgandhi 18:6a4db94011d3 669 */
sahilmgandhi 18:6a4db94011d3 670 __STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
sahilmgandhi 18:6a4db94011d3 671 {
sahilmgandhi 18:6a4db94011d3 672
sahilmgandhi 18:6a4db94011d3 673 if((int32_t)(IRQn) < 0) {
sahilmgandhi 18:6a4db94011d3 674 return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS)));
sahilmgandhi 18:6a4db94011d3 675 }
sahilmgandhi 18:6a4db94011d3 676 else {
sahilmgandhi 18:6a4db94011d3 677 return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8 - __NVIC_PRIO_BITS)));
sahilmgandhi 18:6a4db94011d3 678 }
sahilmgandhi 18:6a4db94011d3 679 }
sahilmgandhi 18:6a4db94011d3 680
sahilmgandhi 18:6a4db94011d3 681
sahilmgandhi 18:6a4db94011d3 682 /** \brief System Reset
sahilmgandhi 18:6a4db94011d3 683
sahilmgandhi 18:6a4db94011d3 684 The function initiates a system reset request to reset the MCU.
sahilmgandhi 18:6a4db94011d3 685 */
sahilmgandhi 18:6a4db94011d3 686 __STATIC_INLINE void NVIC_SystemReset(void)
sahilmgandhi 18:6a4db94011d3 687 {
sahilmgandhi 18:6a4db94011d3 688 __DSB(); /* Ensure all outstanding memory accesses included
sahilmgandhi 18:6a4db94011d3 689 buffered write are completed before reset */
sahilmgandhi 18:6a4db94011d3 690 SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
sahilmgandhi 18:6a4db94011d3 691 SCB_AIRCR_SYSRESETREQ_Msk);
sahilmgandhi 18:6a4db94011d3 692 __DSB(); /* Ensure completion of memory access */
sahilmgandhi 18:6a4db94011d3 693 while(1) { __NOP(); } /* wait until reset */
sahilmgandhi 18:6a4db94011d3 694 }
sahilmgandhi 18:6a4db94011d3 695
sahilmgandhi 18:6a4db94011d3 696 /*@} end of CMSIS_Core_NVICFunctions */
sahilmgandhi 18:6a4db94011d3 697
sahilmgandhi 18:6a4db94011d3 698
sahilmgandhi 18:6a4db94011d3 699
sahilmgandhi 18:6a4db94011d3 700 /* ################################## SysTick function ############################################ */
sahilmgandhi 18:6a4db94011d3 701 /** \ingroup CMSIS_Core_FunctionInterface
sahilmgandhi 18:6a4db94011d3 702 \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
sahilmgandhi 18:6a4db94011d3 703 \brief Functions that configure the System.
sahilmgandhi 18:6a4db94011d3 704 @{
sahilmgandhi 18:6a4db94011d3 705 */
sahilmgandhi 18:6a4db94011d3 706
sahilmgandhi 18:6a4db94011d3 707 #if (__Vendor_SysTickConfig == 0)
sahilmgandhi 18:6a4db94011d3 708
sahilmgandhi 18:6a4db94011d3 709 /** \brief System Tick Configuration
sahilmgandhi 18:6a4db94011d3 710
sahilmgandhi 18:6a4db94011d3 711 The function initializes the System Timer and its interrupt, and starts the System Tick Timer.
sahilmgandhi 18:6a4db94011d3 712 Counter is in free running mode to generate periodic interrupts.
sahilmgandhi 18:6a4db94011d3 713
sahilmgandhi 18:6a4db94011d3 714 \param [in] ticks Number of ticks between two interrupts.
sahilmgandhi 18:6a4db94011d3 715
sahilmgandhi 18:6a4db94011d3 716 \return 0 Function succeeded.
sahilmgandhi 18:6a4db94011d3 717 \return 1 Function failed.
sahilmgandhi 18:6a4db94011d3 718
sahilmgandhi 18:6a4db94011d3 719 \note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
sahilmgandhi 18:6a4db94011d3 720 function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
sahilmgandhi 18:6a4db94011d3 721 must contain a vendor-specific implementation of this function.
sahilmgandhi 18:6a4db94011d3 722
sahilmgandhi 18:6a4db94011d3 723 */
sahilmgandhi 18:6a4db94011d3 724 __STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
sahilmgandhi 18:6a4db94011d3 725 {
sahilmgandhi 18:6a4db94011d3 726 if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) { return (1UL); } /* Reload value impossible */
sahilmgandhi 18:6a4db94011d3 727
sahilmgandhi 18:6a4db94011d3 728 SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
sahilmgandhi 18:6a4db94011d3 729 NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
sahilmgandhi 18:6a4db94011d3 730 SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
sahilmgandhi 18:6a4db94011d3 731 SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
sahilmgandhi 18:6a4db94011d3 732 SysTick_CTRL_TICKINT_Msk |
sahilmgandhi 18:6a4db94011d3 733 SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
sahilmgandhi 18:6a4db94011d3 734 return (0UL); /* Function successful */
sahilmgandhi 18:6a4db94011d3 735 }
sahilmgandhi 18:6a4db94011d3 736
sahilmgandhi 18:6a4db94011d3 737 #endif
sahilmgandhi 18:6a4db94011d3 738
sahilmgandhi 18:6a4db94011d3 739 /*@} end of CMSIS_Core_SysTickFunctions */
sahilmgandhi 18:6a4db94011d3 740
sahilmgandhi 18:6a4db94011d3 741
sahilmgandhi 18:6a4db94011d3 742
sahilmgandhi 18:6a4db94011d3 743
sahilmgandhi 18:6a4db94011d3 744 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 745 }
sahilmgandhi 18:6a4db94011d3 746 #endif
sahilmgandhi 18:6a4db94011d3 747
sahilmgandhi 18:6a4db94011d3 748 #endif /* __CORE_CM0_H_DEPENDANT */
sahilmgandhi 18:6a4db94011d3 749
sahilmgandhi 18:6a4db94011d3 750 #endif /* __CMSIS_GENERIC */