Set blackbox file handler to NULL after closing file
[inav.git] / lib / main / STM32F4 / Drivers / STM32F4xx_StdPeriph_Driver / inc / misc.h
blob36eada9a17f71d7982211c0c6efd680305191efc
1 /**
2 ******************************************************************************
3 * @file misc.h
4 * @author MCD Application Team
5 * @version V1.7.1
6 * @date 20-May-2016
7 * @brief This file contains all the functions prototypes for the miscellaneous
8 * firmware library functions (add-on to CMSIS functions).
9 ******************************************************************************
10 * @attention
12 * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2>
14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15 * You may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at:
18 * http://www.st.com/software_license_agreement_liberty_v2
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
26 ******************************************************************************
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __MISC_H
31 #define __MISC_H
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f4xx.h"
40 /** @addtogroup STM32F4xx_StdPeriph_Driver
41 * @{
44 /** @addtogroup MISC
45 * @{
48 /* Exported types ------------------------------------------------------------*/
50 /**
51 * @brief NVIC Init Structure definition
54 typedef struct
56 uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled.
57 This parameter can be an enumerator of @ref IRQn_Type
58 enumeration (For the complete STM32 Devices IRQ Channels
59 list, please refer to stm32f4xx.h file) */
61 uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel
62 specified in NVIC_IRQChannel. This parameter can be a value
63 between 0 and 15 as described in the table @ref MISC_NVIC_Priority_Table
64 A lower priority value indicates a higher priority */
66 uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified
67 in NVIC_IRQChannel. This parameter can be a value
68 between 0 and 15 as described in the table @ref MISC_NVIC_Priority_Table
69 A lower priority value indicates a higher priority */
71 FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel
72 will be enabled or disabled.
73 This parameter can be set either to ENABLE or DISABLE */
74 } NVIC_InitTypeDef;
76 /* Exported constants --------------------------------------------------------*/
78 /** @defgroup MISC_Exported_Constants
79 * @{
82 /** @defgroup MISC_Vector_Table_Base
83 * @{
86 #define NVIC_VectTab_RAM ((uint32_t)0x20000000)
87 #define NVIC_VectTab_FLASH ((uint32_t)0x08000000)
88 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
89 ((VECTTAB) == NVIC_VectTab_FLASH))
90 /**
91 * @}
94 /** @defgroup MISC_System_Low_Power
95 * @{
98 #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
99 #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
100 #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
101 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
102 ((LP) == NVIC_LP_SLEEPDEEP) || \
103 ((LP) == NVIC_LP_SLEEPONEXIT))
105 * @}
108 /** @defgroup MISC_Preemption_Priority_Group
109 * @{
112 #define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority
113 4 bits for subpriority */
114 #define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority
115 3 bits for subpriority */
116 #define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority
117 2 bits for subpriority */
118 #define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority
119 1 bits for subpriority */
120 #define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority
121 0 bits for subpriority */
123 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
124 ((GROUP) == NVIC_PriorityGroup_1) || \
125 ((GROUP) == NVIC_PriorityGroup_2) || \
126 ((GROUP) == NVIC_PriorityGroup_3) || \
127 ((GROUP) == NVIC_PriorityGroup_4))
129 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
131 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
133 #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF)
136 * @}
139 /** @defgroup MISC_SysTick_clock_source
140 * @{
143 #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
144 #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
145 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
146 ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
148 * @}
152 * @}
155 /* Exported macro ------------------------------------------------------------*/
156 /* Exported functions --------------------------------------------------------*/
158 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
159 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
160 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
161 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
162 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
164 #ifdef __cplusplus
166 #endif
168 #endif /* __MISC_H */
171 * @}
175 * @}
178 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/