STM32F1 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F1 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Groups
misc.h
Go to the documentation of this file.
1 
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef __MISC_H
24 #define __MISC_H
25 
26 #ifdef __cplusplus
27  extern "C" {
28 #endif
29 
30 /* Includes ------------------------------------------------------------------*/
31 #include "stm32f10x.h"
32 
49 typedef struct
50 {
51  uint8_t NVIC_IRQChannel;
56  uint8_t NVIC_IRQChannelPreemptionPriority;
60  uint8_t NVIC_IRQChannelSubPriority;
64  FunctionalState NVIC_IRQChannelCmd;
68 
114 #define NVIC_VectTab_RAM ((uint32_t)0x20000000)
115 #define NVIC_VectTab_FLASH ((uint32_t)0x08000000)
116 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
117  ((VECTTAB) == NVIC_VectTab_FLASH))
118 
126 #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
127 #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
128 #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
129 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
130  ((LP) == NVIC_LP_SLEEPDEEP) || \
131  ((LP) == NVIC_LP_SLEEPONEXIT))
132 
140 #define NVIC_PriorityGroup_0 ((uint32_t)0x700)
142 #define NVIC_PriorityGroup_1 ((uint32_t)0x600)
144 #define NVIC_PriorityGroup_2 ((uint32_t)0x500)
146 #define NVIC_PriorityGroup_3 ((uint32_t)0x400)
148 #define NVIC_PriorityGroup_4 ((uint32_t)0x300)
151 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
152  ((GROUP) == NVIC_PriorityGroup_1) || \
153  ((GROUP) == NVIC_PriorityGroup_2) || \
154  ((GROUP) == NVIC_PriorityGroup_3) || \
155  ((GROUP) == NVIC_PriorityGroup_4))
156 
157 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
158 
159 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
160 
161 #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF)
162 
171 #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
172 #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
173 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
174  ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
175 
195 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
196 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
197 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
198 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
199 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif /* __MISC_H */
206 
219 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/