dcl_gpio.h
25.6 KB
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
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2001
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* dcl_gpio.h
*
* Project:
* --------
* Maui
*
* Description:
* ------------
* Header file of DCL (Driver Common Layer) for GPIO.
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifdef DCL_DEFINITION_STRUCT
#ifndef __DCL_GPIO_H_STRUCT__
#define __DCL_GPIO_H_STRUCT__
//#include "gpio_sw_.h"
//#include "drv_features_gpio.h"
#define INPUT 0 /* IO in input */
#define ALL_INPUT 0x0000
#define OUTPUT 1 /* IO in output */
#define ALL_OUTPUT 0xffff
#define GPIO_DIR_INPUT 0
#define GPIO_DIR_OUTPUT 1
#define GPIO_DIR_BOTH 2
#define GPIO_MAGIC_NUM 0x80
#define GPO_MAGIC_NUM 0x70
#define GPIO_INPUT 0 /* IO in input */
#define GPIO_ALL_INPUT 0x0000
#define GPIO_OUTPUT 1 /* IO in output */
#define GPIO_ALL_OUTPUT 0xffff
#define GPIO_MAGIC_NUM_INTERNAL 0x80
#define GPO_MAGIC_NUM_INTERNAL 0x70
#if 0
/* under construction !*/
/* under construction !*/
/* under construction !*/
#if defined(DRV_GPIO_REG_AS_6223) || defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#if defined(DRV_GPIO_REG_AS_6253T) || defined(DRV_GPIO_REG_AS_6253E) || defined(DRV_GPIO_REG_AS_6253E_1)
/* under construction !*/
/* under construction !*/
#if defined(DRV_GPIO_REG_AS_6253E_1)
/* under construction !*/
/* under construction !*/
#endif /*DRV_GPIO_REG_AS_6253E*/
#endif /*DRV_GPIO_REG_AS_6253T*/
#elif defined(DRV_GPIO_REG_AS_6238) || defined(DRV_GPIO_REG_AS_6235)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#if defined(DRV_GPIO_REG_AS_6235)
/* under construction !*/
/* under construction !*/
#endif
#elif defined(DRV_GPIO_REG_AS_6268A) || defined(DRV_GPIO_REG_AS_6268) || defined(DRV_GPIO_REG_AS_6270A)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#if !defined(DRV_GPIO_REG_AS_6270A)
/* under construction !*/
/* under construction !*/
#endif//!defined(DRV_GPIO_REG_AS_6270A)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(DRV_GPIO_REG_AS_6236)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(DRV_GPIO_REG_AS_6255)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(DRV_GPIO_REG_AS_6276)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(DRV_GPIO_REG_AS_6251)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif
typedef enum {
mode_default = 0,
mode_f32k_ck = 0x82,
mode_max_num
} gpio_clk_mode;
//remove this to see if there are build error .this should be delete. 12-22.
#if 0
/* under construction !*/
/* under construction !*/
#if defined(DRV_GPIO_REG_AS_6255)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#elif defined(DRV_GPIO_REG_AS_6276)
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
/* under construction !*/
#endif //defined(DRV_GPIO_REG_AS_6255)
/* under construction !*/
/* under construction !*/
#endif
typedef enum {
div_max_num=16
} gpio_clk_div;
typedef struct
{
kal_uint8 pin_num; /*1,activated ,0:de-activated*/
kal_uint8 dir; // GPIO_DIR_OUTPUT or GPIO_DIR_INPUT or GPIO_DIR_BOTH
} GPIOCheckStruct;
/*******************************************************************************
* DCL_OPTIONS for GPIO
*******************************************************************************/
#define GPIO_OPTIONS
/*******************************************************************************
* DCL_CONFIGURE_T
*******************************************************************************/
/*******************************************************************************
* DCL_EVENT for GPIO
*******************************************************************************/
#define GPIO_EVENTS
/*******************************************************************************
* DCL_CTRL_CMD for GPIO
*******************************************************************************/
#ifdef __BUILD_DOM__
/*The GPIO Command values in DCL_CTRL_CMD_T Enum of dcl.h*/
/*DCL_CTRL_DATA_T Define the Control data structure for each module's command*/
typedef enum
{
GPIO_CMD_READ, /*read data from GPIO Pin*/
GPIO_CMD_WRITE_LOW, /*write low to GPIO pin*/
GPIO_CMD_WRITE_HIGH, /*write high to GPIO Pin*/
GPIO_CMD_SET_MODE_0, /*set GPIO mode as mode 0*/
GPIO_CMD_SET_MODE_1, /*set GPIO mode as mode 1*/
GPIO_CMD_SET_MODE_2, /*set GPIO mode as mode 2*/
GPIO_CMD_SET_MODE_3, /*set GPIO mode as mode 3*/
GPIO_CMD_SET_MODE_4, /*set GPIO mode as mode 4 ,only for chip support 4-bit mode*/
GPIO_CMD_SET_MODE_5, /*set GPIO mode as mode 5*,only for chip support 4-bit mode*/
GPIO_CMD_SET_MODE_6, /*set GPIO mode as mode 6*,only for chip support 4-bit mode*/
GPIO_CMD_SET_MODE_7, /*set GPIO mode as mode 7*,only for chip support 4-bit mode*/
GPIO_CMD_SET_MODE_8, /*set GPIO mode as mode 8*,only for chip support 4-bit mode*/
GPIO_CMD_SET_MODE_9,
GPIO_CMD_SET_MODE_10,
GPIO_CMD_SET_DIR_OUT, /*set GPIO direction as output*/
GPIO_CMD_SET_DIR_IN, /*set GPIO direction as input*/
GPIO_CMD_RETURN_MODE, /*get current GPIO mode*/
GPIO_CMD_RETURN_DIR, /*get current GPIO direction*/
GPIO_CMD_RETURN_OUT, /*get current GPIO output level*/
GPIO_CMD_ENABLE_PULL, /*enable GPIO pull-up/pull-down seting */
GPIO_CMD_DISABLE_PULL, /*disable GPIO pull-up/pull-down seting*/
GPIO_CMD_SET_PULL_HIGH, /*set GPIO as pull-up*/
GPIO_CMD_SET_PULL_LOW, /*set GPIO as pull-down*/
GPIO_CMD_SET_DINV, /*enable or disable GPIO data inversion*/
GPIO_CMD_SET_DEBUG, /*configure the GPIO sets to auxiliary function mode or to debug mode*/
GPIO_CMD_SET_CLK_OUT, /*select the clock output source of GPIO*/
GPIO_CMD_SET_CLK_DIV,
GPO_CMD_RETURN_MODE, /*get current GPO mode*/
GPO_CMD_RETURN_OUT, /*get current GPO output level*/
GPO_CMD_WRITE_HIGH, /*write high to GPO Pin*/
GPO_CMD_WRITE_LOW, /*write low to GPO Pin*/
GPO_CMD_MODE_SET_0, /*set GPIO mode as mode 0*/
GPO_CMD_MODE_SET_1, /*set GPIO mode as mode 1*/
GPO_CMD_MODE_SET_2, /*set GPIO mode as mode 2*/
GPO_CMD_MODE_SET_3, /*set GPIO mode as mode 3*/
GPIO_CMD_SET_DIR_OUT_NO_IRQ_MASK, /*set GPIO direction as output without mask IRQ portect*/
GPIO_CMD_SET_DIR_IN_NO_IRQ_MASK, /*set GPIO direction as input without mask IRQ portect*/
GPIO_CMD_WRITE_HIGH_NO_IRQ_MASK, /*write high to GPIO Pin without mask IRQ protect*/
GPIO_CMD_WRITE_LOW_NO_IRQ_MASK, /*write low to GPIO Pin without mask IRQ protect*/
GPIO_CMD_READ_NO_IRQ_MASK, /*read data from GPIO Pin without IRQ mask*/
GPIO_CMD_WRITE_FOR_SPI, /*this function is to write data to one GPIO port, that for faster access without debug checking.*/
GPIO_CMD_SET_PUPD_R0_R1,
}DCL_CTRL_CMD_T;
#else
#define GPIO_CMDS \
GPIO_CMD_READ, \
GPIO_CMD_WRITE_LOW, \
GPIO_CMD_WRITE_HIGH, \
GPIO_CMD_SET_MODE_0, \
GPIO_CMD_SET_MODE_1, \
GPIO_CMD_SET_MODE_2, \
GPIO_CMD_SET_MODE_3, \
GPIO_CMD_SET_MODE_4, \
GPIO_CMD_SET_MODE_5, \
GPIO_CMD_SET_MODE_6, \
GPIO_CMD_SET_MODE_7, \
GPIO_CMD_SET_MODE_8, \
GPIO_CMD_SET_MODE_9, \
GPIO_CMD_SET_MODE_10, \
GPIO_CMD_SET_DIR_OUT,\
GPIO_CMD_SET_DIR_IN, \
GPIO_CMD_RETURN_MODE, \
GPIO_CMD_RETURN_DIR, \
GPIO_CMD_RETURN_OUT, \
GPIO_CMD_ENABLE_PULL, \
GPIO_CMD_DISABLE_PULL,\
GPIO_CMD_SET_PULL_HIGH, \
GPIO_CMD_SET_PULL_LOW, \
GPIO_CMD_SET_DINV, \
GPIO_CMD_SET_DEBUG, \
GPIO_CMD_SET_CLK_OUT, \
GPIO_CMD_SET_CLK_DIV, \
GPO_CMD_RETURN_MODE, \
GPO_CMD_RETURN_OUT, \
GPO_CMD_WRITE_HIGH, \
GPO_CMD_WRITE_LOW, \
GPO_CMD_MODE_SET_0, \
GPO_CMD_MODE_SET_1, \
GPO_CMD_MODE_SET_2, \
GPO_CMD_MODE_SET_3,\
GPIO_CMD_SET_DIR_OUT_NO_IRQ_MASK, \
GPIO_CMD_SET_DIR_IN_NO_IRQ_MASK, \
GPIO_CMD_WRITE_HIGH_NO_IRQ_MASK, \
GPIO_CMD_WRITE_LOW_NO_IRQ_MASK, \
GPIO_CMD_READ_NO_IRQ_MASK, \
GPIO_CMD_WRITE_FOR_SPI, \
GPIO_CMD_SET_PUPD_R0_R1,
#endif /*__BUILD_DOM__*/
#define GPIO_PULL_ENABLE 1
#define GPIO_PULL_DISABLE 0
#define GPIO_PULL_HIGH 1
#define GPIO_PULL_LOW 0
/* FOR GPIO_CMD_READ control command. */
typedef struct
{
#define GPIO_IO_HIGH 1
#define GPIO_IO_LOW 0
DCL_UINT8 u1IOData; // GPIO_IO_HIGH or GPIO_IO_LOW
} GPIO_CTRL_READ_T;
/* FOR GPIO_CMD_RETURN_MODE control command. */
typedef struct
{
#define GPIO_MODE_0 0
#define GPIO_MODE_1 1
#define GPIO_MODE_2 2
#define GPIO_MODE_3 3
#define GPIO_MODE_4 4
#define GPIO_MODE_5 5
#define GPIO_MODE_6 6
#define GPIO_MODE_7 7
#define GPIO_MODE_8 8
DCL_UINT8 u1RetMode;//Output: to return GPIO_MODE0, GPIO_MODE1, GPIO_MODE2, or GPIO_MODE3
} GPIO_CTRL_RETURN_MODE_T;
/* FOR GPO_CMD_RETURN_MODE control command. */
typedef struct
{
#define GPO_MODE_0 0
#define GPO_MODE_1 1
#define GPO_MODE_2 2
#define GPO_MODE_3 3
DCL_UINT8 u1RetMode;//Output: to return GPO_MODE0, GPO_MODE1, GPO_MODE2, or GPO_MODE3
} GPO_CTRL_RETURN_MODE_T;
/* FOR GPIO_CMD_RETURN_DIR control command. */
typedef struct
{
#define GPIO_DIR_IN 0
#define GPIO_DIR_OUT 1
DCL_UINT8 u1RetDirData;//Output: to return GPIO_DIR_INPUT, or GPIO_DIR_OUTPUT
} GPIO_CTRL_RETURN_DIR_T;
/* FOR GPIO_CMD_RETURN_OUT control command. */
typedef struct
{
DCL_UINT8 u1RetOutData;//Output: to return GPIO_IO_HIGH or GPIO_IO_LOW
} GPIO_CTRL_RETURN_OUT_T;
/* FOR GPO_CMD_RETURN_OUT control command. */
typedef struct
{
#define GPO_IO_HIGH 1
#define GPO_IO_LOW 0
DCL_UINT8 u1RetOutData;//Output: to return GPO_IO_HIGH or GPO_IO_LOW
} GPO_CTRL_RETURN_OUT_T;
/* FOR GPIO_CMD_SET_DINV control command. */
typedef struct
{
DCL_BOOL fgSetDinv; //get more detail in spec.
} GPIO_CTRL_SET_DINV_T;
/* FOR GPIO_CMD_SET_PUPD_R0_R1 control command. */
typedef struct
{
DCL_BOOL fgSetPupd; //get more detail in spec.
DCL_BOOL fgSetR0;
DCL_BOOL fgSetR1;
} GPIO_CTRL_SET_PUPD_R0_R1_T;
/* FOR GPIO_CMD_SET_DEBUG control command. */
typedef struct
{
DCL_BOOL fgSetDebug;
} GPIO_CTRL_SET_DEBUG_T;
/* FOR GPIO_CMD_SET_CLK_OUT control command. */
typedef struct
{
DCL_UINT16 u2ClkNum; //clock number in spec.
gpio_clk_mode u2Mode;
// DCL_UINT16 u2Mode; //the CLKOUT value in spec.(by chip)
} GPIO_CTRL_SET_CLK_OUT_T;
/* FOR GPIO_CMD_SET_CLK_DIV control command. */
typedef struct
{
DCL_UINT16 u2ClkNum; //clock number in spec.
gpio_clk_div u2Div;
//DCL_UINT16 u2Div; //the CLKOUT value in spec.(by chip)
}GPIO_CTRL_SET_CLK_DIV_T;
/* FOR GPIO_CTRL_WRITE_FOR_SPI_T control command. */
typedef struct
{
DCL_UINT8 data;
DCL_UINT16 no;
DCL_UINT16 remainder_shift;
} GPIO_CTRL_WRITE_FOR_SPI_T;
#ifdef __BUILD_DOM__
/*The GPIO command prarmeter data structure for each command. that's enum in in DCL_CTRL_DATA_T*/
typedef struct
{
GPIO_CTRL_READ_T rRead; /*data structure for GPIO_CMD_READ control command */
GPIO_CTRL_RETURN_MODE_T rReturnMode; /*data structure for GPIO_CMD_RETURN_MODE control command*/
GPIO_CTRL_RETURN_DIR_T rReturnDir; /*data structure for GPIO_CMD_RETURN_DIR control command */
GPIO_CTRL_RETURN_OUT_T rReturnOut; /*data structure for GPIO_CMD_RETURN_OUT control command */
GPIO_CTRL_SET_DINV_T rSetDinv; /*data structure for GPIO_CMD_SET_DINV control command */
GPIO_CTRL_SET_PUPD_R0_R1_T rSetPupdR0R1; /*data structure for GPIO_CTRL_SET_PUPD_R0_R1_T control command */
GPIO_CTRL_SET_DEBUG_T rSetDebug; /*data structure for GPIO_CMD_SET_DEBUG control command */
GPIO_CTRL_SET_CLK_OUT_T rSetClkOut; /*data structure for GPIO_CMD_SET_CLK_OUT control command */
GPIO_CTRL_SET_CLK_DIV_T rSetClkDiv;
GPIO_CTRL_WRITE_FOR_SPI_T rWriteSpi; /*data structure for GPIO_CTRL_WRITE_FOR_SPI control command */
GPO_CTRL_RETURN_MODE_T oReturnMode; /*data structure for GPO_CMD_RETURN_OUT control command */
GPO_CTRL_RETURN_OUT_T oReturnOut; /*data structure for GPO_CMD_RETURN_MODE control command */
}DCL_CTRL_DATA_T;
#else
#define GPIO_CTRLS \
GPIO_CTRL_READ_T rRead; \
GPIO_CTRL_RETURN_MODE_T rReturnMode; \
GPIO_CTRL_RETURN_DIR_T rReturnDir; \
GPIO_CTRL_RETURN_OUT_T rReturnOut; \
GPIO_CTRL_SET_DINV_T rSetDinv; \
GPIO_CTRL_SET_PUPD_R0_R1_T rSetPupdR0R1;\
GPIO_CTRL_SET_DEBUG_T rSetDebug; \
GPIO_CTRL_SET_CLK_OUT_T rSetClkOut; \
GPIO_CTRL_SET_CLK_DIV_T rSetClkDiv; \
GPIO_CTRL_WRITE_FOR_SPI_T rWriteSpi; \
GPO_CTRL_RETURN_MODE_T oReturnMode; \
GPO_CTRL_RETURN_OUT_T oReturnOut;
#endif //__BUILD_DOM__
#endif // #ifndef __DCL_GPIO_H_STRUCT__
#endif // #ifdef DCL_DEFINITION_STRUCT
#if defined(DCL_DEFINITION_PROTOTYPE)
#ifndef __DCL_GPIO_H_PROTOTYPE__
#define __DCL_GPIO_H_PROTOTYPE__
// MoDIS parser skip start
/*************************************************************************
* FUNCTION
* DclGPIO_Initialize
*
* DESCRIPTION
* This function is to initialize GPIO module. Note that all the GPIO pin
* will be set to a predefined state.
*
* PARAMETERS
* none
*
* RETURN VALUES
* none
*
*************************************************************************/
extern DCL_STATUS DclGPIO_Initialize(void);
/*************************************************************************
* FUNCTION
* DclGPIO_Open
* DESCRIPTION
* This function is to open the GPIO module and get a handle. Note that multiple opens are allowed.
*
* PARAMETERS
* eDev: - only valid for DCL_GPIO,DCL_GPO,DCL_GPIO_CLK.
* flags: - no sepcial flags is needed. Please use FLAGS_NONE
*
* RETURN VALUES
* DCL_HANDLE_INVALID: - Open failed.
* other value: - a valid handle
*
*************************************************************************/
extern DCL_HANDLE DclGPIO_Open(DCL_DEV dev, DCL_FLAGS flags);
/*************************************************************************
* FUNCTION
* DclGPIO_ReadData
*
* DESCRIPTION
* This function is not supported for the GPIO module now.
*
* PARAMETERS
* N/A
*
* RETURN VALUES
* STATUS_UNSUPPORTED:
*
*************************************************************************/
extern DCL_STATUS DclGPIO_ReadData(DCL_HANDLE handle, DCL_BUFF *buff, DCL_BUFF_LEN *buf_len, DCL_OPTIONS options);
/*************************************************************************
* FUNCTION
* DclGPIO_WriteData
*
* DESCRIPTION
* This function is not supported for the GPIO module now.
*
* PARAMETERS
* N/A
*
* RETURN VALUES
* STATUS_UNSUPPORTED:
*
*************************************************************************/
extern DCL_STATUS DclGPIO_WriteData(DCL_HANDLE handle, DCL_BUFF *buff, DCL_BUFF_LEN *buf_len, DCL_OPTIONS options);
/*************************************************************************
* FUNCTION
* DclGPIO_Configure
*
* DESCRIPTION
* This function is not supported for the GPIO module now.
*
* PARAMETERS
* N/A
*
* RETURN VALUES
* STATUS_UNSUPPORTED:
*
*************************************************************************/
extern DCL_STATUS DclGPIO_Configure(DCL_HANDLE handle, DCL_CONFIGURE_T *configure);
/*************************************************************************
* FUNCTION
* DclGPIO_RegisterCallback
*
* DESCRIPTION
* This function is not supported for the GPIO module now.
*
* PARAMETERS
* N/A
*
* RETURN VALUES
* STATUS_UNSUPPORTED:
*
*************************************************************************/
extern DCL_STATUS DclGPIO_RegisterCallback(DCL_HANDLE handle, DCL_EVENT event, PFN_DCL_CALLBACK callback);
/*************************************************************************
* FUNCTION
* DclGPIO_Control
*
* DESCRIPTION
* This function is to send command to control the GPIO module.
*
* PARAMETERS
* handle: - a valid handle return by DclGPIO_Open()
* cmd: - a control command for GPIO module
* 1. GPIO_CMD_READ: to read the input value from the GPIO port contain in handle.
* 2. GPIO_CMD_WRITE_LOW: to write low to the output of GPIO port contain in handle.
* 3. GPIO_CMD_WRITE_HIGH: to write high to the output of GPIO port contain in handle.
* 4. GPIO_CMD_SET_MODE_0: to set the mode of the GPIO port contain in handle as mode 0.
* 5. GPIO_CMD_SET_MODE_1: to set the mode of the GPIO port contain in handle as mode 1.
* 6. GPIO_CMD_SET_MODE_2: to set the mode of the GPIO port contain in handle as mode 2.
* 7. GPIO_CMD_SET_MODE_3: to set the mode of the GPIO port contain in handle as mode 3.
* 8. GPIO_CMD_SET_DIR_OUT: to set the direction of the GPIO port as output.
* 9. GPIO_CMD_SET_DIR_IN: to set the direction of the GPIO port as input.
* 10. GPIO_CMD_RETURN_MODE: to get the mode of the GPIO port
* 11. GPIO_CMD_RETURN_DIR: to get the direction of the GPIO port
* 12. GPIO_CMD_RETURN_OUT: to return the output value of the GPIO port
* 13. GPIO_CMD_ENABLE_PULL: to enable the pull resister for a GPIO port
* 14. GPIO_CMD_DISABLE_PULL: to disenable the pull resister for a GPIO port
* 15. GPIO_CMD_SET_PULL_HIGH: to select the pull up for a GPIO port
* 16. GPIO_CMD_SET_PULL_LOW: to select the pull down for a GPIO port
* 17. GPIO_CMD_SET_DINV: to set the inversion of a GPIO port
* 18. GPIO_CMD_SET_DEBUG: to enable or disable debug mode
* 19. GPIO_CMD_SET_CLK_OUT: to set the clock frequency for a clock output
*
* 20. GPO_CMD_RETURN_MODE: to get the mode of the GPO port
* 21. GPO_CMD_RETURN_OUT: to return the output value of the GPO port
* 22. GPO_CMD_WRITE_HIGH: to write high to the output of GPO port contain in handle.
* 23. GPO_CMD_WRITE_LOW: to write low to the output of GPO port contain in handle.
* 24. GPO_CMD_MODE_SET_0: to set the mode of the GPIO port contain in handle as mode 0.
* 25. GPO_CMD_MODE_SET_1: to set the mode of the GPI1 port contain in handle as mode 1.
* 26. GPO_CMD_MODE_SET_2: to set the mode of the GPI2 port contain in handle as mode 2.
* 27. GPO_CMD_MODE_SET_3: to set the mode of the GPI3 port contain in handle as mode 3.
* 28. GPIO_CMD_SET_DIR_OUT_NO_IRQ_MASK: to set the direction of the GPIO port as output without IRQ protect.
* 29. GPIO_CMD_SET_DIR_IN_NO_IRQ_MASK: to set the direction of the GPIO port as input without IRQ protect
* 30. GPIO_CMD_WRITE_HIGH_NO_IRQ_MASK: to write high to the output of GPIO port contain in handle without IRQ protect.
* 31. GPIO_CMD_WRITE_LOW_NO_IRQ_MASK: to write low to the output of GPIO port contain in handle without IRQ protect.
* 32. GPIO_CMD_READ_NO_IRQ_MASK: to read the input value from the GPIO port contain in handle without IRQ protect..
* 33. GPIO_CMD_WRITE_FOR_SPI_T:
* data: - data for GPIO control command.
* 1. GPIO_CMD_READ: pointer to a GPIO_CTRLS structure
* 2. GPIO_CMD_WRITE_LOW: NULL.
* 3. GPIO_CMD_WRITE_HIGH: NULL.
* 4. GPIO_CMD_SET_MODE_0: NULL.
* 5. GPIO_CMD_SET_MODE_1: NULL.
* 6. GPIO_CMD_SET_MODE_2: NULL.
* 7. GPIO_CMD_SET_MODE_3: NULL.
* 8. GPIO_CMD_SET_DIR_OUT: NULL.
* 9. GPIO_CMD_SET_DIR_IN: NULL.
* 10. GPIO_CMD_RETURN_MODE: pointer to a GPIO_CTRL_RETURN_MODE_T structure
* 11. GPIO_CMD_RETURN_DIR: pointer to a GPIO_CTRL_SET_DIR_T structure
* 12. GPIO_CMD_RETURN_OUT: pointer to a GPIO_CTRL_RETURN_OUT_T structure
* 13. GPIO_CMD_ENABLE_PULL: NULL.
* 14. GPIO_CMD_DISABLE_PULL: NULL.
* 15. GPIO_CMD_SET_PULL_HIGH: NULL.
* 16. GPIO_CMD_SET_PULL_LOW: NULL.
* 17. GPIO_CMD_SET_DINV: pointer to a GPIO_CTRL_SET_DINV_T structure
* 18. GPIO_CMD_SET_DEBUG: pointer to a GPIO_CTRL_SET_DEBUG_T structure
* 19. GPIO_CMD_SET_CLK_OUT: pointer to a GPIO_CTRL_SET_CLK_OUT_T structure
*
* 20. GPO_CMD_RETURN_MODE: pointer to a GPO_CTRL_RETURN_MODE_T structure
* 21. GPO_CMD_RETURN_OUT: pointer to a GPO_CTRL_RETURN_OUT_T structure
* 22. GPO_CMD_WRITE_HIGH: NULL.
* 23. GPO_CMD_WRITE_LOW: NULL.
* 24. GPO_CMD_MODE_SET_0: NULL..
* 25. GPO_CMD_MODE_SET_1: NULL..
* 26. GPO_CMD_MODE_SET_2: NULL.
* 27. GPO_CMD_MODE_SET_3: NULL.
* 28. GPIO_CMD_SET_DIR_OUT_NO_IRQ_MASK: NULL.
* 29. GPIO_CMD_SET_DIR_IN_NO_IRQ_MASK: NULL.
* 30. GPIO_CMD_WRITE_HIGH_NO_IRQ_MASK: NULL.
* 31. GPIO_CMD_WRITE_LOW_NO_IRQ_MASK: NULL.
* 32. GPIO_CMD_READ_NO_IRQ_MASK: pointer to a GPIO_CTRLS structure
* 33. GPIO_CMD_WRITE_FOR_SPI_T: pointer to GPIO_CTRL_WRITE_FOR_SPI_T
* RETURN VALUES
* STATUS_OK: - command is executed successfully.
* STATUS_FAIL: - command is failed.
* STATUS_INVALID_CMD: - The command is invalid.
* STATUS_INVALID_DCL_HANDLE: - The handle is invalid.
* STATUS_INVALID_CTRL_DATA: - The ctrl data is not valid.
*************************************************************************/
extern DCL_STATUS DclGPIO_Control(DCL_HANDLE handle, DCL_CTRL_CMD cmd, DCL_CTRL_DATA_T *data);
/*************************************************************************
* FUNCTION
* DclGPIO_Close
*
* DESCRIPTION
* This function is not supported for the GPIO module now.
*
* PARAMETERS
* handle: the handle that return by DclGPIO_Open.
*
* RETURN VALUES:
* STATUS_UNSUPPORTED:
*
*************************************************************************/
extern DCL_STATUS DclGPIO_Close(DCL_HANDLE handle);
// MoDIS parser skip end
#endif // #ifndef __DCL_GPIO_H_PROTOTYPE__
#endif // #ifdef DCL_DEFINITION_PROTOTYPE