Robobo
Main Page
Related Pages
Modules
Classes
Files
Examples
File List
File Members
Device.h
1
/**************************************************************************/
26
#ifndef <Device>_H
/* ToDo: replace '<Device>' with your device name */
27
#define <Device>_H
28
29
#ifdef __cplusplus
30
extern
"C"
{
31
#endif
32
33
/* ToDo: replace '<Device>' with your device name; add your doxyGen comment */
44
/******************************************************************************/
45
/* Processor and Core Peripherals */
46
/******************************************************************************/
52
/*
53
* ==========================================================================
54
* ---------- Interrupt Number Definition -----------------------------------
55
* ==========================================================================
56
*/
57
58
typedef
enum
IRQn
59
{
60
/****** Cortex-M# Processor Exceptions Numbers ***************************************************/
61
62
/* ToDo: use this Cortex interrupt numbers if your device is a CORTEX-M0 device */
63
NonMaskableInt_IRQn
= -14,
64
HardFault_IRQn
= -13,
65
SVCall_IRQn
= -5,
66
PendSV_IRQn
= -2,
67
SysTick_IRQn
= -1,
69
/* ToDo: use this Cortex interrupt numbers if your device is a CORTEX-M3 / Cortex-M4 device */
70
NonMaskableInt_IRQn
= -14,
71
MemoryManagement_IRQn
= -12,
72
BusFault_IRQn
= -11,
73
UsageFault_IRQn
= -10,
74
SVCall_IRQn
= -5,
75
DebugMonitor_IRQn
= -4,
76
PendSV_IRQn
= -2,
77
SysTick_IRQn
= -1,
79
/****** Device Specific Interrupt Numbers ********************************************************/
80
/* ToDo: add here your device specific external interrupt numbers
81
according the interrupt handlers defined in startup_Device.s
82
eg.: Interrupt for Timer#1 TIM1_IRQHandler -> TIM1_IRQn */
83
<DeviceInterrupt>_IRQn = 0,
84
} IRQn_Type;
85
86
87
/*
88
* ==========================================================================
89
* ----------- Processor and Core Peripheral Section ------------------------
90
* ==========================================================================
91
*/
92
93
/* Configuration of the Cortex-M# Processor and Core Peripherals */
94
/* ToDo: set the defines according your Device */
95
/* ToDo: define the correct core revision
96
__CM0_REV if your device is a CORTEX-M0 device
97
__CM3_REV if your device is a CORTEX-M3 device
98
__CM4_REV if your device is a CORTEX-M4 device */
99
#define __CM#_REV 0x0201
100
#define __NVIC_PRIO_BITS 2
101
#define __Vendor_SysTickConfig 0
102
#define __MPU_PRESENT 1
103
/* ToDo: define __FPU_PRESENT if your devise is a CORTEX-M4 */
104
#define __FPU_PRESENT
106
/* end of group <Device>_CMSIS */
107
108
109
/* ToDo: include the correct core_cm#.h file
110
core_cm0.h if your device is a CORTEX-M0 device
111
core_cm3.h if your device is a CORTEX-M3 device
112
core_cm4.h if your device is a CORTEX-M4 device */
113
#include <core_cm#.h>
/* Cortex-M# processor and core peripherals */
114
/* ToDo: include your system_<Device>.h file
115
replace '<Device>' with your device name */
116
#include "system_<Device>
.h
" /* <Device> System include file */
117
118
119
/******************************************************************************/
120
/* Device Specific Peripheral registers structures */
121
/******************************************************************************/
127
#if defined ( __CC_ARM )
128
#pragma anon_unions
129
#endif
130
131
/* ToDo: add here your device specific peripheral access structure typedefs
132
following is an example for a timer */
133
134
/*------------- 16-bit Timer/Event Counter (TMR) -----------------------------*/
138
typedef struct
139
{
140
__IO uint32_t EN; /*!< Offset: 0x0000 Timer Enable Register */
141
__IO uint32_t RUN; /*!< Offset: 0x0004 Timer RUN Register */
142
__IO uint32_t CR; /*!< Offset: 0x0008 Timer Control Register */
143
__IO uint32_t MOD; /*!< Offset: 0x000C Timer Mode Register */
144
uint32_t RESERVED0[1];
145
__IO uint32_t ST; /*!< Offset: 0x0014 Timer Status Register */
146
__IO uint32_t IM; /*!< Offset: 0x0018 Interrupt Mask Register */
147
__IO uint32_t UC; /*!< Offset: 0x001C Timer Up Counter Register */
148
__IO uint32_t RG0 /*!< Offset: 0x0020 Timer Register */
149
uint32_t RESERVED1[2];
150
__IO uint32_t CP; /*!< Offset: 0x002C Capture register */
151
} <DeviceAbbreviation>_TMR_TypeDef; /* end of group <Device>_TMR */
153
154
155
#if defined ( __CC_ARM )
156
#pragma no_anon_unions
157
#endif
158
/* end of group <Device>_Peripherals */
160
161
162
/******************************************************************************/
163
/* Peripheral memory map */
164
/******************************************************************************/
165
/* ToDo: add here your device peripherals base addresses
166
following is an example for timer */
171
/* Peripheral and SRAM base address */
172
#define <DeviceAbbreviation>_FLASH_BASE (0x00000000UL) /*!< (FLASH ) Base Address */
173
#define <DeviceAbbreviation>_SRAM_BASE (0x20000000UL) /*!< (SRAM ) Base Address */
174
#define <DeviceAbbreviation>_PERIPH_BASE (0x40000000UL) /*!< (Peripheral) Base Address */
175
176
/* Peripheral memory map */
177
#define <DeviceAbbreviation>TIM0_BASE (<DeviceAbbreviation>_PERIPH_BASE) /*!< (Timer0 ) Base Address */
178
#define <DeviceAbbreviation>TIM1_BASE (<DeviceAbbreviation>_PERIPH_BASE + 0x0800) /*!< (Timer1 ) Base Address */
179
#define <DeviceAbbreviation>TIM2_BASE (<DeviceAbbreviation>_PERIPH_BASE + 0x1000) /*!< (Timer2 ) Base Address */ /* end of group <Device>_MemoryMap */
181
182
183
/******************************************************************************/
184
/* Peripheral declaration */
185
/******************************************************************************/
186
/* ToDo: add here your device peripherals pointer definitions
187
following is an example for timer */
188
193
#define <DeviceAbbreviation>_TIM0 ((<DeviceAbbreviation>_TMR_TypeDef *) <DeviceAbbreviation>TIM0_BASE)
194
#define <DeviceAbbreviation>_TIM1 ((<DeviceAbbreviation>_TMR_TypeDef *) <DeviceAbbreviation>TIM0_BASE)
195
#define <DeviceAbbreviation>_TIM2 ((<DeviceAbbreviation>_TMR_TypeDef *) <DeviceAbbreviation>TIM0_BASE) /* end of group <Device>_PeripheralDecl */
197
/* end of group <Device>_Definitions */
199
200
#ifdef __cplusplus
201
}
202
#endif
203
204
#endif /* <Device>_H */
SVCall_IRQn
Definition:
ARMCM0.h:43
DebugMonitor_IRQn
Definition:
ARMCM3.h:44
IRQn
IRQn
Definition:
ARMCM0.h:35
SysTick_IRQn
Definition:
ARMCM0.h:46
UsageFault_IRQn
Definition:
ARMCM3.h:42
BusFault_IRQn
Definition:
ARMCM3.h:41
NonMaskableInt_IRQn
Definition:
ARMCM0.h:38
PendSV_IRQn
Definition:
ARMCM0.h:45
MemoryManagement_IRQn
Definition:
ARMCM3.h:40
HardFault_IRQn
Definition:
ARMCM0.h:39
src
CMSIS
Device
_Template_Vendor
Vendor
Device
Include
Device.h
Generated by
1.8.11