tao_z
2022-05-25 1044ba0d2286698d0da28112bffc0f114bef2134
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
/**
  ******************************************************************************
  * @file     xl_adc.h
  * @author   software group
  * @brief    This file contains all the functions prototypes for the ADC 
  *           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_ADC_H__
#define XL_ADC_H__
 
#ifdef __cplusplus
extern "C" {
#endif
    
/* Includes ---------------------------------------------------------------*/
#include "XL6600.h"
    
    
/* Register define ------------------------------------------------------------*/
/* CR Bit Fields */
#define ADC_CR_MODE_MASK                        0x3u
#define ADC_CR_MODE_SHIFT                       0
 
#define ADC_CR_FSE_MASK                         0x4u
#define ADC_CR_FSE_SHIFT                        2
 
#define ADC_CR_FDEP_MASK                        0x38u
#define ADC_CR_FDEP_SHIFT                       3
 
#define ADC_CR_CCE_MASK                         0x40u
#define ADC_CR_CCE_SHIFT                        6
 
#define ADC_CR_AIE_MASK                         0x80u
#define ADC_CR_AIE_SHIFT                        7
 
#define ADC_CR_TRGSEL_MASK                      0x100u
#define ADC_CR_TRGSEL_SHIFT                     8
 
#define ADC_CR_COSBEN_MASK                      0x200u
#define ADC_CR_COSBEN_SHIFT                     9
 
#define ADC_CR_LPE_MASK                         0x400u
#define ADC_CR_LPE_SHIFT                        10
 
#define ADC_CR_LSTE_MASK                        0x800u
#define ADC_CR_LSTE_SHIFT                       11
 
#define ADC_CR_REFSEL_MASK                      0x3000u
#define ADC_CR_REFSEL_SHIFT                     12
 
#define ADC_CR_CLKSEL_MASK                      0xC000u
#define ADC_CR_CLKSEL_SHIFT                     14
 
#define ADC_CR_CFE_MASK                         0x10000u
#define ADC_CR_CFE_SHIFT                        16
 
#define ADC_CR_CFRE_MASK                        0x20000u
#define ADC_CR_CFRE_SHIFT                       17
 
#define ADC_CR_CFGRE_MASK                       0x40000u
#define ADC_CR_CFGRE_SHIFT                      18
 
#define ADC_CR_CFSEL_MASK                       0x80000u
#define ADC_CR_CFSEL_SHIFT                      19
 
#define ADC_CR_ADACKS_MASK                      0x100000u
#define ADC_CR_ADACKS_SHIFT                     20
 
#define ADC_CR_ECOBD_MASK                      0x200000u
#define ADC_CR_ECOBD_SHIFT                     21
 
#define ADC_CR_DMATXEN_MASK                     0x400000u
#define ADC_CR_DMATXEN_SHIFT                    22
 
#define ADC_CR_DMARXEN_MASK                     0x800000u
#define ADC_CR_DMARXEN_SHIFT                    23
 
#define ADC_CR_ADIV_MASK                        0x3000000u
#define ADC_CR_ADIV_SHIFT                       24
 
/* SR Bit Fields */
#define ADC_SR_RFCNT_MASK                       0xFu
#define ADC_SR_RFCNT_SHIFT                      0
 
#define ADC_SR_RFF_MASK                         0x10u
#define ADC_SR_RFF_SHIFT                        4
 
#define ADC_SR_REF_MASK                         0x20u
#define ADC_SR_REF_SHIFT                        5
 
#define ADC_SR_CCF_MASK                         0x80u
#define ADC_SR_CCF_SHIFT                        7
 
#define ADC_SR_CB_MASK                          0x100u
#define ADC_SR_CB_SHIFT                         8
 
#define ADC_SR_CFF_MASK                         0x200u
#define ADC_SR_CFF_SHIFT                        9
 
#define ADC_SR_CEF_MASK                         0x400u
#define ADC_SR_CEF_SHIFT                        10
 
/* CSR Bit Fields */
#define ADC_CSR_ADCH_MASK                       0x1Fu
#define ADC_CSR_ADCH_SHIFT                      0
/* RDR Bit Fields */
#define ADC_RDR_DATA_MASK                       0xFFFu
#define ADC_RDR_DATA_SHIFT                      0
/* CVR Bit Fields */
#define ADC_CVR_CVL_MASK                        0xFFFu
#define ADC_CVR_CVL_SHIFT                       0
 
#define ADC_CVR_CVH_MASK                        0xFFF0000u
#define ADC_CVR_CVH_SHIFT                       16
/* EHTMR Bit Fields */
#define ADC_EHTMR_EN_MASK                       0x1u
#define ADC_EHTMR_EN_SHIFT                      0
 
#define ADC_EHTMR_HTRGM_MASK                    0x2u
#define ADC_EHTMR_HTRGM_SHIFT                   1
/* APCTL Bit Fields */
#define ADC_PINSEL_ADPC_MASK                    0xFFFFFFu
#define ADC_PINSEL_ADPC_SHIFT                   0
 
 
/** ADC - Register Layout Typedef */
typedef struct {
  __IO uint32_t CR;                               /*!< ADC¿ØÖƼĴæÆ÷, offset: 0x0 */
  __I  uint32_t SR;                               /*!< ADC״̬¼Ä´æÆ÷, offset: 0x4 */
  __IO uint32_t CSR;                              /*!< Êý¾ÝͨµÀÑ¡Ôñ¼Ä´æÆ÷, offset: 0x8 */
  __I  uint32_t RDR;                              /*!< ×ª»»½á¹ûÊä³ö¼Ä´æÆ÷, offset: 0xC */
  __IO uint32_t CVR;                              /*!< ×ª»»½á¹û±È½Ï±ê×¼Öµ¼Ä´æÆ÷, offset: 0x10 */
  __IO uint32_t EHTMR;                            /*!< ADCʹÄÜÓë´¥·¢¿ØÖƼĴæÆ÷, offset: 0x14 */   
  __IO uint32_t APCTL;                            /*!< ADCʹÄÜÓë´¥·¢¿ØÖƼĴæÆ÷, offset: 0x18 */
  __IO uint32_t CFR;                              /*!< ADC±È½Ï¹¦ÄÜ״̬¼Ä´æÆ÷, offset: 0x1C */
} ADC_Type, *ADC_MemMapPtr;
extern ADC_Type* ADC0;
 
 
 
/** @addtogroup XL6600_StdPeriph_Driver
  * @{
  */
 
/** @addtogroup ADC 
  * @{
  */
 
 
/* Exported types ------------------------------------------------------------*/ 
 
/**
 * @brief ADC ³õʼ»¯½á¹¹Ì嶨Òå
 */
typedef struct
{
  uint32_t ADC_Mode;                       /*!< ÅäÖÃADCת»»Êý¾Ý¿í¶È */
                                                
  uint32_t ADC_ReferVoltage;               /*!< ×ª»»²Î¿¼µçѹԴ */
    
  uint32_t ADC_ClockSource;                /*!< ADCת»»Ê±ÖÓÔ´ */
    
  uint32_t ADC_ClkDivide;                  /*!< ADCת»»Ê±ÖÓ·ÖÆµÏµÊý */
 
  FunctionalState ADC_LowPowerConvert;     /*!< ADCµÍ¹¦ºÄת»»Ê¹ÄÜ,ÉèÖóÉENABLE»òÕßDISABLE */
                                               
 
  FunctionalState ADC_LongTimeConvert;     /*!< ADC³¤²ÉÑùʱ¼äʹÄÜ, ÉèÖóÉENABLE»òÕßDISABLE */
                                              
 
}ADC_InitTypeDef;
 
 
/**
  * @brief ADC_FIFO³õʼ»¯½á¹¹Ì嶨Òå
  */
typedef struct
{
  uint32_t ADC_FIFOLevel;                   /*!< FIFO Éî¶È */                                              
    
  FunctionalState ADC_ChannelScan;          /*!< ADCÐŵÀɨÃ蹦ÄÜʹÄÜ, ÉèÖóÉENABLE»òÕßDISABLE */
                                              
}ADC_FIFOTypeDef;
 
 
/**
  * @brief ADC±È½ÏÆ÷³õʼ»¯½á¹¹Ì嶨Òå
  */
typedef struct
{
    uint32_t ADC_CompareMode;                 /*!< ADC±È½Ï·½Ê½ £¬´óС»ò·¶Î§±È½Ï */
                                               
    uint32_t ADC_CompareOut;                  /*!< ADC±È½ÏÊä³öģʽ */
 
    uint32_t ADC_FIFOCompareOut;              /*!< ADC FIFO ±È½ÏÊä³öģʽ */
 
    uint32_t ADC_CompareValueHigh;            /*!< ±È½ÏֵΪ¸ß */
 
    uint32_t ADC_CompareValueLow;             /*!< ±È½ÏֵΪµÍ */
 
    FunctionalState ADC_AutoCompare;          /*!< ×Ô¶¯±È½Ï¹¦ÄÜʹÄÜ,ÉèÖóÉENABLE»òÕßDISABLE */
    
    FunctionalState ADC_CompareResultSwitch;  /*!< ±È½Ï½á¹ûת»»,ÉèÖóÉENABLE»òÕßDISABLE */
 
}ADC_CompareTypeDef;
 
/* Exported constants --------------------------------------------------------*/
/** @defgroup ADC_Exported_Constants ADCÄ£¿éʹÓòÎÊý¶¨Òå
  * @{
  */
 
/**
    * @defgroup ADC_Mode_list ADCģʽ¶¨Òå
    * @{
    */
#define ADC_MODE_8BIT                                              0x0        /*!< 8λÊä³öģʽ */
#define ADC_MODE_10BIT                                            0x1        /*!< 10λÊä³öģʽ */
#define ADC_MODE_12BIT                                            0x2        /*!< 12λÊä³öģʽ */
/**
    * @}
    */
 
/**
    * @defgroup ADC_FIFO_list ADCFIFOÉî¶È¶¨Òå
    * @{
    */    
#define ADC_FIFO_DISABLE                        0     /*!< FIFO¹¦Äܹرՠ*/
#define ADC_FIFO_LEVEL2                         1     /*!< FIFOÉî¶ÈΪ2 */
#define ADC_FIFO_LEVEL3                         2     /*!< FIFOÉî¶ÈΪ3 */
#define ADC_FIFO_LEVEL4                         3     /*!< FIFOÉî¶ÈΪ4 */
#define ADC_FIFO_LEVEL5                         4     /*!< FIFOÉî¶ÈΪ5 */
#define ADC_FIFO_LEVEL6                         5     /*!< FIFOÉî¶ÈΪ6 */
#define ADC_FIFO_LEVEL7                         6     /*!< FIFOÉî¶ÈΪ7 */
#define ADC_FIFO_LEVEL8                         7        /*!< FIFOÉî¶ÈΪ8 */
/**
    * @}
    */
    
/**
    * @defgroup ADC_CONTINUOUS_list ADCת»»Ä£Ê½¶¨Òå
    * @{
    */
#define ADC_CONVENTION_ONCE                      0x00u   /*!< µ¥´Îת»» */
#define ADC_CONVENTION_CONTINUOUS                0x01u   /*!< Á¬Ðø×ª»» */
/**
    * @}
    */
    
/**
    * @defgroup ADC_Trigger_List ADC´¥·¢Ä£Ê½Ñ¡Ôñ
    * @{
    */
#define ADC_SOFTWARE_TRIGGER                     0x00u   /*!< Èí¼þ´¥·¢ */
#define ADC_HARDWARE_TRIGGER                     0x01u   /*!< Ó²¼þ´¥·¢ */
/**
    * @}
    */
 
/**
    * @defgroup ADC_VRFF_List ADC²Î¿¼µçѹ¶¨Òå
    * @{
    */
#define ADC_VREF_VREFH                           0x00        /*!< ²Î¿¼µçѹÊÇVREFH */
#define ADC_VREF_VDDA                            0x01        /*!< ²Î¿¼µçѹÊÇVDDA */
/**
    * @}
    */
    
 
    
/**
    * @defgroup ADC_ClockSource_list ADCʱÖÓÔ´¶¨Òå
    * @{
    */
#define ADC_CLOCK_BUS_CLOCK                                     0x00                  /*!< ADCʱÖÓÔ´ÊÇ×ÜÏßʱÖÓ */
#define ADC_CLOCK_BUS_CLOCK_DIVIDE_2                           0x01      /*!< ADCʱÖÓÔ´ÊÇ×ÜÏßʱÖÓ2·ÖƵ */
#define ADC_CLOCK_ALTCLK                                       0x02                  /*!< ADCʱÖÓÔ´ÊDZ¸ÓÃʱÖÓ(ALTCLK) */
#define ADC_CLOCK_ADACK                                           0x03                  /*!< ADCʱÖÓÔ´ÊÇÒ첽ʱÖÓ(ADACK) */
/**
    * @}
    */
    
/**
    * @defgroup ADC_CPMPARE_List ADC±È½Ïģʽ¶¨Òå
    * @{
    */    
#define ADC_COMPAREMODE_SIZE                  0x00   /*!< ADC´óС±È½Ï */
#define ADC_COMPAREMODE_RANGE                 0x01   /*!< ADC·¶Î§±È½Ï */
/**
    * @}
    */
 
/**
    * @defgroup ADC_CPMPARE_out_list ADC±È½ÏÊä³öģʽ¶¨Òå
    * @{
    */    
#define ADC_COMPAREOUT_LESS                      0x00   /*!< Ð¡ÓÚµÈÓÚ»òÕßÔÚ·¶Î§ÄÚÊä³öת»»½á¹û */
#define ADC_COMPAREOUT_MORE                      0x01   /*!<  ´óÓÚ»òÕßÔÚ·¶Î§ÍâÊä³öת»»½á¹û */
/**
    * @}
    */
 
/** 
    * @defgroup ADC_OutputSelect_List ADC±È½ÏÊä³öÊý¾Ýģʽ¶¨Òå
    * @{
    */    
#define ADC_COMPAREFIFO_ALL                      0x00   /*!< µ±ËùÓÐͨµÀ¶¼Âú×ã±È½Ï½á¹ûʱ£¬Êä³ö±¾´ÎɨÃè½á¹û */
#define ADC_COMPAREFIFO_ONE                      0x01   /*!< Ö»ÒªÄ³Ò»¸öͨµÀÂú×ã±È½Ï½á¹ûʱ£¬Êä³ö±¾´ÎɨÃè½á¹û */
/**
    * @}
    */
    
/**
    * @defgroup ADC_AsynchronousClk_Select_List ADCÒ첽ʱÖÓÑ¡Ôñ¶¨Òå
    * @{
    */    
#define ADC_ADACK_NORMAL                   0x00u   /*!< ADCÒ첽ʱÖÓʹÓñê׼ƵÂÊ */
#define ADC_ADACK_TIMES1P5                 0x01u   /*!< ADCÒ첽ʱÖÓʹÓÃ1.5±¶±ê׼ƵÂÊ */
/**
    * @}
    */
    
/**
    * @defgroup ADC_Deivied_List ADCʱÖÓ·ÖÆµÑ¡Ôñ
    * @{
    */        
#define ADC_ADIV_DIVIDE_1                                       0x00        /*!< Ê±ÖÓ1·ÖƵ */
#define ADC_ADIV_DIVIDE_2                                         0x01        /*!< Ê±ÖÓ2·ÖƵ */
#define ADC_ADIV_DIVIDE_4                                         0x02        /*!< Ê±ÖÓ4·ÖƵ */
#define ADC_ADIV_DIVIDE_8                                         0x03        /*!< Ê±ÖÓ8·ÖƵ */
/**
    * @}
    */
    
/**
    * @defgroup ADC_Flags_Definition ADC±È½Ï¹¦ÄÜ״̬±êÖ¾¶¨Òå
    * @{
    */
#define ADC_FLAG_DATAFIFO_FULL                   0x10     /*!< FIFOÊý¾ÝÂú±êÖ¾ */
#define ADC_FLAG_DATAFIFO_EMPTY                  0x20     /*!< FIFOÊý¾Ý¿Õ±êÖ¾ */
#define ADC_FLAG_CONV_FINISH                     0x80     /*!< ADCת»»½áÊø±êÖ¾ */
#define ADC_FLAG_CONV_BUSY                       0x100    /*!< ADCת»»·±Ã¦±êÖ¾ */
#define ADC_FLAG_ChannelFIFO_FULL                0x200    /*!< Channel FIFOÊý¾ÝÂú±êÖ¾ */
#define ADC_FLAG_ChannelFIFO_EMPTY               0x400    /*!< Channel FIFOÊý¾Ý¿Õ±êÖ¾ */
/**
    * @}
    */
 
/**
    * @defgroup ADC_COMPARE_FLAGs_Definition ADC±êÖ¾¶¨Òå
    * @{
    */
#define ADC_CHANNEL0_COMPARE_EXCEPTION            0x000001            /*!< Í¨µÀ0±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL1_COMPARE_EXCEPTION            0x000002            /*!< Í¨µÀ1±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL2_COMPARE_EXCEPTION            0x000004            /*!< Í¨µÀ2±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL3_COMPARE_EXCEPTION            0x000008            /*!< Í¨µÀ3±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL4_COMPARE_EXCEPTION            0x000010            /*!< Í¨µÀ4±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL5_COMPARE_EXCEPTION            0x000020            /*!< Í¨µÀ5±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL6_COMPARE_EXCEPTION            0x000040            /*!< Í¨µÀ6±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNEL7_COMPARE_EXCEPTION            0x000080            /*!< Í¨µÀ7±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_CHANNELALL_COMPARE_EXCEPTION        0x000100            /*!< ËùÓÐͨµÀ±È½Ï½á¹ûÒì³£±êÖ¾ */
#define ADC_COMPARE_CFSEL_FLAG                    0x010000                /*!< Êä³ö½á¹ûÑ¡Ôñ·½Ê½±êÖ¾ */
#define ADC_COMPARE_CFGRE_FLAG                    0x020000                /*!< ´óÓÚÑ¡Ôñ±êÖ¾ */
#define ADC_COMPARE_CFRE_FLAG                    0x040000                  /*!< ±È½Ï·½Ê½Ñ¡Ôñ±êÖ¾ */
#define ADC_COMPARE_CFE_FLAG                    0x080000                  /*!< ×Ô¶¯±È½Ï¹¦ÄÜʹÄܱêÖ¾ */
/**
    * @}
    */
 
 
/**
    * @defgroup ADC_Channel_list ADCͨµÀÑ¡Ôñ¶¨Òå
    * @{
    */
#define ADC_CHANNEL_AD0                          0x0     /*!< ADCÊäÈëͨµÀ0 */
#define ADC_CHANNEL_AD1                          0x1     /*!< ADCÊäÈëͨµÀ1 */
#define ADC_CHANNEL_AD2                          0x2     /*!< ADCÊäÈëͨµÀ2 */
#define ADC_CHANNEL_AD3                          0x3     /*!< ADCÊäÈëͨµÀ3 */
#define ADC_CHANNEL_AD4                          0x4     /*!< ADCÊäÈëͨµÀ4 */
#define ADC_CHANNEL_AD5                          0x5     /*!< ADCÊäÈëͨµÀ5 */
#define ADC_CHANNEL_AD6                          0x6     /*!< ADCÊäÈëͨµÀ6 */
#define ADC_CHANNEL_AD7                          0x7     /*!< ADCÊäÈëͨµÀ7 */
#define ADC_CHANNEL_AD8                          0x8     /*!< ADCÊäÈëͨµÀ8 */
#define ADC_CHANNEL_AD9                          0x9     /*!< ADCÊäÈëͨµÀ9 */
#define ADC_CHANNEL_AD10                         0xa     /*!< ADCÊäÈëͨµÀ10 */
#define ADC_CHANNEL_AD11                         0xb     /*!< ADCÊäÈëͨµÀ11 */
#define ADC_CHANNEL_AD12                         0xc     /*!< ADCÊäÈëͨµÀ12 */
#define ADC_CHANNEL_AD13                         0xd     /*!< ADCÊäÈëͨµÀ13 */
#define ADC_CHANNEL_AD14                         0xe     /*!< ADCÊäÈëͨµÀ14 */
#define ADC_CHANNEL_AD15                         0xf     /*!< ADCÊäÈëͨµÀ15 */
#define ADC_CHANNEL_AD16                         0x10    /*!< ADCÊäÈëͨµÀ16 */
#define ADC_CHANNEL_AD17                         0x11    /*!< ADCÊäÈëͨµÀ17 */
#define ADC_CHANNEL_AD18                         0x12    /*!< ADCÊäÈëͨµÀ18 */
#define ADC_CHANNEL_AD19                         0x13    /*!< ADCÊäÈëͨµÀ19 */
#define ADC_CHANNEL_AD20                         0x14    /*!< ADCÊäÈëͨµÀ20 */ 
#define ADC_CHANNEL_AD21                         0x15    /*!< ADCÊäÈëͨµÀ21 */ 
#define ADC_CHANNEL_TEMPSENSOR                   0x16    /*!< ADCÊäÈëͨµÀÄÚ²¿Î¶ȴ«¸ÐÆ÷ */
#define ADC_CHANNEL_BANDGAP                      0x17    /*!< ADC²ÉÑù»ù×¼µçѹ */ 
#define ADC_CHANNEL_AD22                         0x18    /*!< ADCÊäÈëͨµÀ22 */ 
#define ADC_CHANNEL_AD23                         0x19    /*!< ADCÊäÈëͨµÀ23 */ 
#define ADC_CHANNEL_VSS                          0x1A    /*!< ADCÊäÈëͨµÀVSS */ 
#define ADC_CHANNEL_VREFH                        0x1D    /*!< ADCÊäÈëͨµÀVrefh */ 
#define ADC_CHANNEL_VREFL                        0x1E    /*!< ADCÊäÈëͨµÀVrefl */ 
#define ADC_CHANNEL_DISABLE                      0x1F    /*!< ADCʧÄÜ */
/**
    * @}
    */
 
/**
  * @}
  */
 
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/ 
void ADC_DeInit(ADC_Type* ADCx);
void ADC_Init(ADC_Type* ADCx, const ADC_InitTypeDef* ADC_InitStruct);
void ADC_FIFOConfig(ADC_Type* ADCx, const ADC_FIFOTypeDef* ADC_FIFOStruct);
void ADC_CompareConfig(ADC_Type* ADCx, const ADC_CompareTypeDef* ADC_CompareStruct);
void ADC_EnableCmd(ADC_Type* ADCx, FunctionalState NewState);
void ADC_HardwareTriggrMaskCmd(ADC_Type* ADCx, FunctionalState NewState);
void ADC_SetTriggerMode(ADC_Type* ADCx, uint8_t ADC_Triggermode);
void ADC_ADACKSelect(ADC_Type* ADCx, uint8_t ADC_ADACKmode);
void ADC_SetConventionMode(ADC_Type* ADCx, uint8_t ADC_ConventionMode);
void ADC_SetChannel(ADC_Type* ADCx, uint8_t channelno);
void ADC_InterruptEn(ADC_Type* ADCx, FunctionalState NewState);
void ADC_DMATxEn(ADC_Type* ADCx, FunctionalState NewState);
void ADC_DMARxEn(ADC_Type* ADCx, FunctionalState NewState);
uint16_t ADC_GetConversionValue(const ADC_Type* ADCx);
uint16_t ADC_GetFIFOValueCounter(const ADC_Type* ADCx);
FlagStatus ADC_GetFlagStatus(const ADC_Type* ADCx, uint16_t ADC_FLAG);
FlagStatus ADC_GetCompareFlagStatus(const ADC_Type* ADCx, uint16_t ADC_COMPARE_FLAG);
void ADC_DisableChannelDigFuc(ADC_Type* ADCx, uint8_t channelno, FunctionalState NewState);
 
 
#ifdef __cplusplus
}
#endif
 
#endif    /*__XL_ADC_H__ */
/**
  * @}
  */
 
/**
  * @}
  */