STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
stm32f37x_misc.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F37X_MISC_H
31 #define __STM32F37X_MISC_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f37x.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 
54 typedef struct
55 {
56  uint8_t NVIC_IRQChannel;
61  uint8_t NVIC_IRQChannelPreemptionPriority;
66  uint8_t NVIC_IRQChannelSubPriority;
71  FunctionalState NVIC_IRQChannelCmd;
75 
102 /* Exported constants --------------------------------------------------------*/
103 
112 #define NVIC_VectTab_RAM ((uint32_t)0x20000000)
113 #define NVIC_VectTab_FLASH ((uint32_t)0x08000000)
114 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
115  ((VECTTAB) == NVIC_VectTab_FLASH))
116 
124 #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
125 #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
126 #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
127 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
128  ((LP) == NVIC_LP_SLEEPDEEP) || \
129  ((LP) == NVIC_LP_SLEEPONEXIT))
130 
138 #define NVIC_PriorityGroup_0 ((uint32_t)0x700)
140 #define NVIC_PriorityGroup_1 ((uint32_t)0x600)
142 #define NVIC_PriorityGroup_2 ((uint32_t)0x500)
144 #define NVIC_PriorityGroup_3 ((uint32_t)0x400)
146 #define NVIC_PriorityGroup_4 ((uint32_t)0x300)
149 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
150  ((GROUP) == NVIC_PriorityGroup_1) || \
151  ((GROUP) == NVIC_PriorityGroup_2) || \
152  ((GROUP) == NVIC_PriorityGroup_3) || \
153  ((GROUP) == NVIC_PriorityGroup_4))
154 
155 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
156 
157 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
158 
159 #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF)
160 
169 #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
170 #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
171 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
172  ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
173 
181 /* Exported macro ------------------------------------------------------------*/
182 /* Exported functions --------------------------------------------------------*/
183 
184 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
185 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
186 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
187 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
188 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
189 
190 #ifdef __cplusplus
191 }
192 #endif
193 
194 #endif /* __STM32F37X_MISC_H */
195 
204 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/