1 /********************************** (C) COPYRIGHT  *******************************
2  * File Name          : ch32v10x_misc.h
3  * Author             : WCH
4  * Version            : V1.0.0
5  * Date               : 2020/04/30
6  * Description        : This file contains all the functions prototypes for the
7  *                      miscellaneous firmware library functions.
8  * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
9  * SPDX-License-Identifier: Apache-2.0
10  *******************************************************************************/
11 #ifndef __CH32V10X_MISC_H
12 #define __CH32V10X_MISC_H
13 
14 #ifdef __cplusplus
15  extern "C" {
16 #endif
17 
18 #include "ch32v10x.h"
19 
20 /* NVIC Init Structure definition */
21 typedef struct
22 {
23   uint8_t NVIC_IRQChannel;
24   uint8_t NVIC_IRQChannelPreemptionPriority;
25   uint8_t NVIC_IRQChannelSubPriority;
26   FunctionalState NVIC_IRQChannelCmd;
27 } NVIC_InitTypeDef;
28 
29 
30 /* Preemption_Priority_Group */
31 #define NVIC_PriorityGroup_0           ((uint32_t)0x00)
32 #define NVIC_PriorityGroup_1           ((uint32_t)0x01)
33 #define NVIC_PriorityGroup_2           ((uint32_t)0x02)
34 #define NVIC_PriorityGroup_3           ((uint32_t)0x03)
35 #define NVIC_PriorityGroup_4           ((uint32_t)0x04)
36 
37 
38 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
39 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif /* __CH32V10x_MISC_H */
46 
47