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