1 /**
2 ******************************************************************************
3 * @file  HAL_misc.h
4 * @author  AE Team
5 * @version  V2.0.0
6 * @date  22/08/2017
7 * @brief  This file contains all the functions prototypes for the
8 *         miscellaneous firmware library functions.
9 ******************************************************************************
10 
11 */
12 
13 /* Define to prevent recursive inclusion -------------------------------------*/
14 #ifndef __HAL_MISC_H
15 #define __HAL_MISC_H
16 
17 #ifdef __cplusplus
18  extern "C" {
19 #endif
20 /* Includes ------------------------------------------------------------------*/
21 #include "HAL_device.h"
22 
23 /** @addtogroup StdPeriph_Driver
24 * @{
25 */
26 
27 /** @addtogroup MISC
28 * @{
29 */
30 
31 /** @defgroup MISC_Exported_Types
32 * @{
33 */
34 
35 /**
36 * @brief  NVIC Init Structure definition
37 */
38 
39 typedef struct
40 {
41   uint8_t NVIC_IRQChannel;             /*!< Specifies the IRQ channel to be enabled or disabled.
42                                             This parameter can be a value of @ref IRQn_Type
43                                             (For the complete MM32 Devices IRQ Channels list,
44                                             please refer to HAL_device.h file) */
45 
46   uint8_t NVIC_IRQChannelPriority;     /*!< Specifies the priority level for the IRQ channel specified
47                                             in NVIC_IRQChannel. This parameter can be a value
48                                             between 0 and 3.  */
49 
50   FunctionalState NVIC_IRQChannelCmd;  /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel
51                                             will be enabled or disabled.
52                                             This parameter can be set either to ENABLE or DISABLE */
53 } NVIC_InitTypeDef;
54 
55 /**
56 * @}
57 */
58 
59 /** @defgroup MISC_Exported_Constants
60 * @{
61 */
62 
63 /** @defgroup MISC_System_Low_Power
64   * @{
65   */
66 
67 #define NVIC_LP_SEVONPEND            ((uint8_t)0x10)
68 #define NVIC_LP_SLEEPDEEP            ((uint8_t)0x04)
69 #define NVIC_LP_SLEEPONEXIT          ((uint8_t)0x02)
70 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
71 ((LP) == NVIC_LP_SLEEPDEEP) || \
72   ((LP) == NVIC_LP_SLEEPONEXIT))
73 /**
74 * @}
75 */
76 
77 /** @defgroup MISC_Preemption_Priority_Group
78   * @{
79   */
80 #define IS_NVIC_PRIORITY(PRIORITY)  ((PRIORITY) < 0x04)
81 
82 /**
83 * @}
84 */
85 
86 /** @defgroup SysTick_clock_source
87 * @{
88 */
89 
90 #define SysTick_CLKSource_HCLK_Div8    ((uint32_t)0xFFFFFFFB)
91 #define SysTick_CLKSource_HCLK         ((uint32_t)0x00000004)
92 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
93 ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
94 /**
95 * @}
96 */
97 
98 /**
99 * @}
100 */
101 
102 /** @defgroup MISC_Exported_Macros
103 * @{
104 */
105 
106 /**
107 * @}
108 */
109 
110 /** @defgroup MISC_Exported_Functions
111 * @{
112 */
113 
114 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
115 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
116 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* __HAL_MISC_H */
123 
124 /**
125 * @}
126 */
127 
128 /**
129 * @}
130 */
131 
132 /**
133 * @}
134 */
135 
136 /*-------------------------(C) COPYRIGHT 2017 MindMotion ----------------------*/
137