Imt.Base C++ API
V4.1.1.0
Loading...
Searching...
No Matches
Core_CortexM3.h
Go to the documentation of this file.
1
// (c) IMT - Information Management Technology AG, CH-9470 Buchs, www.imt.ch.
2
3
#ifndef CORE_CORTEXM3_H
4
#define CORE_CORTEXM3_H
5
6
#include <
Imt.Base.Core.Platform/Platform.h
>
7
8
#include "
SystemMemoryMap.h
"
9
10
// System Control Block (SCB) register structure
11
// Reference: Cortex-M3 Devices Generic User Guide DUI0552A Table 4-12
12
typedef
struct
{
13
// Offset: 0x00 CPU ID Base Register
14
uint32_t
volatile
CPUID;
15
// Offset: 0x04 Interrupt Control State Register
16
uint32_t
volatile
ICSR;
17
// Offset: 0x08 Vector Table Offset Register
18
uint32_t
volatile
VTOR;
19
// Offset: 0x0C Application Interrupt / Reset Control Register
20
uint32_t
volatile
AIRCR;
21
// Offset: 0x10 System Control Register
22
uint32_t
volatile
SCR;
23
// Offset: 0x14 Configuration Control Register
24
uint32_t
volatile
CCR;
25
// Offset: 0x18 System Handlers Priority Registers (4-7, 8-11, 12-15)
26
uint8_t
volatile
SHPR[12];
27
// Offset: 0x24 System Handler Control and State Register
28
uint32_t
volatile
SHCRS;
29
// Offset: 0x28 Configurable Fault Status Register
30
uint32_t
volatile
CFSR;
31
// Offset: 0x2C Hard Fault Status Register
32
uint32_t
volatile
HFSR;
33
// Offset: 0x30 Debug Fault Status Register
34
uint32_t
volatile
DFSR;
35
// Offset: 0x34 Mem Manage Address Register
36
uint32_t
volatile
MMAR;
37
// Offset: 0x38 Bus Fault Address Register
38
uint32_t
volatile
BFAR;
39
// Offset: 0x3C Auxiliary Fault Status Register
40
uint32_t
volatile
AFSR;
41
}
SCB_Type
;
42
// SCB configuration struct
43
#define SCB ((SCB_Type*)SCB_BASE)
44
45
// Bit definition for SCB_ICSR register
46
47
// Active ISR number field
48
#define SCB_ICSR_VECTACTIVE ((uint32_t)0x000001FF)
49
// All active exceptions minus the IPSR_current_exception yields the empty set
50
#define SCB_ICSR_RETTOBASE ((uint32_t)0x00000800)
51
// Pending ISR number field
52
#define SCB_ICSR_VECTPENDING ((uint32_t)0x003FF000)
53
// Interrupt pending flag
54
#define SCB_ICSR_ISRPENDING ((uint32_t)0x00400000)
55
// Clear pending SysTick bit
56
#define SCB_ICSR_PENDSTCLR ((uint32_t)0x02000000)
57
// Set pending SysTick bit
58
#define SCB_ICSR_PENDSTSET ((uint32_t)0x04000000)
59
// Clear pending pendSV bit
60
#define SCB_ICSR_PENDSVCLR ((uint32_t)0x08000000)
61
// Set pending pendSV bit
62
#define SCB_ICSR_PENDSVSET ((uint32_t)0x10000000)
63
// Set pending NMI bit
64
#define SCB_ICSR_NMIPENDSET ((uint32_t)0x80000000)
65
66
// Bit definition for SCB_SCR register
67
68
// Sleep deep bit
69
#define SCB_SCR_SLEEPDEEP ((uint8_t)0x04)
70
71
// SCB Application Interrupt and Reset Control Register Definitions
72
73
// SCB AIRCR: VECTKEY Position
74
#define SCB_AIRCR_VECTKEY_Pos 16
75
// SCB AIRCR: VECTKEY Mask
76
#define SCB_AIRCR_VECTKEY_Mask (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos)
77
// SCB AIRCR: PRIGROUP Position
78
#define SCB_AIRCR_PRIGROUP_Pos 8
79
// SCB AIRCR: PRIGROUP Mask
80
#define SCB_AIRCR_PRIGROUP_Mask (7UL << SCB_AIRCR_PRIGROUP_Pos)
81
82
#endif
// CORE_CORTEXM3_H
SystemMemoryMap.h
Platform.h
uint32_t
unsigned __int32 uint32_t
Definition
stdint.h:64
uint8_t
unsigned __int8 uint8_t
Definition
stdint.h:62
SCB_Type
Definition
Core_CortexM0.h:11
Imt.Base
Imt.Base.HAL.STM32F103MD
Core_CortexM3.h
Generated by
1.9.7