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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
/**
  ******************************************************************************
  * @file     xl_port.c
  * @author   Kirk ,xu.wang
  * @version  4.5.2
  * @date     Fri Mar 26 17:29:12 2021
  * @brief    This file provide function about PORT firmware program 
  ******************************************************************************
  * @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>
  ******************************************************************************
  */
 
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
 
    
/* Includes ---------------------------------------------------------------*/
#include "xl_port.h"
    
/** @addtogroup XL6600_StdPeriph_Driver
  * @{
  */
 
/** @defgroup PORT PORT Module
  * @brief PORT Driver Modules Library
  * @{
  */
 
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/    
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
 
/** @defgroup PORT_Private_Functions
  * @{
  */ 
 
/**
  * @brief PORTĬÈϳõʼ»¯
  * @param  None.
  * @retval None.
  */ 
void PORT_DeInit(void)
{
    /* Deinitializes to default reset values */
    PORT->IOFLT0 = 0x00C00000;
    PORT->IOFLT1 = 0x00000000;
    PORT->PUE0 =      0x00100000;
    PORT->PUE1 =      0x00000000;
    PORT->PUE2 =     0x00000000;
    PORT->HDRVE =  0x00000000;
}
 
/**
  * @brief ÉèÖÃÊäÈëÒý½ÅµÄÂ˲¨Æ÷
  * @param IOflt0ConfigPtr: port_ioflt0_config ÀàÐ͵ÄÖ¸Õ룬°üº¬ÁËPORT IOFLT0 ÍâÉèµÄÅäÖÃÐÅÏ¢
  * @retval None.
  */ 
void PORT_IOFLT0Config(const port_ioflt0_config *IOflt0ConfigPtr)
{                                         
    PORT->IOFLT0 = (uint32_t)(IOflt0ConfigPtr->iofltdiv3 | IOflt0ConfigPtr->iofltdiv2 | \
                                             IOflt0ConfigPtr->iofltdiv1 | IOflt0ConfigPtr->iofltnmi | \
                                             IOflt0ConfigPtr->iofltkbi1 | IOflt0ConfigPtr->iofltkbi0 | \
                                             IOflt0ConfigPtr->iofltrst | IOflt0ConfigPtr->iofltpth | \
                                             IOflt0ConfigPtr->iofltptg | IOflt0ConfigPtr->iofltptf | \
                                             IOflt0ConfigPtr->iofltpte | IOflt0ConfigPtr->iofltptd | \
                                             IOflt0ConfigPtr->iofltptc | IOflt0ConfigPtr->iofltptb | \
                                             IOflt0ConfigPtr->iofltpta);;
}
    
/**
  * @brief ÉèÖÃÊäÈëÒý½ÅµÄÂ˲¨Æ÷
  * @param IOflt1ConfigPtr: port_ioflt1_config ÀàÐ͵ÄÖ¸Õ룬°üº¬PORT IOFLT1 ÍâÉèµÄÉèÖÃÐÅÏ¢
  * @retval None.
  */ 
void PORT_IOFLT1Config(const port_ioflt1_config *IOflt1ConfigPtr)
{
    uint16_t tmpreg;
 
    /*---------------------------- PORT IOFLT1 Configuration ------------------------*/    
    /* get the present value in IOFLT1 Register. */
    tmpreg = (uint16_t)PORT->IOFLT1 ;
    /* Clear the bits in IOFLT1. */
    tmpreg &= ~(uint16_t)(PORT_IOFLT1_FLTI_MASK | PORT_IOFLT1_FLTIRQ_MASK| PORT_IOFLT1_FLTFTM0_MASK | \
                                       PORT_IOFLT1_FLTFTM1_MASK | PORT_IOFLT1_FLTPWT_MASK | \
                                        PORT_IOFLT1_FLTI2C0_MASK | PORT_IOFLT1_FLTI2C1_MASK);
    /* Configure the bits. */
    tmpreg |= (IOflt1ConfigPtr->ioflti2c1 | IOflt1ConfigPtr->ioflti2c0 | \
                                             IOflt1ConfigPtr->iofltpwt | IOflt1ConfigPtr->iofltftm1 | \
                                             IOflt1ConfigPtr->iofltftm0 | IOflt1ConfigPtr->iofltirq | \
                                             IOflt1ConfigPtr->iofltpti);
    /* data write to IOFLT1 register. */
    PORT->IOFLT1 = tmpreg ;
}
 
 
/**
  * @brief     PORTÂ˲¨Æ÷·Ö×é3ʱÖÓÑ¡Ôñ
  * @param clk: Ê±ÖÓÑ¡Ôñ²ÎÊý
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTDIV3SetLPOCLK: LPOʱÖÓ²»·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv2: LPOʱÖÓ2·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv4: LPOʱÖÓ4·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv8: LPOʱÖÓ8·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv16: LPOʱÖÓ16·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv32: LPOʱÖÓ32·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv64: LPOʱÖÓ64·ÖƵ
  *            @arg Port_FLTDIV3SetLPOCLKDiv128: LPOʱÖÓ128·ÖƵ
  * @retval None.
  */ 
void PORT_FLTDIV3ConSet(uint32_t clk)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTDIV3_MASK;
    PORT->IOFLT0 |= clk;
}
 
/**
  * @brief     PORTÂ˲¨Æ÷·Ö×é2ʱÖÓÑ¡Ôñ
  * @param clk: Ê±ÖÓÑ¡Ôñ²ÎÊý
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTDIV2SetBUSCLKDiv32: ×ÜÏßʱÖÓ32·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv64: ×ÜÏßʱÖÓ64·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv128: ×ÜÏßʱÖÓ128·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv256: ×ÜÏßʱÖÓ256·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv512: ×ÜÏßʱÖÓ512·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv1024: ×ÜÏßʱÖÓ1024·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv2048: ×ÜÏßʱÖÓ2048·ÖƵ
  *         @arg Port_FLTDIV2SetBUSCLKDiv4096: ×ÜÏßʱÖÓ4096·ÖƵ
  * @retval None.
  */ 
void PORT_FLTDIV2Set(uint32_t clk)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTDIV2_MASK;
    PORT->IOFLT0 |= clk;
}
 
/**
  * @brief     PORTÂ˲¨Æ÷·Ö×é1ʱÖÓÑ¡Ôñ
  * @param clk: Ê±ÖÓÑ¡Ôñ²ÎÊý
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTDIV1SetBUSCLKDiv2: ×ÜÏßʱÖÓ2·ÖƵ
  *         @arg Port_FLTDIV1SetBUSCLKDiv4: ×ÜÏßʱÖÓ4·ÖƵ
  *         @arg Port_FLTDIV1SetBUSCLKDiv8: ×ÜÏßʱÖÓ8·ÖƵ
  *         @arg Port_FLTDIV1SetBUSCLKDiv16: ×ÜÏßʱÖÓ16·ÖƵ
  * @retval None.
  */ 
void PORT_FLTDIV1Set(uint32_t clk)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTDIV1_MASK;
    PORT->IOFLT0 |= clk;
}    
 
/**
  * @brief     NMIÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param NMIFilter: NMIÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTNMINoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTNMIFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTNMIFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTNMIFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTNMISET(uint32_t NMIFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTNMI_MASK;
    PORT->IOFLT0 |= NMIFilter;
}
 
/**
  * @brief     KBI1ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param KBI1Filter: KBI1Â˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTKBI1NoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTKBI1FLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTKBI1FLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTKBI1FLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTKBI1SET(uint32_t KBI1Filter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTKBI1_MASK;
    PORT->IOFLT0 |= KBI1Filter;
}
 
/**
  * @brief     KBI0ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param KBI0Filter: KBI0Â˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTKBI0NoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTKBI0FLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTKBI0FLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTKBI0FLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTKBI0SET(uint32_t KBI0Filter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTKBI0_MASK;
    PORT->IOFLT0 |= KBI0Filter;
}
 
/**
  * @brief     ResetÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param RSTFilter: RESETÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTRSTNoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTRSTFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTRSTFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTRSTFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTRSTSET(uint32_t RSTFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTRST_MASK;
    PORT->IOFLT0 |= RSTFilter;
}
 
/**
  * @brief     FLTHÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTHFilter: FLTHÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTHBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTHFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTHFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTHFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTHSET(uint32_t FLTHFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTH_MASK;
    PORT->IOFLT0 |= FLTHFilter;
}
 
/**
  * @brief     FLTGÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTGFilter: FLTGÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTGBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTGFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTGFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTGFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTGSET(uint32_t FLTGFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTG_MASK;
    PORT->IOFLT0 |= FLTGFilter;
}
 
/**
  * @brief     FLTFÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTFFilter: FLTFÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTFBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTFFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTFFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTFFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTFSET(uint32_t FLTFFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTF_MASK;
    PORT->IOFLT0 |= FLTFFilter;
}
 
/**
  * @brief     FLTEÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTEFilter: FLTEÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTEBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTEFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTEFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTEFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTESET(uint32_t FLTEFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTE_MASK;
    PORT->IOFLT0 |= FLTEFilter;
}
 
/**
  * @brief     FLTDÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTDFilter: FLTDÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTDBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTDFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTDFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTDFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTDSET(uint32_t FLTDFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTD_MASK;
    PORT->IOFLT0 |= FLTDFilter;
}
 
/**
  * @brief     FLTCÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTCFilter: FLTCÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTCBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTCFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTCFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTCFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTCSET(uint32_t FLTCFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTC_MASK;
    PORT->IOFLT0 |= FLTCFilter;
}
 
/**
  * @brief     FLTBÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTBFilter: FLTBÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTBBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTBFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTBFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTBFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTBSET(uint32_t FLTBFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTB_MASK;
    PORT->IOFLT0 |= FLTBFilter;
}
 
/**
  * @brief     FLTAÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTAFilter: FLTAÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTABUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTAFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTAFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTAFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTASET(uint32_t FLTAFilter)
{
    PORT->IOFLT0 &= ~PORT_IOFLT0_FLTA_MASK;
    PORT->IOFLT0 |= FLTAFilter;
}
 
/**
  * @brief     FLTEWMÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTEWMFilter: FLTEWMÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTEWMNoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTEWMFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTEWMFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTIEWMBUSCLK: ×ÜÏßʱÖÓ
  * @retval None.
  */ 
void PORT_FLTEWMSET(uint32_t FLTEWMFilter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTEWM_MASK;
    PORT->IOFLT1 |= FLTEWMFilter;
}
 
/**
  * @brief     FLTI2C1ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTI2C1Filter: FLTI2C1Â˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTI2C1NoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTI2C1FLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTI2C1FLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTI2C1BUSCLK: ×ÜÏßʱÖÓ
  * @retval None.
  */ 
void PORT_FLTI2C1SET(uint32_t FLTI2C1Filter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTI2C1_MASK;
    PORT->IOFLT1 |= FLTI2C1Filter;
}
 
/**
  * @brief     FLTI2C0ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTI2C0Filter: FLTI2C0Â˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTI2C0NoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTI2C0FLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTI2C0FLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTI2C0BUSCLK: ×ÜÏßʱÖÓ
  * @retval None.
  */ 
void PORT_FLTI2C0SET(uint32_t FLTI2C0Filter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTI2C0_MASK;
    PORT->IOFLT1 |= FLTI2C0Filter;
}
 
/**
  * @brief     FLTPWTÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTPWTFilter: FLTPWTÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTPWTNoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTPWTFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTPWTFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTPWTFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTPWTSET(uint32_t FLTPWTFilter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTPWT_MASK;
    PORT->IOFLT1 |= FLTPWTFilter;
}
 
/**
  * @brief     FLTFTM1ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTFTM1Filter: FLTFTM1Â˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTFTM1NoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTFTM1FLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTFTM1FLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTFTM1FLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTFTM1SET(uint32_t FLTFTM1Filter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTFTM1_MASK;
    PORT->IOFLT1 |= FLTFTM1Filter;
}
 
/**
  * @brief     FLTFTM0ÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTFTM0Filter: FLTFTM0Â˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTFTM0NoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTFTM0FLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTFTM0FLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTFTM0FLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTFTM0SET(uint32_t FLTFTM0Filter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTFTM0_MASK;
    PORT->IOFLT1 |= FLTFTM0Filter;
}
 
/**
  * @brief     FLTIRQÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTIRQFilter: FLTIRQÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTIRQNoFilter: ÎÞÂ˲¨Æ÷
  *         @arg Port_FLTIRQFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTIRQFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTIRQFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTIRQSET(uint32_t FLTIRQFilter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTIRQ_MASK;
    PORT->IOFLT1 |= FLTIRQFilter;
}
 
/**
  * @brief     FLTIÊäÈëÂ˲¨Æ÷Ñ¡Ôñ
  * @param FLTAFilter: FLTIÂ˲¨Æ÷²ÎÊýÑ¡Ôñ
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg Port_FLTIBUSCLK: ×ÜÏßʱÖÓ
  *         @arg Port_FLTIFLTDIV1: Â˲¨Æ÷·Ö×é1
  *         @arg Port_FLTIFLTDIV2: Â˲¨Æ÷·Ö×é2
  *         @arg Port_FLTIFLTDIV3: Â˲¨Æ÷·Ö×é3
  * @retval None.
  */ 
void PORT_FLTISET(uint32_t FLTIFilter)
{
    PORT->IOFLT1 &= ~PORT_IOFLT1_FLTI_MASK;
    PORT->IOFLT1 |= FLTIFilter;
}
 
/**
  * @brief ÉèÖö˿ÚÒý½ÅÉÏÀ­
  * @param PortPin: ÐèÒª½øÐÐÉÏÀ­µÄ¶Ë¿ÚÒý½Å(PORT_PTA0~PORT_PTI6)
  * @param NewState: Òý½ÅÉÏÀ­×´Ì¬
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg ENABLE: Ê¹ÄÜÒý½ÅÉÏÀ­
  *            @arg DISABLE: Ê§ÄÜÒý½ÅÉÏÀ­
  * @retval None.
  */ 
void PORT_PullPinCmd(uint8_t PortPin,FunctionalState NewState)
{
    /* while PortPin less than PORT_PTD7 choose PUE0 Regsiter */
    if(PortPin <= (uint8_t)PORT_PTD7)
    {
        if(NewState != DISABLE )
        {
            /* enable pinA-D pull up */
            PORT->PUE0 |= ((uint32_t)1<<PortPin);
        }
        else 
        {    
            /* disable pinA-D pull up */
            PORT->PUE0 &= ~((uint32_t)1<<PortPin);
        }
    }
    else if(PortPin <= (uint8_t)PORT_PTH7)
    {
        if(NewState != DISABLE )
        {
            /* enable pinE-H pull up */
            PORT->PUE1 |= ((uint32_t)1<<(PortPin - 32u));
        }
        else 
        {    
            /* disable pinE-H pull up */
            PORT->PUE1 &= ~((uint32_t)1<<(PortPin - 32u));
        }
    }
    else
    {
        if(NewState != DISABLE )
        {
            /* enable pinI pull up */
            PORT->PUE2 |= ((uint32_t)1<<(PortPin - 64u));
        }
        else 
        {    
            /* disable pinI pull up */
            PORT->PUE2 &= ~((uint32_t)1<<(PortPin - 64u));
        }
    }
}
 
/**
  * @brief ÉèÖö˿ÚÒý½ÅµÄ´óµçÁ÷Çý¶¯
  * @param hdrvePin: ±íʾÐèÒª½øÐÐÉèÖõĶ˿Ú
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg PORT_PullPTB4: PTB4´óµçÁ÷Çý¶¯ÄÜÁ¦
  *            @arg PORT_PullPTB5: PTB5´óµçÁ÷Çý¶¯ÄÜÁ¦
  *         @arg PORT_PullPTD0: PTD0´óµçÁ÷Çý¶¯ÄÜÁ¦
  *            @arg PORT_PullPTD1: PTD1´óµçÁ÷Çý¶¯ÄÜÁ¦
  *         @arg PORT_PullPTE0: PTE0´óµçÁ÷Çý¶¯ÄÜÁ¦
  *            @arg PORT_PullPTE1: PTE1´óµçÁ÷Çý¶¯ÄÜÁ¦
  *         @arg PORT_PullPTH0: PTH0´óµçÁ÷Çý¶¯ÄÜÁ¦
  *            @arg PORT_PullPTH1: PTH1´óµçÁ÷Çý¶¯ÄÜÁ¦
  * @param NewState: ´óµçÁ÷Çý¶¯Ê¹ÄÜ״̬
  *        Õâ¸ö²ÎÊý¿ÉÒÔÈ¡ÏÂÃæµÄÖµ:
  *         @arg ENABLE: ´óµçÁ÷Çý¶¯Ê¹ÄÜ
  *            @arg DISABLE: ´óµçÁ÷Çý¶¯Ê§ÄÜ
  * @retval None.
  */ 
void PORT_HDRVEPinCmd(uint8_t hdrvePin,FunctionalState NewState)
{
    if(NewState != DISABLE )
    {
        /* enable pin high drive */
        PORT->HDRVE |= ((uint32_t)1<<hdrvePin) ;
    }
    else 
    {
        /* disable pin high drive */
        PORT->HDRVE &= ~((uint32_t)1<< hdrvePin );
    }
}
 
/**
  * @}
  */
 
/**
  * @}
  */
 
/**
  * @}
  */
 
#ifdef __cplusplus
}
#endif /* __cplusplus */