STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc/misc.h
Go to the documentation of this file.
00001 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __MISC_H
00025 #define __MISC_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f10x.h"
00033 
00050 typedef struct
00051 {
00052   uint8_t NVIC_IRQChannel;                    
00057   uint8_t NVIC_IRQChannelPreemptionPriority;  
00061   uint8_t NVIC_IRQChannelSubPriority;         
00065   FunctionalState NVIC_IRQChannelCmd;         
00068 } NVIC_InitTypeDef;
00069  
00115 #define NVIC_VectTab_RAM             ((uint32_t)0x20000000)
00116 #define NVIC_VectTab_FLASH           ((uint32_t)0x08000000)
00117 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
00118                                   ((VECTTAB) == NVIC_VectTab_FLASH))
00119 
00127 #define NVIC_LP_SEVONPEND            ((uint8_t)0x10)
00128 #define NVIC_LP_SLEEPDEEP            ((uint8_t)0x04)
00129 #define NVIC_LP_SLEEPONEXIT          ((uint8_t)0x02)
00130 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
00131                         ((LP) == NVIC_LP_SLEEPDEEP) || \
00132                         ((LP) == NVIC_LP_SLEEPONEXIT))
00133 
00141 #define NVIC_PriorityGroup_0         ((uint32_t)0x700) 
00143 #define NVIC_PriorityGroup_1         ((uint32_t)0x600) 
00145 #define NVIC_PriorityGroup_2         ((uint32_t)0x500) 
00147 #define NVIC_PriorityGroup_3         ((uint32_t)0x400) 
00149 #define NVIC_PriorityGroup_4         ((uint32_t)0x300) 
00152 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
00153                                        ((GROUP) == NVIC_PriorityGroup_1) || \
00154                                        ((GROUP) == NVIC_PriorityGroup_2) || \
00155                                        ((GROUP) == NVIC_PriorityGroup_3) || \
00156                                        ((GROUP) == NVIC_PriorityGroup_4))
00157 
00158 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10)
00159 
00160 #define IS_NVIC_SUB_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10)
00161 
00162 #define IS_NVIC_OFFSET(OFFSET)  ((OFFSET) < 0x000FFFFF)
00163 
00172 #define SysTick_CLKSource_HCLK_Div8    ((uint32_t)0xFFFFFFFB)
00173 #define SysTick_CLKSource_HCLK         ((uint32_t)0x00000004)
00174 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
00175                                        ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
00176 
00196 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
00197 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
00198 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
00199 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
00200 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
00201 
00202 #ifdef __cplusplus
00203 }
00204 #endif
00205 
00206 #endif /* __MISC_H */
00207 
00220 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/