tao_z
2022-05-29 a7c0d42a6590c26d37c17b082aef52925b466569
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**
  ******************************************************************************
  * @file     xl_irq.h
  * @author   software group
  * @brief    This file contains all the functions prototypes for the IRQ
  *           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>
  ******************************************************************************
  */
#ifndef XL_IRQ_H__
#define XL_IRQ_H__
 
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ---------------------------------------------------------------*/
#include "XL6600.h"
/* Register define ------------------------------------------------------------*/    
 
/* SC Bit Fields */
#define IRQ_SC_IRQMOD_MASK                       0x1u
#define IRQ_SC_IRQMOD_SHIFT                      0
#define IRQ_SC_IRQIE_MASK                        0x2u
#define IRQ_SC_IRQIE_SHIFT                       1
#define IRQ_SC_IRQACK_MASK                       0x4u
#define IRQ_SC_IRQACK_SHIFT                      2
#define IRQ_SC_IRQF_MASK                         0x8u
#define IRQ_SC_IRQF_SHIFT                        3
#define IRQ_SC_IRQPE_MASK                        0x10u
#define IRQ_SC_IRQPE_SHIFT                       4
#define IRQ_SC_IRQEDG_MASK                       0x20u
#define IRQ_SC_IRQEDG_SHIFT                      5
#define IRQ_SC_IRQPDD_MASK                       0x40u
#define IRQ_SC_IRQPDD_SHIFT                      6
 
/** IRQ - Register Layout Typedef */
typedef struct {
  __IO uint32_t SC[16];                          /*!< ÍⲿÖжÏÒý½ÅÇëÇó״̬ºÍ¿ØÖƼĴæÆ÷, array offset: 0x00, array step: 0x4  */
} IRQ_Type, *IRQ_MemMapPtr;
extern IRQ_Type * IRQ;
 
 
/** @addtogroup XL6600_StdPeriph_Driver
  * @{
  */
 
/** @addtogroup IRQ
  * @{
  */
 
/* Exported types ------------------------------------------------------------*/ 
    
/**
 * @brief IRQ³õʼ»¯½á¹¹ÌåµÄ¶¨Òå
 *
 */
typedef struct
{    
    uint32_t  IRQ_EdgeSelect;                                     /*!< ÖжÏÇëÇó±ßÑØÑ¡Ôñ */
    uint32_t  IRQ_ModeSelect;                                     /*!< Öжϼì²âģʽѡÔñ */
    
}IRQ_InitTypeDef, *IRQ_InitConfigPtr;
 
 
 
/* Exported constants --------------------------------------------------------*/
/** @defgroup IRQ_Exported_Constants IRQÄ£¿éʹÓòÎÊý¶¨Òå
  * @{
  */
 
/**
    * @defgroup IRQ_RequestEdge_Select IRQ´¥·¢±ßÑØ»òµçƽѡÔñ
    * @{
    */ 
#define    IRQ_Falledge_Lowlevel                        (uint8_t)0x00           /*!< Ï½µÑØºÍµÍµçÆ½´¥·¢ */
#define    IRQ_Riseedge_Highlevel                       (uint8_t)0x20           /*!< ÉÏÉýÑØºÍ¸ßµçƽ´¥·¢ */
/**
    * @}
    */
    
/**
    * @defgroup IRQ_DetectionMode_Select IRQ´¥·¢Ä£Ê½¶¨Òå
    * @{
    */     
#define    IRQ_Detect_Edge                              (uint8_t)0x0           /*!< ½ö±ßÑØ´¥·¢ */
#define    IRQ_Detect_EdgeANDLevel                      (uint8_t)0x1           /*!< ±ßÑØ´¥·¢ºÍµçƽ´¥·¢ */
/**
    * @}
    */
    
 
/**
    * @defgroup IRQ_ChannelList_Select IRQͨµÀÑ¡Ôñ
    * @{
    */ 
#define  EXTI0                 0                     /*!< ÍⲿÖжÏͨµÀ0. */
#define  EXTI1                    1                     /*!< ÍⲿÖжÏͨµÀ1. */    
#define  EXTI2                    2                     /*!< ÍⲿÖжÏͨµÀ2. */    
#define  EXTI3                    3                     /*!< ÍⲿÖжÏͨµÀ3. */    
#define  EXTI4                   4                     /*!< ÍⲿÖжÏͨµÀ4. */    
#define  EXTI5                   5                     /*!< ÍⲿÖжÏͨµÀ5. */    
#define  EXTI6                   6                     /*!< ÍⲿÖжÏͨµÀ6. */    
#define  EXTI7                   7                     /*!< ÍⲿÖжÏͨµÀ7. */    
#define  EXTI8                   8                     /*!< ÍⲿÖжÏͨµÀ8. */    
#define  EXTI9                   9                     /*!< ÍⲿÖжÏͨµÀ9. */    
#define  EXTI10                   10                    /*!< ÍⲿÖжÏͨµÀ10. */    
#define  EXTI11                   11                    /*!< ÍⲿÖжÏͨµÀ11. */    
#define  EXTI12                   12                    /*!< ÍⲿÖжÏͨµÀ12. */    
#define  EXTI13                   13                    /*!< ÍⲿÖжÏͨµÀ13. */    
#define  EXTI14                   14                    /*!< ÍⲿÖжÏͨµÀ14. */    
#define  EXTI15                   15                    /*!< ÍⲿÖжÏͨµÀ15. */    
/**
    * @}
    */
    
/**
  * @}
  */
 
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
void IRQ_DeInit(IRQ_Type *IRQx,uint8_t IRQ_Channel);
void IRQ_Init(IRQ_Type *IRQx, uint8_t IRQ_Channel, const IRQ_InitTypeDef *IRQ_InitStuct);
void IRQ_PullDevDisableCmd(IRQ_Type *IRQx,uint8_t IRQ_Channel, FunctionalState NewState);
void IRQ_PinEnableCmd(IRQ_Type *IRQx,uint8_t IRQ_Channel,FunctionalState NewState);
void IRQ_InterruptEn(IRQ_Type *IRQx,uint8_t IRQ_Channel,FunctionalState NewState);
FlagStatus IRQ_GetFlag(const IRQ_Type *IRQx,uint8_t IRQ_Channel);
void IRQ_ClrFlag(IRQ_Type *IRQx,uint8_t IRQ_Channel);
 
 
#ifdef __cplusplus
}
#endif
 
#endif /*__XL_IRQ_H__ */    
 
/**
  * @}
  */
 
/**
  * @}
  */