ethan
2022-09-13 2c8058e6575f4e0238a98140d8ddcb5afb11f44c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
  ******************************************************************************
  * @file     xl_nvic.h
  * @author   software group
  * @brief    This file contains all the functions prototypes for the NVIC
  *           firmware library.
  ******************************************************************************
  * @attention
    *
  * 2019 by Chipways Communications,Inc. All Rights Reserved.
  * This software is supplied under the terms of a license
  * agreement or non-disclosure agreement with Chipways.
  * Passing on and copying of this document,and communication
  * of its contents is not permitted without prior written
  * authorization.
  *
  * <h2><center>&copy; COPYRIGHT 2019 Chipways</center></h2>
  ******************************************************************************
  */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __XL_NVIC_H__
#define __XL_NVIC_H__
 
#ifdef __cplusplus
 extern "C" {
#endif
     
/* Includes ---------------------------------------------------------------*/
#include "xl6600.h"
 
 
#define SCB_AIRCR_PRIGROUP_Pos              8U                                            
#define SCB_AIRCR_PRIGROUP_Msk             (7UL << SCB_AIRCR_PRIGROUP_Pos)               
 
     
/** @addtogroup XL6600_StdPeriph_Driver
  * @{
  */
 
/** @addtogroup NVIC 
  * @{
  */
     
/* Exported types ------------------------------------------------------------*/ 
/**
 * @brief NVIC ³õʼ»¯½á¹¹Ì嶨Òå
 */
typedef struct
{
  uint8_t NVIC_IRQChannel;                    /*!< ¶¨ÒåÖжÏͨµÀ */
 
  uint8_t NVIC_IRQChannelPreemptionPriority;  /*!< IRQÖжÏÇÀռʽÓÅÏȼ¶£¬·¶Î§0µ½3 */
 
  uint8_t NVIC_IRQChannelSubPriority;         /*!< IRQÖжÏ×ÓÓÅÏȼ¶£¬·¶Î§0µ½3 */
 
  FunctionalState NVIC_IRQChannelCmd;         /*!< IRQͨµÀʹÄÜ»òÕßʧÄÜ         */   
} NVIC_InitTypeDef;
 
 
/* Exported constants --------------------------------------------------------*/
/** @defgroup NVIC_Exported_Constants NVICÄ£¿éʹÓòÎÊý¶¨Òå
  * @{
  */
/** @defgroup Vector_Table_Base »ù±¾ÖжÏÏòÁ¿±í
  * @{
  */ 
#define AIRCR_VECTKEY_MASK                    ((uint32_t)0x05FA0000)
#define NVIC_VectTab_RAM                 ((uint32_t)0x20000000)
#define NVIC_VectTab_FLASH               ((uint32_t)0x00000000)
/**
  * @}
  */
 
/** @defgroup System_Low_Power NVICϵͳµÍ¹¦ºÄ¶¨Òå
  * @{
  */
#define NVIC_LP_SEVONPEND                ((uint8_t)0x10)
#define NVIC_LP_SLEEPDEEP                ((uint8_t)0x04)
#define NVIC_LP_SLEEPONEXIT              ((uint8_t)0x02)
/**
  * @}
  */
 
/** @defgroup Preemption_Priority_Group NVICÖжÏ×鶨Òå
  * @{
  */
#define NVIC_PriorityGroup_0             ((uint32_t)0x700) /*!< 0λÇÀռʽÓÅÏȼ¶£¬4λ×ÓÓÅÏȼ¶ */
#define NVIC_PriorityGroup_1             ((uint32_t)0x600) /*!< 1λÇÀռʽÓÅÏȼ¶£¬3λ×ÓÓÅÏȼ¶ */
#define NVIC_PriorityGroup_2             ((uint32_t)0x500) /*!< 2λÇÀռʽÓÅÏȼ¶£¬2λ×ÓÓÅÏȼ¶ */
#define NVIC_PriorityGroup_3             ((uint32_t)0x400) /*!< 3λÇÀռʽÓÅÏȼ¶£¬1λ×ÓÓÅÏȼ¶ */
#define NVIC_PriorityGroup_4             ((uint32_t)0x300) /*!< 4λÇÀռʽÓÅÏȼ¶£¬0λ×ÓÓÅÏȼ¶ */
/**
  * @}
  */
 
/** @defgroup SysTick_clock_source  CoreʱÖÓÔ´
  * @{
  */
#define SysTick_CLKSource_HCLK_Div8    0xFFFFFFFBu
#define SysTick_CLKSource_HCLK         0x00000004u
/**
  * @}
  */
 
/**
  * @}
  */
 
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ 
void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
void NVIC_Init(const NVIC_InitTypeDef* NVIC_InitStruct);
void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
#ifdef __cplusplus
}
#endif
 
#endif /* __XL_NVIC_H__ */
/**
  * @}
  */
 
/**
  * @}
  */