2 ******************************************************************************
\r
4 * @author MCD Application Team
\r
7 * @brief This file contains all the functions prototypes for the
\r
8 * miscellaneous firmware library functions.
\r
9 ******************************************************************************
\r
12 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
\r
13 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
\r
14 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
\r
15 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
\r
16 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
\r
17 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
\r
19 * <h2><center>© COPYRIGHT 2009 STMicroelectronics</center></h2>
\r
22 /* Define to prevent recursive inclusion -------------------------------------*/
\r
26 /* Includes ------------------------------------------------------------------*/
\r
27 #include "stm32f10x.h"
\r
29 /** @addtogroup StdPeriph_Driver
\r
33 /** @addtogroup MISC
\r
37 /** @defgroup MISC_Exported_Types
\r
42 * @brief NVIC Init Structure definition
\r
47 uint8_t NVIC_IRQChannel;
\r
48 uint8_t NVIC_IRQChannelPreemptionPriority;
\r
49 uint8_t NVIC_IRQChannelSubPriority;
\r
50 FunctionalState NVIC_IRQChannelCmd;
\r
57 /** @defgroup MISC_Exported_Constants
\r
61 /** @defgroup Vector_Table_Base
\r
65 #define NVIC_VectTab_RAM ((uint32_t)0x20000000)
\r
66 #define NVIC_VectTab_FLASH ((uint32_t)0x08000000)
\r
67 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
\r
68 ((VECTTAB) == NVIC_VectTab_FLASH))
\r
73 /** @defgroup System_Low_Power
\r
77 #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
\r
78 #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
\r
79 #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
\r
80 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
\r
81 ((LP) == NVIC_LP_SLEEPDEEP) || \
\r
82 ((LP) == NVIC_LP_SLEEPONEXIT))
\r
87 /** @defgroup Preemption_Priority_Group
\r
91 #define NVIC_PriorityGroup_0 ((uint32_t)0x700) /* 0 bits for pre-emption priority
\r
92 4 bits for subpriority */
\r
93 #define NVIC_PriorityGroup_1 ((uint32_t)0x600) /* 1 bits for pre-emption priority
\r
94 3 bits for subpriority */
\r
95 #define NVIC_PriorityGroup_2 ((uint32_t)0x500) /* 2 bits for pre-emption priority
\r
96 2 bits for subpriority */
\r
97 #define NVIC_PriorityGroup_3 ((uint32_t)0x400) /* 3 bits for pre-emption priority
\r
98 1 bits for subpriority */
\r
99 #define NVIC_PriorityGroup_4 ((uint32_t)0x300) /* 4 bits for pre-emption priority
\r
100 0 bits for subpriority */
\r
102 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
\r
103 ((GROUP) == NVIC_PriorityGroup_1) || \
\r
104 ((GROUP) == NVIC_PriorityGroup_2) || \
\r
105 ((GROUP) == NVIC_PriorityGroup_3) || \
\r
106 ((GROUP) == NVIC_PriorityGroup_4))
\r
108 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
\r
110 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
\r
112 #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x0007FFFF)
\r
118 /** @defgroup SysTick_clock_source
\r
122 #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
\r
123 #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
\r
124 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
\r
125 ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
\r
134 /** @defgroup MISC_Exported_Macros
\r
142 /** @defgroup MISC_Exported_Functions
\r
146 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
\r
147 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
\r
148 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
\r
149 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
\r
150 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
\r
152 #endif /* __MISC_H */
\r
166 /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/
\r