Subversion Repositories DashDisplay

Rev

Rev 49 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 49 Rev 50
Line 1... Line 1...
1
/**************************************************************************//**
1
/**************************************************************************//**
2
 * @file     core_sc300.h
2
 * @file     core_sc300.h
3
 * @brief    CMSIS SC300 Core Peripheral Access Layer Header File
3
 * @brief    CMSIS SC300 Core Peripheral Access Layer Header File
4
 * @version  V4.30
4
 * @version  V5.0.6
5
 * @date     20. October 2015
5
 * @date     04. June 2018
6
 ******************************************************************************/
6
 ******************************************************************************/
-
 
7
/*
7
/* Copyright (c) 2009 - 2015 ARM LIMITED
8
 * Copyright (c) 2009-2018 Arm Limited. All rights reserved.
8
 
9
 *
9
   All rights reserved.
10
 * SPDX-License-Identifier: Apache-2.0
10
   Redistribution and use in source and binary forms, with or without
-
 
11
   modification, are permitted provided that the following conditions are met:
-
 
-
 
11
 *
12
   - Redistributions of source code must retain the above copyright
12
 * Licensed under the Apache License, Version 2.0 (the License); you may
13
     notice, this list of conditions and the following disclaimer.
13
 * not use this file except in compliance with the License.
14
   - Redistributions in binary form must reproduce the above copyright
14
 * You may obtain a copy of the License at
15
     notice, this list of conditions and the following disclaimer in the
-
 
16
     documentation and/or other materials provided with the distribution.
-
 
17
   - Neither the name of ARM nor the names of its contributors may be used
-
 
18
     to endorse or promote products derived from this software without
-
 
-
 
15
 *
19
     specific prior written permission.
16
 * www.apache.org/licenses/LICENSE-2.0
20
   *
17
 *
21
   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-
 
22
   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-
 
23
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-
 
24
   ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
-
 
25
   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-
 
26
   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-
 
27
   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
18
 * Unless required by applicable law or agreed to in writing, software
28
   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
19
 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
29
   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
20
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21
 * See the License for the specific language governing permissions and
31
   POSSIBILITY OF SUCH DAMAGE.
22
 * limitations under the License.
32
   ---------------------------------------------------------------------------*/
-
 
33
 
23
 */
34
 
24
 
35
#if   defined ( __ICCARM__ )
25
#if   defined ( __ICCARM__ )
36
 #pragma system_include         /* treat file as system include file for MISRA check */
26
  #pragma system_include         /* treat file as system include file for MISRA check */
37
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
27
#elif defined (__clang__)
38
  #pragma clang system_header   /* treat file as system include file */
28
  #pragma clang system_header   /* treat file as system include file */
39
#endif
29
#endif
40
 
30
 
41
#ifndef __CORE_SC300_H_GENERIC
31
#ifndef __CORE_SC300_H_GENERIC
42
#define __CORE_SC300_H_GENERIC
32
#define __CORE_SC300_H_GENERIC
Line 68... Line 58...
68
/**
58
/**
69
  \ingroup SC3000
59
  \ingroup SC3000
70
  @{
60
  @{
71
 */
61
 */
72
 
62
 
-
 
63
#include "cmsis_version.h"
-
 
64
 
73
/*  CMSIS SC300 definitions */
65
/*  CMSIS SC300 definitions */
74
#define __SC300_CMSIS_VERSION_MAIN  (0x04U)                                    /*!< [31:16] CMSIS HAL main version */
66
#define __SC300_CMSIS_VERSION_MAIN  (__CM_CMSIS_VERSION_MAIN)                /*!< \deprecated [31:16] CMSIS HAL main version */
75
#define __SC300_CMSIS_VERSION_SUB   (0x1EU)                                    /*!< [15:0]  CMSIS HAL sub version */
67
#define __SC300_CMSIS_VERSION_SUB   (__CM_CMSIS_VERSION_SUB)                 /*!< \deprecated [15:0]  CMSIS HAL sub version */
76
#define __SC300_CMSIS_VERSION       ((__SC300_CMSIS_VERSION_MAIN << 16U) | \
68
#define __SC300_CMSIS_VERSION       ((__SC300_CMSIS_VERSION_MAIN << 16U) | \
77
                                      __SC300_CMSIS_VERSION_SUB           )    /*!< CMSIS HAL version number */
69
                                      __SC300_CMSIS_VERSION_SUB           )  /*!< \deprecated CMSIS HAL version number */
78
 
-
 
79
#define __CORTEX_SC                 (300U)                                     /*!< Cortex secure core */
-
 
80
 
-
 
81
 
-
 
82
#if   defined ( __CC_ARM )
-
 
83
  #define __ASM            __asm                                      /*!< asm keyword for ARM Compiler */
-
 
84
  #define __INLINE         __inline                                   /*!< inline keyword for ARM Compiler */
-
 
85
  #define __STATIC_INLINE  static __inline
-
 
86
 
-
 
87
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
-
 
88
  #define __ASM            __asm                                      /*!< asm keyword for ARM Compiler */
-
 
89
  #define __INLINE         __inline                                   /*!< inline keyword for ARM Compiler */
-
 
90
  #define __STATIC_INLINE  static __inline
-
 
91
 
-
 
92
#elif defined ( __GNUC__ )
-
 
93
  #define __ASM            __asm                                      /*!< asm keyword for GNU Compiler */
-
 
94
  #define __INLINE         inline                                     /*!< inline keyword for GNU Compiler */
-
 
95
  #define __STATIC_INLINE  static inline
-
 
96
 
-
 
97
#elif defined ( __ICCARM__ )
-
 
98
  #define __ASM            __asm                                      /*!< asm keyword for IAR Compiler */
-
 
99
  #define __INLINE         inline                                     /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */
-
 
100
  #define __STATIC_INLINE  static inline
-
 
101
 
-
 
102
#elif defined ( __TMS470__ )
-
 
103
  #define __ASM            __asm                                      /*!< asm keyword for TI CCS Compiler */
-
 
104
  #define __STATIC_INLINE  static inline
-
 
105
 
-
 
106
#elif defined ( __TASKING__ )
-
 
107
  #define __ASM            __asm                                      /*!< asm keyword for TASKING Compiler */
-
 
108
  #define __INLINE         inline                                     /*!< inline keyword for TASKING Compiler */
-
 
109
  #define __STATIC_INLINE  static inline
-
 
110
 
70
 
111
#elif defined ( __CSMC__ )
-
 
112
  #define __packed
-
 
113
  #define __ASM            _asm                                      /*!< asm keyword for COSMIC Compiler */
71
#define __CORTEX_SC                 (300U)                                   /*!< Cortex secure core */
114
  #define __INLINE         inline                                    /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */
-
 
115
  #define __STATIC_INLINE  static inline
-
 
116
 
-
 
117
#else
-
 
118
  #error Unknown compiler
-
 
119
#endif
-
 
120
 
72
 
121
/** __FPU_USED indicates whether an FPU is used or not.
73
/** __FPU_USED indicates whether an FPU is used or not.
122
    This core does not support an FPU at all
74
    This core does not support an FPU at all
123
*/
75
*/
124
#define __FPU_USED       0U
76
#define __FPU_USED       0U
Line 126... Line 78...
126
#if defined ( __CC_ARM )
78
#if defined ( __CC_ARM )
127
  #if defined __TARGET_FPU_VFP
79
  #if defined __TARGET_FPU_VFP
128
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
80
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
129
  #endif
81
  #endif
130
 
82
 
131
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
83
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
132
  #if defined __ARM_PCS_VFP
84
  #if defined __ARM_PCS_VFP
133
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
85
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
134
  #endif
86
  #endif
135
 
87
 
136
#elif defined ( __GNUC__ )
88
#elif defined ( __GNUC__ )
Line 141... Line 93...
141
#elif defined ( __ICCARM__ )
93
#elif defined ( __ICCARM__ )
142
  #if defined __ARMVFP__
94
  #if defined __ARMVFP__
143
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
95
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
144
  #endif
96
  #endif
145
 
97
 
146
#elif defined ( __TMS470__ )
98
#elif defined ( __TI_ARM__ )
147
  #if defined __TI_VFP_SUPPORT__
99
  #if defined __TI_VFP_SUPPORT__
148
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
100
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
149
  #endif
101
  #endif
150
 
102
 
151
#elif defined ( __TASKING__ )
103
#elif defined ( __TASKING__ )
Line 158... Line 110...
158
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
110
    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
159
  #endif
111
  #endif
160
 
112
 
161
#endif
113
#endif
162
 
114
 
163
#include "core_cmInstr.h"                /* Core Instruction Access */
115
#include "cmsis_compiler.h"               /* CMSIS compiler specific defines */
164
#include "core_cmFunc.h"                 /* Core Function Access */
-
 
-
 
116
 
165
 
117
 
166
#ifdef __cplusplus
118
#ifdef __cplusplus
167
}
119
}
168
#endif
120
#endif
169
 
121
 
Line 189... Line 141...
189
    #define __MPU_PRESENT             0U
141
    #define __MPU_PRESENT             0U
190
    #warning "__MPU_PRESENT not defined in device header file; using default!"
142
    #warning "__MPU_PRESENT not defined in device header file; using default!"
191
  #endif
143
  #endif
192
 
144
 
193
  #ifndef __NVIC_PRIO_BITS
145
  #ifndef __NVIC_PRIO_BITS
194
    #define __NVIC_PRIO_BITS          4U
146
    #define __NVIC_PRIO_BITS          3U
195
    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
147
    #warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
196
  #endif
148
  #endif
197
 
149
 
198
  #ifndef __Vendor_SysTickConfig
150
  #ifndef __Vendor_SysTickConfig
199
    #define __Vendor_SysTickConfig    0U
151
    #define __Vendor_SysTickConfig    0U
Line 306... Line 258...
306
typedef union
258
typedef union
307
{
259
{
308
  struct
260
  struct
309
  {
261
  {
310
    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */
262
    uint32_t ISR:9;                      /*!< bit:  0.. 8  Exception number */
-
 
263
    uint32_t _reserved0:1;               /*!< bit:      9  Reserved */
-
 
264
    uint32_t ICI_IT_1:6;                 /*!< bit: 10..15  ICI/IT part 1 */
311
    uint32_t _reserved0:15;              /*!< bit:  9..23  Reserved */
265
    uint32_t _reserved1:8;               /*!< bit: 16..23  Reserved */
312
    uint32_t T:1;                        /*!< bit:     24  Thumb bit        (read 0) */
266
    uint32_t T:1;                        /*!< bit:     24  Thumb bit */
313
    uint32_t IT:2;                       /*!< bit: 25..26  saved IT state   (read 0) */
267
    uint32_t ICI_IT_2:2;                 /*!< bit: 25..26  ICI/IT part 2 */
314
    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */
268
    uint32_t Q:1;                        /*!< bit:     27  Saturation condition flag */
315
    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */
269
    uint32_t V:1;                        /*!< bit:     28  Overflow condition code flag */
316
    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */
270
    uint32_t C:1;                        /*!< bit:     29  Carry condition code flag */
317
    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */
271
    uint32_t Z:1;                        /*!< bit:     30  Zero condition code flag */
318
    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */
272
    uint32_t N:1;                        /*!< bit:     31  Negative condition code flag */
Line 334... Line 288...
334
#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */
288
#define xPSR_V_Msk                         (1UL << xPSR_V_Pos)                            /*!< xPSR: V Mask */
335
 
289
 
336
#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */
290
#define xPSR_Q_Pos                         27U                                            /*!< xPSR: Q Position */
337
#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */
291
#define xPSR_Q_Msk                         (1UL << xPSR_Q_Pos)                            /*!< xPSR: Q Mask */
338
 
292
 
339
#define xPSR_IT_Pos                        25U                                            /*!< xPSR: IT Position */
293
#define xPSR_ICI_IT_2_Pos                  25U                                            /*!< xPSR: ICI/IT part 2 Position */
340
#define xPSR_IT_Msk                        (3UL << xPSR_IT_Pos)                           /*!< xPSR: IT Mask */
294
#define xPSR_ICI_IT_2_Msk                  (3UL << xPSR_ICI_IT_2_Pos)                     /*!< xPSR: ICI/IT part 2 Mask */
341
 
295
 
342
#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */
296
#define xPSR_T_Pos                         24U                                            /*!< xPSR: T Position */
343
#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */
297
#define xPSR_T_Msk                         (1UL << xPSR_T_Pos)                            /*!< xPSR: T Mask */
344
 
298
 
-
 
299
#define xPSR_ICI_IT_1_Pos                  10U                                            /*!< xPSR: ICI/IT part 1 Position */
-
 
300
#define xPSR_ICI_IT_1_Msk                  (0x3FUL << xPSR_ICI_IT_1_Pos)                  /*!< xPSR: ICI/IT part 1 Mask */
-
 
301
 
345
#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */
302
#define xPSR_ISR_Pos                        0U                                            /*!< xPSR: ISR Position */
346
#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */
303
#define xPSR_ISR_Msk                       (0x1FFUL /*<< xPSR_ISR_Pos*/)                  /*!< xPSR: ISR Mask */
347
 
304
 
348
 
305
 
349
/**
306
/**
Line 597... Line 554...
597
#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */
554
#define SCB_CFSR_BUSFAULTSR_Msk            (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos)            /*!< SCB CFSR: Bus Fault Status Register Mask */
598
 
555
 
599
#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */
556
#define SCB_CFSR_MEMFAULTSR_Pos             0U                                            /*!< SCB CFSR: Memory Manage Fault Status Register Position */
600
#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
557
#define SCB_CFSR_MEMFAULTSR_Msk            (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/)        /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
601
 
558
 
-
 
559
/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */
-
 
560
#define SCB_CFSR_MMARVALID_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 7U)               /*!< SCB CFSR (MMFSR): MMARVALID Position */
-
 
561
#define SCB_CFSR_MMARVALID_Msk             (1UL << SCB_CFSR_MMARVALID_Pos)                /*!< SCB CFSR (MMFSR): MMARVALID Mask */
-
 
562
 
-
 
563
#define SCB_CFSR_MSTKERR_Pos               (SCB_SHCSR_MEMFAULTACT_Pos + 4U)               /*!< SCB CFSR (MMFSR): MSTKERR Position */
-
 
564
#define SCB_CFSR_MSTKERR_Msk               (1UL << SCB_CFSR_MSTKERR_Pos)                  /*!< SCB CFSR (MMFSR): MSTKERR Mask */
-
 
565
 
-
 
566
#define SCB_CFSR_MUNSTKERR_Pos             (SCB_SHCSR_MEMFAULTACT_Pos + 3U)               /*!< SCB CFSR (MMFSR): MUNSTKERR Position */
-
 
567
#define SCB_CFSR_MUNSTKERR_Msk             (1UL << SCB_CFSR_MUNSTKERR_Pos)                /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */
-
 
568
 
-
 
569
#define SCB_CFSR_DACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 1U)               /*!< SCB CFSR (MMFSR): DACCVIOL Position */
-
 
570
#define SCB_CFSR_DACCVIOL_Msk              (1UL << SCB_CFSR_DACCVIOL_Pos)                 /*!< SCB CFSR (MMFSR): DACCVIOL Mask */
-
 
571
 
-
 
572
#define SCB_CFSR_IACCVIOL_Pos              (SCB_SHCSR_MEMFAULTACT_Pos + 0U)               /*!< SCB CFSR (MMFSR): IACCVIOL Position */
-
 
573
#define SCB_CFSR_IACCVIOL_Msk              (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/)             /*!< SCB CFSR (MMFSR): IACCVIOL Mask */
-
 
574
 
-
 
575
/* BusFault Status Register (part of SCB Configurable Fault Status Register) */
-
 
576
#define SCB_CFSR_BFARVALID_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 7U)                  /*!< SCB CFSR (BFSR): BFARVALID Position */
-
 
577
#define SCB_CFSR_BFARVALID_Msk            (1UL << SCB_CFSR_BFARVALID_Pos)                 /*!< SCB CFSR (BFSR): BFARVALID Mask */
-
 
578
 
-
 
579
#define SCB_CFSR_STKERR_Pos               (SCB_CFSR_BUSFAULTSR_Pos + 4U)                  /*!< SCB CFSR (BFSR): STKERR Position */
-
 
580
#define SCB_CFSR_STKERR_Msk               (1UL << SCB_CFSR_STKERR_Pos)                    /*!< SCB CFSR (BFSR): STKERR Mask */
-
 
581
 
-
 
582
#define SCB_CFSR_UNSTKERR_Pos             (SCB_CFSR_BUSFAULTSR_Pos + 3U)                  /*!< SCB CFSR (BFSR): UNSTKERR Position */
-
 
583
#define SCB_CFSR_UNSTKERR_Msk             (1UL << SCB_CFSR_UNSTKERR_Pos)                  /*!< SCB CFSR (BFSR): UNSTKERR Mask */
-
 
584
 
-
 
585
#define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
-
 
586
#define SCB_CFSR_IMPRECISERR_Msk          (1UL << SCB_CFSR_IMPRECISERR_Pos)               /*!< SCB CFSR (BFSR): IMPRECISERR Mask */
-
 
587
 
-
 
588
#define SCB_CFSR_PRECISERR_Pos            (SCB_CFSR_BUSFAULTSR_Pos + 1U)                  /*!< SCB CFSR (BFSR): PRECISERR Position */
-
 
589
#define SCB_CFSR_PRECISERR_Msk            (1UL << SCB_CFSR_PRECISERR_Pos)                 /*!< SCB CFSR (BFSR): PRECISERR Mask */
-
 
590
 
-
 
591
#define SCB_CFSR_IBUSERR_Pos              (SCB_CFSR_BUSFAULTSR_Pos + 0U)                  /*!< SCB CFSR (BFSR): IBUSERR Position */
-
 
592
#define SCB_CFSR_IBUSERR_Msk              (1UL << SCB_CFSR_IBUSERR_Pos)                   /*!< SCB CFSR (BFSR): IBUSERR Mask */
-
 
593
 
-
 
594
/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */
-
 
595
#define SCB_CFSR_DIVBYZERO_Pos            (SCB_CFSR_USGFAULTSR_Pos + 9U)                  /*!< SCB CFSR (UFSR): DIVBYZERO Position */
-
 
596
#define SCB_CFSR_DIVBYZERO_Msk            (1UL << SCB_CFSR_DIVBYZERO_Pos)                 /*!< SCB CFSR (UFSR): DIVBYZERO Mask */
-
 
597
 
-
 
598
#define SCB_CFSR_UNALIGNED_Pos            (SCB_CFSR_USGFAULTSR_Pos + 8U)                  /*!< SCB CFSR (UFSR): UNALIGNED Position */
-
 
599
#define SCB_CFSR_UNALIGNED_Msk            (1UL << SCB_CFSR_UNALIGNED_Pos)                 /*!< SCB CFSR (UFSR): UNALIGNED Mask */
-
 
600
 
-
 
601
#define SCB_CFSR_NOCP_Pos                 (SCB_CFSR_USGFAULTSR_Pos + 3U)                  /*!< SCB CFSR (UFSR): NOCP Position */
-
 
602
#define SCB_CFSR_NOCP_Msk                 (1UL << SCB_CFSR_NOCP_Pos)                      /*!< SCB CFSR (UFSR): NOCP Mask */
-
 
603
 
-
 
604
#define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
-
 
605
#define SCB_CFSR_INVPC_Msk                (1UL << SCB_CFSR_INVPC_Pos)                     /*!< SCB CFSR (UFSR): INVPC Mask */
-
 
606
 
-
 
607
#define SCB_CFSR_INVSTATE_Pos             (SCB_CFSR_USGFAULTSR_Pos + 1U)                  /*!< SCB CFSR (UFSR): INVSTATE Position */
-
 
608
#define SCB_CFSR_INVSTATE_Msk             (1UL << SCB_CFSR_INVSTATE_Pos)                  /*!< SCB CFSR (UFSR): INVSTATE Mask */
-
 
609
 
-
 
610
#define SCB_CFSR_UNDEFINSTR_Pos           (SCB_CFSR_USGFAULTSR_Pos + 0U)                  /*!< SCB CFSR (UFSR): UNDEFINSTR Position */
-
 
611
#define SCB_CFSR_UNDEFINSTR_Msk           (1UL << SCB_CFSR_UNDEFINSTR_Pos)                /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */
-
 
612
 
602
/* SCB Hard Fault Status Register Definitions */
613
/* SCB Hard Fault Status Register Definitions */
603
#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */
614
#define SCB_HFSR_DEBUGEVT_Pos              31U                                            /*!< SCB HFSR: DEBUGEVT Position */
604
#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */
615
#define SCB_HFSR_DEBUGEVT_Msk              (1UL << SCB_HFSR_DEBUGEVT_Pos)                 /*!< SCB HFSR: DEBUGEVT Mask */
605
 
616
 
606
#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */
617
#define SCB_HFSR_FORCED_Pos                30U                                            /*!< SCB HFSR: FORCED Position */
Line 964... Line 975...
964
/**
975
/**
965
  \brief  Structure type to access the Trace Port Interface Register (TPI).
976
  \brief  Structure type to access the Trace Port Interface Register (TPI).
966
 */
977
 */
967
typedef struct
978
typedef struct
968
{
979
{
969
  __IOM uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */
980
  __IM  uint32_t SSPSR;                  /*!< Offset: 0x000 (R/ )  Supported Parallel Port Size Register */
970
  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */
981
  __IOM uint32_t CSPSR;                  /*!< Offset: 0x004 (R/W)  Current Parallel Port Size Register */
971
        uint32_t RESERVED0[2U];
982
        uint32_t RESERVED0[2U];
972
  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */
983
  __IOM uint32_t ACPR;                   /*!< Offset: 0x010 (R/W)  Asynchronous Clock Prescaler Register */
973
        uint32_t RESERVED1[55U];
984
        uint32_t RESERVED1[55U];
974
  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */
985
  __IOM uint32_t SPPR;                   /*!< Offset: 0x0F0 (R/W)  Selected Pin Protocol Register */
975
        uint32_t RESERVED2[131U];
986
        uint32_t RESERVED2[131U];
976
  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */
987
  __IM  uint32_t FFSR;                   /*!< Offset: 0x300 (R/ )  Formatter and Flush Status Register */
977
  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */
988
  __IOM uint32_t FFCR;                   /*!< Offset: 0x304 (R/W)  Formatter and Flush Control Register */
978
  __IM  uint32_t FSCR;                   /*!< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register */
989
  __IM  uint32_t FSCR;                   /*!< Offset: 0x308 (R/ )  Formatter Synchronization Counter Register */
979
        uint32_t RESERVED3[759U];
990
        uint32_t RESERVED3[759U];
980
  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER */
991
  __IM  uint32_t TRIGGER;                /*!< Offset: 0xEE8 (R/ )  TRIGGER Register */
981
  __IM  uint32_t FIFO0;                  /*!< Offset: 0xEEC (R/ )  Integration ETM Data */
992
  __IM  uint32_t FIFO0;                  /*!< Offset: 0xEEC (R/ )  Integration ETM Data */
982
  __IM  uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/ )  ITATBCTR2 */
993
  __IM  uint32_t ITATBCTR2;              /*!< Offset: 0xEF0 (R/ )  ITATBCTR2 */
983
        uint32_t RESERVED4[1U];
994
        uint32_t RESERVED4[1U];
984
  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  ITATBCTR0 */
995
  __IM  uint32_t ITATBCTR0;              /*!< Offset: 0xEF8 (R/ )  ITATBCTR0 */
985
  __IM  uint32_t FIFO1;                  /*!< Offset: 0xEFC (R/ )  Integration ITM Data */
996
  __IM  uint32_t FIFO1;                  /*!< Offset: 0xEFC (R/ )  Integration ITM Data */
Line 1045... Line 1056...
1045
 
1056
 
1046
#define TPI_FIFO0_ETM0_Pos                  0U                                         /*!< TPI FIFO0: ETM0 Position */
1057
#define TPI_FIFO0_ETM0_Pos                  0U                                         /*!< TPI FIFO0: ETM0 Position */
1047
#define TPI_FIFO0_ETM0_Msk                 (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)          /*!< TPI FIFO0: ETM0 Mask */
1058
#define TPI_FIFO0_ETM0_Msk                 (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/)          /*!< TPI FIFO0: ETM0 Mask */
1048
 
1059
 
1049
/* TPI ITATBCTR2 Register Definitions */
1060
/* TPI ITATBCTR2 Register Definitions */
1050
#define TPI_ITATBCTR2_ATREADY_Pos           0U                                         /*!< TPI ITATBCTR2: ATREADY Position */
1061
#define TPI_ITATBCTR2_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY2 Position */
-
 
1062
#define TPI_ITATBCTR2_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/)   /*!< TPI ITATBCTR2: ATREADY2 Mask */
-
 
1063
 
-
 
1064
#define TPI_ITATBCTR2_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR2: ATREADY1 Position */
1051
#define TPI_ITATBCTR2_ATREADY_Msk          (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/)    /*!< TPI ITATBCTR2: ATREADY Mask */
1065
#define TPI_ITATBCTR2_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/)   /*!< TPI ITATBCTR2: ATREADY1 Mask */
1052
 
1066
 
1053
/* TPI Integration ITM Data Register Definitions (FIFO1) */
1067
/* TPI Integration ITM Data Register Definitions (FIFO1) */
1054
#define TPI_FIFO1_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO1: ITM_ATVALID Position */
1068
#define TPI_FIFO1_ITM_ATVALID_Pos          29U                                         /*!< TPI FIFO1: ITM_ATVALID Position */
1055
#define TPI_FIFO1_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)        /*!< TPI FIFO1: ITM_ATVALID Mask */
1069
#define TPI_FIFO1_ITM_ATVALID_Msk          (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos)        /*!< TPI FIFO1: ITM_ATVALID Mask */
1056
 
1070
 
Line 1071... Line 1085...
1071
 
1085
 
1072
#define TPI_FIFO1_ITM0_Pos                  0U                                         /*!< TPI FIFO1: ITM0 Position */
1086
#define TPI_FIFO1_ITM0_Pos                  0U                                         /*!< TPI FIFO1: ITM0 Position */
1073
#define TPI_FIFO1_ITM0_Msk                 (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)          /*!< TPI FIFO1: ITM0 Mask */
1087
#define TPI_FIFO1_ITM0_Msk                 (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/)          /*!< TPI FIFO1: ITM0 Mask */
1074
 
1088
 
1075
/* TPI ITATBCTR0 Register Definitions */
1089
/* TPI ITATBCTR0 Register Definitions */
1076
#define TPI_ITATBCTR0_ATREADY_Pos           0U                                         /*!< TPI ITATBCTR0: ATREADY Position */
1090
#define TPI_ITATBCTR0_ATREADY2_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY2 Position */
-
 
1091
#define TPI_ITATBCTR0_ATREADY2_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/)   /*!< TPI ITATBCTR0: ATREADY2 Mask */
-
 
1092
 
-
 
1093
#define TPI_ITATBCTR0_ATREADY1_Pos          0U                                         /*!< TPI ITATBCTR0: ATREADY1 Position */
1077
#define TPI_ITATBCTR0_ATREADY_Msk          (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/)    /*!< TPI ITATBCTR0: ATREADY Mask */
1094
#define TPI_ITATBCTR0_ATREADY1_Msk         (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/)   /*!< TPI ITATBCTR0: ATREADY1 Mask */
1078
 
1095
 
1079
/* TPI Integration Mode Control Register Definitions */
1096
/* TPI Integration Mode Control Register Definitions */
1080
#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */
1097
#define TPI_ITCTRL_Mode_Pos                 0U                                         /*!< TPI ITCTRL: Mode Position */
1081
#define TPI_ITCTRL_Mode_Msk                (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */
1098
#define TPI_ITCTRL_Mode_Msk                (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/)          /*!< TPI ITCTRL: Mode Mask */
1082
 
1099
 
1083
/* TPI DEVID Register Definitions */
1100
/* TPI DEVID Register Definitions */
1084
#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */
1101
#define TPI_DEVID_NRZVALID_Pos             11U                                         /*!< TPI DEVID: NRZVALID Position */
1085
#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */
1102
#define TPI_DEVID_NRZVALID_Msk             (0x1UL << TPI_DEVID_NRZVALID_Pos)           /*!< TPI DEVID: NRZVALID Mask */
1086
 
1103
 
Line 1098... Line 1115...
1098
 
1115
 
1099
#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */
1116
#define TPI_DEVID_NrTraceInput_Pos          0U                                         /*!< TPI DEVID: NrTraceInput Position */
1100
#define TPI_DEVID_NrTraceInput_Msk         (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */
1117
#define TPI_DEVID_NrTraceInput_Msk         (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/)  /*!< TPI DEVID: NrTraceInput Mask */
1101
 
1118
 
1102
/* TPI DEVTYPE Register Definitions */
1119
/* TPI DEVTYPE Register Definitions */
1103
#define TPI_DEVTYPE_MajorType_Pos           4U                                         /*!< TPI DEVTYPE: MajorType Position */
-
 
1104
#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */
-
 
1105
 
-
 
1106
#define TPI_DEVTYPE_SubType_Pos             0U                                         /*!< TPI DEVTYPE: SubType Position */
1120
#define TPI_DEVTYPE_SubType_Pos             4U                                         /*!< TPI DEVTYPE: SubType Position */
1107
#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */
1121
#define TPI_DEVTYPE_SubType_Msk            (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/)      /*!< TPI DEVTYPE: SubType Mask */
1108
 
1122
 
-
 
1123
#define TPI_DEVTYPE_MajorType_Pos           0U                                         /*!< TPI DEVTYPE: MajorType Position */
-
 
1124
#define TPI_DEVTYPE_MajorType_Msk          (0xFUL << TPI_DEVTYPE_MajorType_Pos)        /*!< TPI DEVTYPE: MajorType Mask */
-
 
1125
 
1109
/*@}*/ /* end of group CMSIS_TPI */
1126
/*@}*/ /* end of group CMSIS_TPI */
1110
 
1127
 
1111
 
1128
 
1112
#if (__MPU_PRESENT == 1U)
1129
#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1113
/**
1130
/**
1114
  \ingroup  CMSIS_core_register
1131
  \ingroup  CMSIS_core_register
1115
  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)
1132
  \defgroup CMSIS_MPU     Memory Protection Unit (MPU)
1116
  \brief    Type definitions for the Memory Protection Unit (MPU)
1133
  \brief    Type definitions for the Memory Protection Unit (MPU)
1117
  @{
1134
  @{
Line 1317... Line 1334...
1317
 */
1334
 */
1318
 
1335
 
1319
/**
1336
/**
1320
  \brief   Mask and shift a bit field value for use in a register bit range.
1337
  \brief   Mask and shift a bit field value for use in a register bit range.
1321
  \param[in] field  Name of the register bit field.
1338
  \param[in] field  Name of the register bit field.
1322
  \param[in] value  Value of the bit field.
1339
  \param[in] value  Value of the bit field. This parameter is interpreted as an uint32_t type.
1323
  \return           Masked and shifted value.
1340
  \return           Masked and shifted value.
1324
*/
1341
*/
1325
#define _VAL2FLD(field, value)    ((value << field ## _Pos) & field ## _Msk)
1342
#define _VAL2FLD(field, value)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
1326
 
1343
 
1327
/**
1344
/**
1328
  \brief     Mask and shift a register value to extract a bit filed value.
1345
  \brief     Mask and shift a register value to extract a bit filed value.
1329
  \param[in] field  Name of the register bit field.
1346
  \param[in] field  Name of the register bit field.
1330
  \param[in] value  Value of register.
1347
  \param[in] value  Value of register. This parameter is interpreted as an uint32_t type.
1331
  \return           Masked and shifted bit field value.
1348
  \return           Masked and shifted bit field value.
1332
*/
1349
*/
1333
#define _FLD2VAL(field, value)    ((value & field ## _Msk) >> field ## _Pos)
1350
#define _FLD2VAL(field, value)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
1334
 
1351
 
1335
/*@} end of group CMSIS_core_bitfield */
1352
/*@} end of group CMSIS_core_bitfield */
1336
 
1353
 
1337
 
1354
 
1338
/**
1355
/**
Line 1340... Line 1357...
1340
  \defgroup   CMSIS_core_base     Core Definitions
1357
  \defgroup   CMSIS_core_base     Core Definitions
1341
  \brief      Definitions for base addresses, unions, and structures.
1358
  \brief      Definitions for base addresses, unions, and structures.
1342
  @{
1359
  @{
1343
 */
1360
 */
1344
 
1361
 
1345
/* Memory mapping of Cortex-M3 Hardware */
1362
/* Memory mapping of Core Hardware */
1346
#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */
1363
#define SCS_BASE            (0xE000E000UL)                            /*!< System Control Space Base Address */
1347
#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address */
1364
#define ITM_BASE            (0xE0000000UL)                            /*!< ITM Base Address */
1348
#define DWT_BASE            (0xE0001000UL)                            /*!< DWT Base Address */
1365
#define DWT_BASE            (0xE0001000UL)                            /*!< DWT Base Address */
1349
#define TPI_BASE            (0xE0040000UL)                            /*!< TPI Base Address */
1366
#define TPI_BASE            (0xE0040000UL)                            /*!< TPI Base Address */
1350
#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address */
1367
#define CoreDebug_BASE      (0xE000EDF0UL)                            /*!< Core Debug Base Address */
Line 1359... Line 1376...
1359
#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct */
1376
#define ITM                 ((ITM_Type       *)     ITM_BASE      )   /*!< ITM configuration struct */
1360
#define DWT                 ((DWT_Type       *)     DWT_BASE      )   /*!< DWT configuration struct */
1377
#define DWT                 ((DWT_Type       *)     DWT_BASE      )   /*!< DWT configuration struct */
1361
#define TPI                 ((TPI_Type       *)     TPI_BASE      )   /*!< TPI configuration struct */
1378
#define TPI                 ((TPI_Type       *)     TPI_BASE      )   /*!< TPI configuration struct */
1362
#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct */
1379
#define CoreDebug           ((CoreDebug_Type *)     CoreDebug_BASE)   /*!< Core Debug configuration struct */
1363
 
1380
 
1364
#if (__MPU_PRESENT == 1U)
1381
#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
1365
  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */
1382
  #define MPU_BASE          (SCS_BASE +  0x0D90UL)                    /*!< Memory Protection Unit */
1366
  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */
1383
  #define MPU               ((MPU_Type       *)     MPU_BASE      )   /*!< Memory Protection Unit */
1367
#endif
1384
#endif
1368
 
1385
 
1369
/*@} */
1386
/*@} */
Line 1390... Line 1407...
1390
  \defgroup CMSIS_Core_NVICFunctions NVIC Functions
1407
  \defgroup CMSIS_Core_NVICFunctions NVIC Functions
1391
  \brief    Functions that manage interrupts and exceptions via the NVIC.
1408
  \brief    Functions that manage interrupts and exceptions via the NVIC.
1392
  @{
1409
  @{
1393
 */
1410
 */
1394
 
1411
 
-
 
1412
#ifdef CMSIS_NVIC_VIRTUAL
-
 
1413
  #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
-
 
1414
    #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
-
 
1415
  #endif
-
 
1416
  #include CMSIS_NVIC_VIRTUAL_HEADER_FILE
-
 
1417
#else
-
 
1418
  #define NVIC_SetPriorityGrouping    __NVIC_SetPriorityGrouping
-
 
1419
  #define NVIC_GetPriorityGrouping    __NVIC_GetPriorityGrouping
-
 
1420
  #define NVIC_EnableIRQ              __NVIC_EnableIRQ
-
 
1421
  #define NVIC_GetEnableIRQ           __NVIC_GetEnableIRQ
-
 
1422
  #define NVIC_DisableIRQ             __NVIC_DisableIRQ
-
 
1423
  #define NVIC_GetPendingIRQ          __NVIC_GetPendingIRQ
-
 
1424
  #define NVIC_SetPendingIRQ          __NVIC_SetPendingIRQ
-
 
1425
  #define NVIC_ClearPendingIRQ        __NVIC_ClearPendingIRQ
-
 
1426
  #define NVIC_GetActive              __NVIC_GetActive
-
 
1427
  #define NVIC_SetPriority            __NVIC_SetPriority
-
 
1428
  #define NVIC_GetPriority            __NVIC_GetPriority
-
 
1429
  #define NVIC_SystemReset            __NVIC_SystemReset
-
 
1430
#endif /* CMSIS_NVIC_VIRTUAL */
-
 
1431
 
-
 
1432
#ifdef CMSIS_VECTAB_VIRTUAL
-
 
1433
  #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
-
 
1434
    #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
-
 
1435
  #endif
-
 
1436
  #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
-
 
1437
#else
-
 
1438
  #define NVIC_SetVector              __NVIC_SetVector
-
 
1439
  #define NVIC_GetVector              __NVIC_GetVector
-
 
1440
#endif  /* (CMSIS_VECTAB_VIRTUAL) */
-
 
1441
 
-
 
1442
#define NVIC_USER_IRQ_OFFSET          16
-
 
1443
 
-
 
1444
 
-
 
1445
/* The following EXC_RETURN values are saved the LR on exception entry */
-
 
1446
#define EXC_RETURN_HANDLER         (0xFFFFFFF1UL)     /* return to Handler mode, uses MSP after return                               */
-
 
1447
#define EXC_RETURN_THREAD_MSP      (0xFFFFFFF9UL)     /* return to Thread mode, uses MSP after return                                */
-
 
1448
#define EXC_RETURN_THREAD_PSP      (0xFFFFFFFDUL)     /* return to Thread mode, uses PSP after return                                */
-
 
1449
 
-
 
1450
 
-
 
1451
 
1395
/**
1452
/**
1396
  \brief   Set Priority Grouping
1453
  \brief   Set Priority Grouping
1397
  \details Sets the priority grouping field using the required unlock sequence.
1454
  \details Sets the priority grouping field using the required unlock sequence.
1398
           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
1455
           The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
1399
           Only values from 0..7 are used.
1456
           Only values from 0..7 are used.
1400
           In case of a conflict between priority grouping and available
1457
           In case of a conflict between priority grouping and available
1401
           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
1458
           priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
1402
  \param [in]      PriorityGroup  Priority grouping field.
1459
  \param [in]      PriorityGroup  Priority grouping field.
1403
 */
1460
 */
1404
__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
1461
__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
1405
{
1462
{
1406
  uint32_t reg_value;
1463
  uint32_t reg_value;
1407
  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */
1464
  uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL);             /* only values 0..7 are used          */
1408
 
1465
 
1409
  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */
1466
  reg_value  =  SCB->AIRCR;                                                   /* read old register configuration    */
Line 1418... Line 1475...
1418
/**
1475
/**
1419
  \brief   Get Priority Grouping
1476
  \brief   Get Priority Grouping
1420
  \details Reads the priority grouping field from the NVIC Interrupt Controller.
1477
  \details Reads the priority grouping field from the NVIC Interrupt Controller.
1421
  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
1478
  \return                Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
1422
 */
1479
 */
1423
__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void)
1480
__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
1424
{
1481
{
1425
  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
1482
  return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
1426
}
1483
}
1427
 
1484
 
1428
 
1485
 
1429
/**
1486
/**
1430
  \brief   Enable External Interrupt
1487
  \brief   Enable Interrupt
1431
  \details Enables a device-specific interrupt in the NVIC interrupt controller.
1488
  \details Enables a device specific interrupt in the NVIC interrupt controller.
1432
  \param [in]      IRQn  External interrupt number. Value cannot be negative.
1489
  \param [in]      IRQn  Device specific interrupt number.
-
 
1490
  \note    IRQn must not be negative.
1433
 */
1491
 */
1434
__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
1492
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
1435
{
1493
{
-
 
1494
  if ((int32_t)(IRQn) >= 0)
-
 
1495
  {
1436
  NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1496
    NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
-
 
1497
  }
1437
}
1498
}
1438
 
1499
 
1439
 
1500
 
1440
/**
1501
/**
1441
  \brief   Disable External Interrupt
1502
  \brief   Get Interrupt Enable status
1442
  \details Disables a device-specific interrupt in the NVIC interrupt controller.
1503
  \details Returns a device specific interrupt enable status from the NVIC interrupt controller.
1443
  \param [in]      IRQn  External interrupt number. Value cannot be negative.
1504
  \param [in]      IRQn  Device specific interrupt number.
-
 
1505
  \return             0  Interrupt is not enabled.
-
 
1506
  \return             1  Interrupt is enabled.
-
 
1507
  \note    IRQn must not be negative.
1444
 */
1508
 */
1445
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
1509
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
1446
{
1510
{
-
 
1511
  if ((int32_t)(IRQn) >= 0)
-
 
1512
  {
-
 
1513
    return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
-
 
1514
  }
-
 
1515
  else
-
 
1516
  {
-
 
1517
    return(0U);
-
 
1518
  }
-
 
1519
}
-
 
1520
 
-
 
1521
 
-
 
1522
/**
-
 
1523
  \brief   Disable Interrupt
-
 
1524
  \details Disables a device specific interrupt in the NVIC interrupt controller.
-
 
1525
  \param [in]      IRQn  Device specific interrupt number.
-
 
1526
  \note    IRQn must not be negative.
-
 
1527
 */
-
 
1528
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
-
 
1529
{
-
 
1530
  if ((int32_t)(IRQn) >= 0)
-
 
1531
  {
1447
  NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1532
    NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
-
 
1533
    __DSB();
-
 
1534
    __ISB();
-
 
1535
  }
1448
}
1536
}
1449
 
1537
 
1450
 
1538
 
1451
/**
1539
/**
1452
  \brief   Get Pending Interrupt
1540
  \brief   Get Pending Interrupt
1453
  \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt.
1541
  \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
1454
  \param [in]      IRQn  Interrupt number.
1542
  \param [in]      IRQn  Device specific interrupt number.
1455
  \return             0  Interrupt status is not pending.
1543
  \return             0  Interrupt status is not pending.
1456
  \return             1  Interrupt status is pending.
1544
  \return             1  Interrupt status is pending.
-
 
1545
  \note    IRQn must not be negative.
1457
 */
1546
 */
1458
__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
1547
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
1459
{
1548
{
-
 
1549
  if ((int32_t)(IRQn) >= 0)
-
 
1550
  {
1460
  return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1551
    return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
-
 
1552
  }
-
 
1553
  else
-
 
1554
  {
-
 
1555
    return(0U);
-
 
1556
  }
1461
}
1557
}
1462
 
1558
 
1463
 
1559
 
1464
/**
1560
/**
1465
  \brief   Set Pending Interrupt
1561
  \brief   Set Pending Interrupt
1466
  \details Sets the pending bit of an external interrupt.
1562
  \details Sets the pending bit of a device specific interrupt in the NVIC pending register.
1467
  \param [in]      IRQn  Interrupt number. Value cannot be negative.
1563
  \param [in]      IRQn  Device specific interrupt number.
-
 
1564
  \note    IRQn must not be negative.
1468
 */
1565
 */
1469
__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
1566
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
1470
{
1567
{
-
 
1568
  if ((int32_t)(IRQn) >= 0)
-
 
1569
  {
1471
  NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1570
    NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
-
 
1571
  }
1472
}
1572
}
1473
 
1573
 
1474
 
1574
 
1475
/**
1575
/**
1476
  \brief   Clear Pending Interrupt
1576
  \brief   Clear Pending Interrupt
1477
  \details Clears the pending bit of an external interrupt.
1577
  \details Clears the pending bit of a device specific interrupt in the NVIC pending register.
1478
  \param [in]      IRQn  External interrupt number. Value cannot be negative.
1578
  \param [in]      IRQn  Device specific interrupt number.
-
 
1579
  \note    IRQn must not be negative.
1479
 */
1580
 */
1480
__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
1581
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
1481
{
1582
{
-
 
1583
  if ((int32_t)(IRQn) >= 0)
-
 
1584
  {
1482
  NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1585
    NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
-
 
1586
  }
1483
}
1587
}
1484
 
1588
 
1485
 
1589
 
1486
/**
1590
/**
1487
  \brief   Get Active Interrupt
1591
  \brief   Get Active Interrupt
1488
  \details Reads the active register in NVIC and returns the active bit.
1592
  \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
1489
  \param [in]      IRQn  Interrupt number.
1593
  \param [in]      IRQn  Device specific interrupt number.
1490
  \return             0  Interrupt status is not active.
1594
  \return             0  Interrupt status is not active.
1491
  \return             1  Interrupt status is active.
1595
  \return             1  Interrupt status is active.
-
 
1596
  \note    IRQn must not be negative.
1492
 */
1597
 */
1493
__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
1598
__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
1494
{
1599
{
-
 
1600
  if ((int32_t)(IRQn) >= 0)
-
 
1601
  {
1495
  return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
1602
    return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
-
 
1603
  }
-
 
1604
  else
-
 
1605
  {
-
 
1606
    return(0U);
-
 
1607
  }
1496
}
1608
}
1497
 
1609
 
1498
 
1610
 
1499
/**
1611
/**
1500
  \brief   Set Interrupt Priority
1612
  \brief   Set Interrupt Priority
1501
  \details Sets the priority of an interrupt.
1613
  \details Sets the priority of a device specific interrupt or a processor exception.
1502
  \note    The priority cannot be set for every core interrupt.
1614
           The interrupt number can be positive to specify a device specific interrupt,
-
 
1615
           or negative to specify a processor exception.
1503
  \param [in]      IRQn  Interrupt number.
1616
  \param [in]      IRQn  Interrupt number.
1504
  \param [in]  priority  Priority to set.
1617
  \param [in]  priority  Priority to set.
-
 
1618
  \note    The priority cannot be set for every processor exception.
1505
 */
1619
 */
1506
__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
1620
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
1507
{
1621
{
1508
  if ((int32_t)(IRQn) < 0)
1622
  if ((int32_t)(IRQn) >= 0)
1509
  {
1623
  {
1510
    SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
1624
    NVIC->IP[((uint32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
1511
  }
1625
  }
1512
  else
1626
  else
1513
  {
1627
  {
1514
    NVIC->IP[((uint32_t)(int32_t)IRQn)]               = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
1628
    SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
1515
  }
1629
  }
1516
}
1630
}
1517
 
1631
 
1518
 
1632
 
1519
/**
1633
/**
1520
  \brief   Get Interrupt Priority
1634
  \brief   Get Interrupt Priority
1521
  \details Reads the priority of an interrupt.
1635
  \details Reads the priority of a device specific interrupt or a processor exception.
1522
           The interrupt number can be positive to specify an external (device specific) interrupt,
1636
           The interrupt number can be positive to specify a device specific interrupt,
1523
           or negative to specify an internal (core) interrupt.
1637
           or negative to specify a processor exception.
1524
  \param [in]   IRQn  Interrupt number.
1638
  \param [in]   IRQn  Interrupt number.
1525
  \return             Interrupt Priority.
1639
  \return             Interrupt Priority.
1526
                      Value is aligned automatically to the implemented priority bits of the microcontroller.
1640
                      Value is aligned automatically to the implemented priority bits of the microcontroller.
1527
 */
1641
 */
1528
__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
1642
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
1529
{
1643
{
1530
 
1644
 
1531
  if ((int32_t)(IRQn) < 0)
1645
  if ((int32_t)(IRQn) >= 0)
1532
  {
1646
  {
1533
    return(((uint32_t)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
1647
    return(((uint32_t)NVIC->IP[((uint32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));
1534
  }
1648
  }
1535
  else
1649
  else
1536
  {
1650
  {
1537
    return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)]               >> (8U - __NVIC_PRIO_BITS)));
1651
    return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
1538
  }
1652
  }
1539
}
1653
}
1540
 
1654
 
1541
 
1655
 
1542
/**
1656
/**
Line 1590... Line 1704...
1590
  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);
1704
  *pSubPriority     = (Priority                   ) & (uint32_t)((1UL << (SubPriorityBits    )) - 1UL);
1591
}
1705
}
1592
 
1706
 
1593
 
1707
 
1594
/**
1708
/**
-
 
1709
  \brief   Set Interrupt Vector
-
 
1710
  \details Sets an interrupt vector in SRAM based interrupt vector table.
-
 
1711
           The interrupt number can be positive to specify a device specific interrupt,
-
 
1712
           or negative to specify a processor exception.
-
 
1713
           VTOR must been relocated to SRAM before.
-
 
1714
  \param [in]   IRQn      Interrupt number
-
 
1715
  \param [in]   vector    Address of interrupt handler function
-
 
1716
 */
-
 
1717
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
-
 
1718
{
-
 
1719
  uint32_t *vectors = (uint32_t *)SCB->VTOR;
-
 
1720
  vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
-
 
1721
}
-
 
1722
 
-
 
1723
 
-
 
1724
/**
-
 
1725
  \brief   Get Interrupt Vector
-
 
1726
  \details Reads an interrupt vector from interrupt vector table.
-
 
1727
           The interrupt number can be positive to specify a device specific interrupt,
-
 
1728
           or negative to specify a processor exception.
-
 
1729
  \param [in]   IRQn      Interrupt number.
-
 
1730
  \return                 Address of interrupt handler function
-
 
1731
 */
-
 
1732
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
-
 
1733
{
-
 
1734
  uint32_t *vectors = (uint32_t *)SCB->VTOR;
-
 
1735
  return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
-
 
1736
}
-
 
1737
 
-
 
1738
 
-
 
1739
/**
1595
  \brief   System Reset
1740
  \brief   System Reset
1596
  \details Initiates a system reset request to reset the MCU.
1741
  \details Initiates a system reset request to reset the MCU.
1597
 */
1742
 */
1598
__STATIC_INLINE void NVIC_SystemReset(void)
1743
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
1599
{
1744
{
1600
  __DSB();                                                          /* Ensure all outstanding memory accesses included
1745
  __DSB();                                                          /* Ensure all outstanding memory accesses included
1601
                                                                       buffered write are completed before reset */
1746
                                                                       buffered write are completed before reset */
1602
  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |
1747
  SCB->AIRCR  = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos)    |
1603
                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
1748
                           (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
Line 1611... Line 1756...
1611
}
1756
}
1612
 
1757
 
1613
/*@} end of CMSIS_Core_NVICFunctions */
1758
/*@} end of CMSIS_Core_NVICFunctions */
1614
 
1759
 
1615
 
1760
 
-
 
1761
/* ##########################  FPU functions  #################################### */
-
 
1762
/**
-
 
1763
  \ingroup  CMSIS_Core_FunctionInterface
-
 
1764
  \defgroup CMSIS_Core_FpuFunctions FPU Functions
-
 
1765
  \brief    Function that provides FPU type.
-
 
1766
  @{
-
 
1767
 */
-
 
1768
 
-
 
1769
/**
-
 
1770
  \brief   get FPU type
-
 
1771
  \details returns the FPU type
-
 
1772
  \returns
-
 
1773
   - \b  0: No FPU
-
 
1774
   - \b  1: Single precision FPU
-
 
1775
   - \b  2: Double + Single precision FPU
-
 
1776
 */
-
 
1777
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
-
 
1778
{
-
 
1779
    return 0U;           /* No FPU */
-
 
1780
}
-
 
1781
 
-
 
1782
 
-
 
1783
/*@} end of CMSIS_Core_FpuFunctions */
-
 
1784
 
-
 
1785
 
1616
 
1786
 
1617
/* ##################################    SysTick function  ############################################ */
1787
/* ##################################    SysTick function  ############################################ */
1618
/**
1788
/**
1619
  \ingroup  CMSIS_Core_FunctionInterface
1789
  \ingroup  CMSIS_Core_FunctionInterface
1620
  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
1790
  \defgroup CMSIS_Core_SysTickFunctions SysTick Functions
1621
  \brief    Functions that configure the System.
1791
  \brief    Functions that configure the System.
1622
  @{
1792
  @{
1623
 */
1793
 */
1624
 
1794
 
1625
#if (__Vendor_SysTickConfig == 0U)
1795
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
1626
 
1796
 
1627
/**
1797
/**
1628
  \brief   System Tick Configuration
1798
  \brief   System Tick Configuration
1629
  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
1799
  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
1630
           Counter is in free running mode to generate periodic interrupts.
1800
           Counter is in free running mode to generate periodic interrupts.
Line 1663... Line 1833...
1663
  \defgroup CMSIS_core_DebugFunctions ITM Functions
1833
  \defgroup CMSIS_core_DebugFunctions ITM Functions
1664
  \brief    Functions that access the ITM debug interface.
1834
  \brief    Functions that access the ITM debug interface.
1665
  @{
1835
  @{
1666
 */
1836
 */
1667
 
1837
 
1668
extern volatile int32_t ITM_RxBuffer;                    /*!< External variable to receive characters. */
1838
extern volatile int32_t ITM_RxBuffer;                              /*!< External variable to receive characters. */
1669
#define                 ITM_RXBUFFER_EMPTY   0x5AA55AA5U /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
1839
#define                 ITM_RXBUFFER_EMPTY  ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
1670
 
1840
 
1671
 
1841
 
1672
/**
1842
/**
1673
  \brief   ITM Send Character
1843
  \brief   ITM Send Character
1674
  \details Transmits a character via the ITM channel 0, and
1844
  \details Transmits a character via the ITM channel 0, and