SAMA5D4 Xplained Ultra Board BSP
guowenxue
2019-09-23 c35ac6f2aad2ebe9d7cb5ca461822f0635af3798
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
/********************************************************************************
 *      Copyright:  (C) 2019 LingYun IoT System Studio
 *                  All rights reserved.
 *
 *       Filename:  at91_sysGpioDef.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(2019年08月26日)
 *         Author:  Guo Wenxue <guowenxue@gmail.com>
 *      ChangeLog:  1, Release initial version on "2019年08月26日 21时46分02秒"
 *                 
 ********************************************************************************/
 
#ifndef  _AT91_SYSGPIODEF_H_
#define  _AT91_SYSGPIODEF_H_
 
#include <ctype.h>
#include <stdlib.h>
 
#define PA(x)                 "pioA"#x
#define PB(x)                 "pioB"#x
#define PC(x)                 "pioC"#x
#define PD(x)                 "pioD"#x
#define PE(x)                 "pioE"#x
 
/*  SAMA5D44 devided all GPIOs into 5 groups(PA,PB,PC,PD,PE), and each group control 32 Pins
 *
 * This macro used convert PAx,PBx...,PEx to Pin number: 0~158
 * s should be: PA0-PA31, PB0-PB31, PC0-PC31, PD0-PD31, PE0-PE30(158)
 */
#define at91_port2pin(p)      ((tolower(p[3])-'a')*32 + atoi(p+4) )
 
 
/*+-----------------------------------------------------+
 *|  GPIO PortA:  PA0~PA31 defined as "pioA0"-"pioA31"  |
 *+-----------------------------------------------------+*/
 
#define PA0                   PA(0)
#define PA1                   PA(1)
#define PA2                   PA(2)
#define PA3                   PA(3)
#define PA4                   PA(4)
#define PA5                   PA(5)
#define PA6                   PA(6)
#define PA7                   PA(7)
#define PA8                   PA(8)
#define PA9                   PA(9)
#define PA10                  PA(10)
#define PA11                  PA(11)
#define PA12                  PA(12)
#define PA13                  PA(13)
#define PA14                  PA(14)
#define PA15                  PA(15)
#define PA16                  PA(16)
#define PA17                  PA(17)
#define PA18                  PA(18)
#define PA19                  PA(19)
#define PA20                  PA(20)
#define PA21                  PA(21)
#define PA22                  PA(22)
#define PA23                  PA(23)
#define PA24                  PA(24)
#define PA25                  PA(25)
#define PA26                  PA(26)
#define PA27                  PA(27)
#define PA28                  PA(28)
#define PA29                  PA(29)
#define PA30                  PA(30)
#define PA31                  PA(31)
 
 
/*+-----------------------------------------------------+
 *|  GPIO PortB:  PB0~PB31 defined as "pioB0"-"pioB31"  |
 *+-----------------------------------------------------+*/
 
#define PB0                   PB(0)
#define PB1                   PB(1)
#define PB2                   PB(2)
#define PB3                   PB(3)
#define PB4                   PB(4)
#define PB5                   PB(5)
#define PB6                   PB(6)
#define PB7                   PB(7)
#define PB8                   PB(8)
#define PB9                   PB(9)
#define PB10                  PB(10)
#define PB11                  PB(11)
#define PB12                  PB(12)
#define PB13                  PB(13)
#define PB14                  PB(14)
#define PB15                  PB(15)
#define PB16                  PB(16)
#define PB17                  PB(17)
#define PB18                  PB(18)
#define PB19                  PB(19)
#define PB20                  PB(20)
#define PB21                  PB(21)
#define PB22                  PB(22)
#define PB23                  PB(23)
#define PB24                  PB(24)
#define PB25                  PB(25)
#define PB26                  PB(26)
#define PB27                  PB(27)
#define PB28                  PB(28)
#define PB29                  PB(29)
#define PB30                  PB(30)
#define PB31                  PB(31)
 
/*+-----------------------------------------------------+
 *|  GPIO PortC:  PC0~PC31 defined as "pioC0"-"pioC31"  |
 *+-----------------------------------------------------+*/
 
#define PC0                   PC(0)
#define PC1                   PC(1)
#define PC2                   PC(2)
#define PC3                   PC(3)
#define PC4                   PC(4)
#define PC5                   PC(5)
#define PC6                   PC(6)
#define PC7                   PC(7)
#define PC8                   PC(8)
#define PC9                   PC(9)
#define PC10                  PC(10)
#define PC11                  PC(11)
#define PC12                  PC(12)
#define PC13                  PC(13)
#define PC14                  PC(14)
#define PC15                  PC(15)
#define PC16                  PC(16)
#define PC17                  PC(17)
#define PC18                  PC(18)
#define PC19                  PC(19)
#define PC20                  PC(20)
#define PC21                  PC(21)
#define PC22                  PC(22)
#define PC23                  PC(23)
#define PC24                  PC(24)
#define PC25                  PC(25)
#define PC26                  PC(26)
#define PC27                  PC(27)
#define PC28                  PC(28)
#define PC29                  PC(29)
#define PC30                  PC(30)
#define PC31                  PC(31)
 
/*+-----------------------------------------------------+
 *|  GPIO PortD:  PD0~PD31 defined as "pioD0"-"pioD31"  |
 *+-----------------------------------------------------+*/
 
#define PD0                   PD(0)
#define PD1                   PD(1)
#define PD2                   PD(2)
#define PD3                   PD(3)
#define PD4                   PD(4)
#define PD5                   PD(5)
#define PD6                   PD(6)
#define PD7                   PD(7)
#define PD8                   PD(8)
#define PD9                   PD(9)
#define PD10                  PD(10)
#define PD11                  PD(11)
#define PD12                  PD(12)
#define PD13                  PD(13)
#define PD14                  PD(14)
#define PD15                  PD(15)
#define PD16                  PD(16)
#define PD17                  PD(17)
#define PD18                  PD(18)
#define PD19                  PD(19)
#define PD20                  PD(20)
#define PD21                  PD(21)
#define PD22                  PD(22)
#define PD23                  PD(23)
#define PD24                  PD(24)
#define PD25                  PD(25)
#define PD26                  PD(26)
#define PD27                  PD(27)
#define PD28                  PD(28)
#define PD29                  PD(29)
#define PD30                  PD(30)
#define PD31                  PD(31)
 
/*+-----------------------------------------------------+
 *|  GPIO PortE:  PE0~PE30 defined as "pioE0"-"pioE30"  |
 *+-----------------------------------------------------+*/
 
#define PE0                   PE(0)
#define PE1                   PE(1)
#define PE2                   PE(2)
#define PE3                   PE(3)
#define PE4                   PE(4)
#define PE5                   PE(5)
#define PE6                   PE(6)
#define PE7                   PE(7)
#define PE8                   PE(8)
#define PE9                   PE(9)
#define PE10                  PE(10)
#define PE11                  PE(11)
#define PE12                  PE(12)
#define PE13                  PE(13)
#define PE14                  PE(14)
#define PE15                  PE(15)
#define PE16                  PE(16)
#define PE17                  PE(17)
#define PE18                  PE(18)
#define PE19                  PE(19)
#define PE20                  PE(20)
#define PE21                  PE(21)
#define PE22                  PE(22)
#define PE23                  PE(23)
#define PE24                  PE(24)
#define PE25                  PE(25)
#define PE26                  PE(26)
#define PE27                  PE(27)
#define PE28                  PE(28)
#define PE29                  PE(29)
#define PE30                  PE(30)
 
 
#endif   /* ----- #ifndef _AT91_SYSGPIODEF_H_  ----- */