2 ******************************************************************************
\r
4 * @author MCD Application Team
\r
6 * @date 31-December-2010
\r
7 * @brief This file contains all the functions prototypes for the miscellaneous
\r
8 * firmware library functions (add-on to CMSIS 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 2010 STMicroelectronics</center></h2>
\r
20 ******************************************************************************
\r
23 /* Define to prevent recursive inclusion -------------------------------------*/
\r
31 /* Includes ------------------------------------------------------------------*/
\r
32 #include "stm32l1xx.h"
\r
34 /** @addtogroup STM32L1xx_StdPeriph_Driver
\r
38 /** @addtogroup MISC
\r
42 /* Exported types ------------------------------------------------------------*/
\r
45 * @brief NVIC Init Structure definition
\r
50 uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled.
\r
51 This parameter can be a value of @ref IRQn_Type
\r
52 (For the complete STM32 Devices IRQ Channels list, please
\r
53 refer to stm32l1xx.h file) */
\r
55 uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel
\r
56 specified in NVIC_IRQChannel. This parameter can be a value
\r
57 between 0 and 15 as described in the table @ref NVIC_Priority_Table */
\r
59 uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified
\r
60 in NVIC_IRQChannel. This parameter can be a value
\r
61 between 0 and 15 as described in the table @ref NVIC_Priority_Table */
\r
63 FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel
\r
64 will be enabled or disabled.
\r
65 This parameter can be set either to ENABLE or DISABLE */
\r
71 The table below gives the allowed values of the pre-emption priority and subpriority according
\r
72 to the Priority Grouping configuration performed by NVIC_PriorityGroupConfig function
\r
73 ============================================================================================================================
\r
74 NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description
\r
75 ============================================================================================================================
\r
76 NVIC_PriorityGroup_0 | 0 | 0-15 | 0 bits for pre-emption priority
\r
77 | | | 4 bits for subpriority
\r
78 ----------------------------------------------------------------------------------------------------------------------------
\r
79 NVIC_PriorityGroup_1 | 0-1 | 0-7 | 1 bits for pre-emption priority
\r
80 | | | 3 bits for subpriority
\r
81 ----------------------------------------------------------------------------------------------------------------------------
\r
82 NVIC_PriorityGroup_2 | 0-3 | 0-3 | 2 bits for pre-emption priority
\r
83 | | | 2 bits for subpriority
\r
84 ----------------------------------------------------------------------------------------------------------------------------
\r
85 NVIC_PriorityGroup_3 | 0-7 | 0-1 | 3 bits for pre-emption priority
\r
86 | | | 1 bits for subpriority
\r
87 ----------------------------------------------------------------------------------------------------------------------------
\r
88 NVIC_PriorityGroup_4 | 0-15 | 0 | 4 bits for pre-emption priority
\r
89 | | | 0 bits for subpriority
\r
90 ============================================================================================================================
\r
94 /* Exported constants --------------------------------------------------------*/
\r
96 /** @defgroup MISC_Exported_Constants
\r
100 /** @defgroup Vector_Table_Base
\r
104 #define NVIC_VectTab_RAM ((uint32_t)0x20000000)
\r
105 #define NVIC_VectTab_FLASH ((uint32_t)0x08000000)
\r
106 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
\r
107 ((VECTTAB) == NVIC_VectTab_FLASH))
\r
112 /** @defgroup System_Low_Power
\r
116 #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
\r
117 #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
\r
118 #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
\r
119 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
\r
120 ((LP) == NVIC_LP_SLEEPDEEP) || \
\r
121 ((LP) == NVIC_LP_SLEEPONEXIT))
\r
126 /** @defgroup Preemption_Priority_Group
\r
130 #define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority
\r
131 4 bits for subpriority */
\r
132 #define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority
\r
133 3 bits for subpriority */
\r
134 #define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority
\r
135 2 bits for subpriority */
\r
136 #define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority
\r
137 1 bits for subpriority */
\r
138 #define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority
\r
139 0 bits for subpriority */
\r
141 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
\r
142 ((GROUP) == NVIC_PriorityGroup_1) || \
\r
143 ((GROUP) == NVIC_PriorityGroup_2) || \
\r
144 ((GROUP) == NVIC_PriorityGroup_3) || \
\r
145 ((GROUP) == NVIC_PriorityGroup_4))
\r
147 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
\r
149 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
\r
151 #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x0001FFFF)
\r
157 /** @defgroup SysTick_clock_source
\r
161 #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
\r
162 #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
\r
163 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
\r
164 ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
\r
173 /* Exported macro ------------------------------------------------------------*/
\r
174 /* Exported functions ------------------------------------------------------- */
\r
176 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
\r
177 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
\r
178 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
\r
179 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
\r
180 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
\r
186 #endif /* __MISC_H */
\r
196 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
\r