lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /*******************************************************************************
|
| 2 | * Copyright by ZIXC Corporation.
|
| 3 | *
|
| 4 | * File Name: drvs_gpio.h
|
| 5 | * File Mark:
|
| 6 | * Description:
|
| 7 | * Others:
|
| 8 | * Version: v1.0
|
| 9 | * Author: zhangdongdong
|
| 10 | * Date: 2015-07-31
|
| 11 | * History 1:
|
| 12 | * Date:
|
| 13 | * Version:
|
| 14 | * Author:
|
| 15 | * Modification:
|
| 16 | * History 2:
|
| 17 | ********************************************************************************/
|
| 18 |
|
| 19 | #ifndef _DRVS_GPIO_H
|
| 20 | #define _DRVS_GPIO_H
|
| 21 | #include <common.h>
|
| 22 | #include <config.h>
|
| 23 |
|
| 24 | /****************************************************************************
|
| 25 | * Include files
|
| 26 | ****************************************************************************/
|
| 27 |
|
| 28 |
|
| 29 | /****************************************************************************
|
| 30 | * Macros
|
| 31 | ****************************************************************************/
|
| 32 | #define GPIO0 0
|
| 33 | #define GPIO1 1
|
| 34 | #define GPIO2 2
|
| 35 | #define GPIO3 3
|
| 36 | #define GPIO4 4
|
| 37 | #define GPIO5 5
|
| 38 | #define GPIO6 6
|
| 39 | #define GPIO7 7
|
| 40 | #define GPIO8 8
|
| 41 | #define GPIO9 9
|
| 42 | #define GPIO10 10
|
| 43 | #define GPIO11 11
|
| 44 | #define GPIO12 12
|
| 45 | #define GPIO13 13
|
| 46 | #define GPIO14 14
|
| 47 | #define GPIO15 15
|
| 48 | #define GPIO16 16
|
| 49 | #define GPIO17 17
|
| 50 | #define GPIO18 18
|
| 51 | #define GPIO19 19
|
| 52 | #define GPIO20 20
|
| 53 | #define GPIO21 21
|
| 54 | #define GPIO22 22
|
| 55 | #define GPIO23 23
|
| 56 | #define GPIO24 24
|
| 57 | #define GPIO25 25
|
| 58 | #define GPIO26 26
|
| 59 | #define GPIO27 27
|
| 60 | #define GPIO28 28
|
| 61 | #define GPIO29 29
|
| 62 | #define GPIO30 30
|
| 63 | #define GPIO31 31
|
| 64 | #define GPIO32 32
|
| 65 | #define GPIO33 33
|
| 66 | #define GPIO34 34
|
| 67 | #define GPIO35 35
|
| 68 | #define GPIO36 36
|
| 69 | #define GPIO37 37
|
| 70 | #define GPIO38 38
|
| 71 | #define GPIO39 39
|
| 72 | #define GPIO40 40
|
| 73 | #define GPIO41 41
|
| 74 | #define GPIO42 42
|
| 75 | #define GPIO43 43
|
| 76 | #define GPIO44 44
|
| 77 | #define GPIO45 45
|
| 78 | #define GPIO46 46
|
| 79 | #define GPIO47 47
|
| 80 | #define GPIO48 48
|
| 81 | #define GPIO49 49
|
| 82 | #define GPIO50 50
|
| 83 | #define GPIO51 51
|
| 84 | #define GPIO52 52
|
| 85 | #define GPIO53 53
|
| 86 | #define GPIO54 54
|
| 87 | #define GPIO55 55
|
| 88 | #define GPIO56 56
|
| 89 | #define GPIO57 57
|
| 90 | #define GPIO58 58
|
| 91 | #define GPIO59 59
|
| 92 | #define GPIO60 60
|
| 93 | #define GPIO61 61
|
| 94 | #define GPIO62 62
|
| 95 | #define GPIO63 63
|
| 96 | #define GPIO64 64
|
| 97 | #define GPIO65 65
|
| 98 | #define GPIO66 66
|
| 99 | #define GPIO67 67
|
| 100 | #define GPIO68 68
|
| 101 | #define GPIO69 69
|
| 102 | #define GPIO70 70
|
| 103 | #define GPIO71 71
|
| 104 | #define GPIO72 72
|
| 105 | #define GPIO73 73
|
| 106 | #define GPIO74 74
|
| 107 | #define GPIO75 75
|
| 108 | #define GPIO76 76
|
| 109 | #define GPIO77 77
|
| 110 | #define GPIO78 78
|
| 111 | #define GPIO79 79
|
| 112 | #define GPIO80 80
|
| 113 | #define GPIO81 81
|
| 114 | #define GPIO82 82
|
| 115 | #define GPIO83 83
|
| 116 | #define GPIO84 84
|
| 117 | #define GPIO85 85
|
| 118 | #define GPIO86 86
|
| 119 | #define GPIO87 87
|
| 120 | #define GPIO88 88
|
| 121 | #define GPIO89 89
|
| 122 | #define GPIO90 90
|
| 123 | #define GPIO91 91
|
| 124 | #define GPIO92 92
|
| 125 | #define GPIO93 93
|
| 126 | #define GPIO94 94
|
| 127 | #define GPIO95 95
|
| 128 | #define GPIO96 96
|
| 129 | #define GPIO97 97
|
| 130 | #define GPIO98 98
|
| 131 | #define GPIO99 99
|
| 132 | #define GPIO100 100
|
| 133 | #define GPIO101 101
|
| 134 | #define GPIO102 102
|
| 135 | #define GPIO103 103
|
| 136 | #define GPIO104 104
|
| 137 | #define GPIO105 105
|
| 138 | #define GPIO106 106
|
| 139 | #define GPIO107 107
|
| 140 | #define GPIO108 108
|
| 141 | #define GPIO109 109
|
| 142 | #define GPIO110 110
|
| 143 | #define GPIO111 111
|
| 144 | #define GPIO112 112
|
| 145 | #define GPIO113 113
|
| 146 | #define GPIO114 114
|
| 147 | #define GPIO115 115
|
| 148 | #define GPIO116 116
|
| 149 | #define GPIO117 117
|
| 150 | #define GPIO118 118
|
| 151 | #define GPIO119 119
|
| 152 | #define GPIO120 120
|
| 153 | #define GPIO121 121
|
| 154 | #define GPIO122 122
|
| 155 | #define GPIO123 123
|
| 156 | #define GPIO124 124
|
| 157 | #define GPIO125 125
|
| 158 | #define GPIO126 126
|
| 159 | #define GPIO127 127
|
| 160 | #define GPIO128 128
|
| 161 | #define GPIO129 129
|
| 162 | #define GPIO130 130
|
| 163 | #define GPIO131 131
|
| 164 | #define GPIO132 132
|
| 165 | #define GPIO133 133
|
| 166 | #define GPIO134 134
|
| 167 | #define GPIO135 135
|
| 168 |
|
| 169 | #define MAX_GPIO_NUM GPIO135
|
| 170 | #define INVLID_GPIO 0xffff
|
| 171 |
|
| 172 | /****************************************************************************
|
| 173 | * Types
|
| 174 | ****************************************************************************/
|
| 175 | typedef signed char SINT8;
|
| 176 | typedef unsigned char UINT8;
|
| 177 |
|
| 178 | typedef signed short SINT16;
|
| 179 | typedef unsigned short UINT16;
|
| 180 |
|
| 181 | typedef signed int SINT32;
|
| 182 | typedef unsigned int UINT32;
|
| 183 | typedef signed char CHAR;
|
| 184 |
|
| 185 | typedef enum{
|
| 186 | GPIO_IN = 101,
|
| 187 | GPIO_OUT = 102,
|
| 188 | }T_ZDrvGpio_IoDirection;
|
| 189 |
|
| 190 | typedef enum{
|
| 191 | GPIO_LOW = 201,
|
| 192 | GPIO_HIGH = 202,
|
| 193 | }T_ZDrvGpio_IoVal;
|
| 194 |
|
| 195 |
|
| 196 | typedef enum{
|
| 197 | GPIO_PULL_DOWN = 0x1,
|
| 198 | GPIO_NO_ACTION = 0x2,
|
| 199 | GPIO_PULL_UP = 0x3,
|
| 200 | }T_ZDrvGpio_PullUp;
|
| 201 |
|
| 202 | typedef enum
|
| 203 | {
|
| 204 | /*[31:24]:gpio_id [23:12]:level1_sel [11:0]:level2_sel*/
|
| 205 | GPIO0_GPIO0 = 0x00000000,
|
| 206 | GPIO0_NAND_WE = 0x00001000,
|
| 207 | GPIO0_LCD_OE_N = 0x00001001,
|
| 208 | GPIO1_GPIO1 = 0x01000000,
|
| 209 | GPIO1_NAND_CS0 = 0x01001000,
|
| 210 | GPIO1_LCD_CS_N = 0x01001001,
|
| 211 | GPIO2_GPIO2 = 0x02000000,
|
| 212 | GPIO2_NAND_READY = 0x02001000,
|
| 213 | GPIO2_LCD_RS = 0x02001001,
|
| 214 | GPIO3_GPIO3 = 0x03000000,
|
| 215 | GPIO3_NAND_CLE = 0x03001000,
|
| 216 | GPIO3_LCD_RESET_N = 0x03001001,
|
| 217 | GPIO4_GPIO4 = 0x04000000,
|
| 218 | GPIO4_NAND_ALE = 0x04001000,
|
| 219 | GPIO4_LCD_WE_N = 0x04001001,
|
| 220 | GPIO5_GPIO5 = 0x05000000,
|
| 221 | GPIO5_NAND_RE = 0x05001000,
|
| 222 | GPIO5_LCD_TE = 0x05001001,
|
| 223 | GPIO6_GPIO6 = 0x06000000,
|
| 224 | GPIO6_NAND_WRITE_PROTECT = 0x06001000,
|
| 225 | GPIO6_LCD_D0 = 0x06001001,
|
| 226 | GPIO7_GPIO7 = 0x07000000,
|
| 227 | GPIO7_NAND_DATA0 = 0x07001000,
|
| 228 | GPIO7_LCD_D1 = 0x07001001,
|
| 229 | GPIO8_GPIO8 = 0x08000000,
|
| 230 | GPIO8_NAND_DATA1 = 0x08001000,
|
| 231 | GPIO8_LCD_D2 = 0x08001001,
|
| 232 | GPIO9_GPIO9 = 0x09000000,
|
| 233 | GPIO9_NAND_DATA2 = 0x09001000,
|
| 234 | GPIO9_LCD_D3 = 0x09001001,
|
| 235 | GPIO10_GPIO10 = 0x0A000000,
|
| 236 | GPIO10_NAND_DATA3 = 0x0A001000,
|
| 237 | GPIO10_LCD_D4 = 0x0A001001,
|
| 238 | GPIO11_GPIO11 = 0x0B000000,
|
| 239 | GPIO11_NAND_DATA4 = 0x0B001000,
|
| 240 | GPIO11_LCD_D5 = 0x0B001001,
|
| 241 | GPIO12_GPIO12 = 0x0C000000,
|
| 242 | GPIO12_NAND_DATA5 = 0x0C001000,
|
| 243 | GPIO12_LCD_D6 = 0x0C001001,
|
| 244 | GPIO13_GPIO13 = 0x0D000000,
|
| 245 | GPIO13_NAND_DATA6 = 0x0D001000,
|
| 246 | GPIO13_LCD_D7 = 0x0D001001,
|
| 247 | GPIO14_GPIO14 = 0x0E000000,
|
| 248 | GPIO14_NAND_DATA7 = 0x0E001000,
|
| 249 | GPIO14_LCD_D8 = 0x0E001001,
|
| 250 | GPIO15_CLK_OUT0 = 0x0F000000,
|
| 251 | GPIO15_GPIO15 = 0x0F000001,
|
| 252 | GPIO16_GPIO16 = 0x10000000,
|
| 253 | GPIO16_CLK_OUT1 = 0x10000001,
|
| 254 | GPIO17_GPIO17 = 0x11000000,
|
| 255 | GPIO17_CLK_OUT2 = 0x11000001,
|
| 256 | GPIO17_TEST_CLK_OUT = 0x11000002,
|
| 257 | GPIO17_TDM_MCLK_OUT = 0x11001000,
|
| 258 | GPIO17_I2S0_MCLK_OUT = 0x11001001,
|
| 259 | GPIO17_I2S1_MCLK_OUT = 0x11001002,
|
| 260 | GPIO18_GPIO18 = 0x12000000,
|
| 261 | GPIO18_CLK_32K_OUT = 0x12000001,
|
| 262 | GPIO19_GPIO19 = 0x13000000,
|
| 263 | GPIO19_RMII_CLK_I = 0x13001000,
|
| 264 | GPIO20_GPIO20 = 0x14000000,
|
| 265 | GPIO20_RMII_CLK_O = 0x14001000,
|
| 266 | GPIO21_CLK_REQ0 = 0x15000000,
|
| 267 | GPIO21_GPIO21 = 0x15000001,
|
| 268 | GPIO22_CLK_REQ1 = 0x16000000,
|
| 269 | GPIO22_GPIO22 = 0x16000001,
|
| 270 | GPIO23_PWRCTRL = 0x17000000,
|
| 271 | GPIO23_GPIO23 = 0x17000001,
|
| 272 | GPIO24_GPIO24 = 0x18000000,
|
| 273 | GPIO25_GPIO25 = 0x19000000,
|
| 274 | GPIO25_SSP0_CS = 0x19001000,
|
| 275 | GPIO26_GPIO26 = 0x1A000000,
|
| 276 | GPIO26_SSP0_CLK = 0x1A001000,
|
| 277 | GPIO27_GPIO27 = 0x1B000000,
|
| 278 | GPIO27_SSP0_RXD = 0x1B001000,
|
| 279 | GPIO28_GPIO28 = 0x1C000000,
|
| 280 | GPIO28_SSP0_TXD = 0x1C001000,
|
| 281 | GPIO29_UART0_RXD = 0x1D000000,
|
| 282 | GPIO29_GPIO29 = 0x1D000001,
|
| 283 | GPIO29_UART0_TXD = 0x1D000002,
|
| 284 | GPIO29_FRAME_SYNC = 0x1D001000,
|
| 285 | GPIO29_TEST_PIN10 = 0x1D001001,
|
| 286 | GPIO30_UART0_TXD = 0x1E000000,
|
| 287 | GPIO30_GPIO30 = 0x1E000001,
|
| 288 | GPIO30_UART0_RXD = 0x1E000002,
|
| 289 | GPIO30_LTE_PRE_TX = 0x1E001000,
|
| 290 | GPIO30_TEST_PIN11 = 0x1E001001,
|
| 291 | GPIO31_UART0_CTS = 0x1F000000,
|
| 292 | GPIO31_GPIO31 = 0x1F000001,
|
| 293 | GPIO31_LTE_TPU_OUT3 = 0x1F001000,
|
| 294 | GPIO31_UART1_TXD = 0x1F001001,
|
| 295 | GPIO31_TEST_PIN12 = 0x1F001002,
|
| 296 | GPIO32_UART0_RTS = 0x20000000,
|
| 297 | GPIO32_GPIO32 = 0x20000001,
|
| 298 | GPIO32_LTE_TPU_OUT4 = 0x20001000,
|
| 299 | GPIO32_UART1_RXD = 0x20001001,
|
| 300 | GPIO33_GPIO33 = 0x21000000,
|
| 301 | GPIO33_UART1_RXD = 0x21001000,
|
| 302 | GPIO33_UART2_TXD = 0x21001001,
|
| 303 | GPIO33_UART2_RXD = 0x21001002,
|
| 304 | GPIO34_GPIO34 = 0x22000000,
|
| 305 | GPIO34_UART1_TXD = 0x22001000,
|
| 306 | GPIO34_UART2_RXD = 0x22001001,
|
| 307 | GPIO34_UART2_TXD = 0x22001002,
|
| 308 | GPIO35_GPIO35 = 0x23000000,
|
| 309 | GPIO35_I2S0_WS = 0x23001000,
|
| 310 | GPIO35_TEST_PIN0 = 0x23001001,
|
| 311 | GPIO35_TDM_FS = 0x23001002,
|
| 312 | GPIO36_GPIO36 = 0x24000000,
|
| 313 | GPIO36_I2S0_CLK = 0x24001000,
|
| 314 | GPIO36_TEST_PIN1 = 0x24001001,
|
| 315 | GPIO36_TDM_CLK = 0x24001002,
|
| 316 | GPIO37_GPIO37 = 0x25000000,
|
| 317 | GPIO37_I2S0_DIN = 0x25001000,
|
| 318 | GPIO37_TEST_PIN2 = 0x25001001,
|
| 319 | GPIO37_TDM_DATA_IN = 0x25001002,
|
| 320 | GPIO38_GPIO38 = 0x26000000,
|
| 321 | GPIO38_I2S0_DOUT = 0x26001000,
|
| 322 | GPIO38_TEST_PIN3 = 0x26001001,
|
| 323 | GPIO38_TDM_DATA_OUT = 0x26001002,
|
| 324 | GPIO39_GPIO39 = 0x27000000,
|
| 325 | GPIO39_I2S1_WS = 0x27001000,
|
| 326 | GPIO39_TEST_PIN4 = 0x27001001,
|
| 327 | GPIO39_TDM_FS = 0x27001002,
|
| 328 | GPIO39_PWM0 = 0x27001003,
|
| 329 | GPIO40_GPIO40 = 0x28000000,
|
| 330 | GPIO40_I2S1_CLK = 0x28001000,
|
| 331 | GPIO40_TEST_PIN5 = 0x28001001,
|
| 332 | GPIO40_TDM_CLK = 0x28001002,
|
| 333 | GPIO40_PWM1 = 0x28001003,
|
| 334 | GPIO41_GPIO41 = 0x29000000,
|
| 335 | GPIO41_I2S1_DIN = 0x29001000,
|
| 336 | GPIO41_TEST_PIN6 = 0x29001001,
|
| 337 | GPIO41_TDM_DATA_IN = 0x29001002,
|
| 338 | GPIO42_GPIO42 = 0x2A000000,
|
| 339 | GPIO42_I2S1_DOUT = 0x2A001000,
|
| 340 | GPIO42_TEST_PIN7 = 0x2A001001,
|
| 341 | GPIO42_TDM_DATA_OUT = 0x2A001002,
|
| 342 | GPIO43_SCL0 = 0x2B000000,
|
| 343 | GPIO43_GPIO43 = 0x2B000001,
|
| 344 | GPIO44_SDA0 = 0x2C000000,
|
| 345 | GPIO44_GPIO44 = 0x2C000001,
|
| 346 | GPIO45_GPIO45 = 0x2D000000,
|
| 347 | GPIO45_SCL1 = 0x2D001000,
|
| 348 | GPIO46_GPIO46 = 0x2E000000,
|
| 349 | GPIO46_SDA1 = 0x2E001000,
|
| 350 | GPIO47_GPIO47 = 0x2F000000,
|
| 351 | GPIO47_EXT_INT0 = 0x2F000001,
|
| 352 | GPIO48_GPIO48 = 0x30000000,
|
| 353 | GPIO48_EXT_INT1 = 0x30000001,
|
| 354 | GPIO49_GPIO49 = 0x31000000,
|
| 355 | GPIO49_EXT_INT2 = 0x31000001,
|
| 356 | GPIO50_GPIO50 = 0x32000000,
|
| 357 | GPIO50_EXT_INT3 = 0x32000001,
|
| 358 | GPIO50_TEST_PIN8 = 0x32001000,
|
| 359 | GPIO51_GPIO51 = 0x33000000,
|
| 360 | GPIO51_EXT_INT4 = 0x33000001,
|
| 361 | GPIO51_TEST_PIN9 = 0x33001000,
|
| 362 | GPIO52_GPIO52 = 0x34000000,
|
| 363 | GPIO52_EXT_INT5 = 0x34000001,
|
| 364 | GPIO52_TEST_PIN13 = 0x34001000,
|
| 365 | GPIO53_GPIO53 = 0x35000000,
|
| 366 | GPIO53_EXT_INT6 = 0x35000001,
|
| 367 | GPIO53_TEST_PIN14 = 0x35001000,
|
| 368 | GPIO54_GPIO54 = 0x36000000,
|
| 369 | GPIO54_EXT_INT7 = 0x36000001,
|
| 370 | GPIO54_TEST_PIN15 = 0x36001000,
|
| 371 | GPIO55_GPIO55 = 0x37000000,
|
| 372 | GPIO55_RMII_TXEN = 0x37001000,
|
| 373 | GPIO56_GPIO56 = 0x38000000,
|
| 374 | GPIO56_RMII_RXEN = 0x38001000,
|
| 375 | GPIO57_GPIO57 = 0x39000000,
|
| 376 | GPIO57_RMII_RXD0 = 0x39001000,
|
| 377 | GPIO58_GPIO58 = 0x3A000000,
|
| 378 | GPIO58_RMII_RXD1 = 0x3A001000,
|
| 379 | GPIO59_GPIO59 = 0x3B000000,
|
| 380 | GPIO59_RMII_TXD0 = 0x3B001000,
|
| 381 | GPIO60_GPIO60 = 0x3C000000,
|
| 382 | GPIO60_RMII_TXD1 = 0x3C001000,
|
| 383 | GPIO61_GPIO61 = 0x3D000000,
|
| 384 | GPIO61_MDC_SCLK = 0x3D001000,
|
| 385 | GPIO62_GPIO62 = 0x3E000000,
|
| 386 | GPIO62_MDC_SDIO = 0x3E001000,
|
| 387 | GPIO63_GPIO63 = 0x3F000000,
|
| 388 | GPIO63_PHY_RST = 0x3F001000,
|
| 389 | GPIO64_GPIO64 = 0x40000000,
|
| 390 | GPIO64_PHY_INT = 0x40001000,
|
| 391 | GPIO65_GPIO65 = 0x41000000,
|
| 392 | GPIO66_GPIO66 = 0x42000000,
|
| 393 | GPIO66_KEY_COL2 = 0x42000001,
|
| 394 | GPIO66_EMMC_CLK = 0x42001000,
|
| 395 | GPIO67_GPIO67 = 0x43000000,
|
| 396 | GPIO67_KEY_COL3 = 0x43000001,
|
| 397 | GPIO67_EMMC_CMD = 0x43001000,
|
| 398 | GPIO68_GPIO68 = 0x44000000,
|
| 399 | GPIO68_KEY_COL4 = 0x44000001,
|
| 400 | GPIO68_EMMC_DATA0 = 0x44001000,
|
| 401 | GPIO69_GPIO69 = 0x45000000,
|
| 402 | GPIO69_KEY_ROW2 = 0x45000001,
|
| 403 | GPIO69_EMMC_DATA1 = 0x45001000,
|
| 404 | GPIO70_GPIO70 = 0x46000000,
|
| 405 | GPIO70_KEY_ROW3 = 0x46000001,
|
| 406 | GPIO70_EMMC_DATA2 = 0x46001000,
|
| 407 |
|
| 408 | GPIO71_GPIO71 = 0x47000000,
|
| 409 | GPIO71_KEY_ROW4 = 0x47000001,
|
| 410 | GPIO71_EMMC_DATA3 = 0x47001000,
|
| 411 | GPIO72_GPIO72 = 0x48000000,
|
| 412 | GPIO72_SD1_HOST_SDCLK = 0x48001000,
|
| 413 | GPIO73_GPIO73 = 0x49000000,
|
| 414 | GPIO73_M_JTAG_TDO = 0x49000001,
|
| 415 | GPIO73_SD1_CMD = 0x49001000,
|
| 416 | GPIO73_PS_JTAG_TDO = 0x49001001,
|
| 417 | GPIO73_PHY_JTAG_TDO = 0x49001002,
|
| 418 | GPIO73_AP_JTAG_TDO = 0x49001003,
|
| 419 | GPIO74_GPIO74 = 0x4A000000,
|
| 420 | GPIO74_M_JTAG_TCK = 0x4A000001,
|
| 421 | GPIO74_SD1_DATA0 = 0x4A001000,
|
| 422 | GPIO74_PS_JTAG_TCK = 0x4A001001,
|
| 423 | GPIO74_PHY_JTAG_TCK = 0x4A001002,
|
| 424 | GPIO74_AP_JTAG_TCK = 0x4A001003,
|
| 425 | GPIO75_GPIO75 = 0x4B000000,
|
| 426 | GPIO75_M_JTAG_TRST = 0x4B000001,
|
| 427 | GPIO75_SD1_DATA1 = 0x4B001000,
|
| 428 | GPIO75_PS_JTAG_TRST = 0x4B001001,
|
| 429 | GPIO75_PHY_JTAG_TRST = 0x4B001002,
|
| 430 | GPIO75_AP_JTAG_TRST = 0x4B001003,
|
| 431 | GPIO76_GPIO76 = 0x4C000000,
|
| 432 | GPIO76_M_JTAG_TMS = 0x4C000001,
|
| 433 | GPIO76_SD1_DATA2 = 0x4C001000,
|
| 434 | GPIO76_PS_JTAG_TMS = 0x4C001001,
|
| 435 | GPIO76_PHY_JTAG_TMS = 0x4C001002,
|
| 436 | GPIO76_AP_JTAG_TMS = 0x4C001003,
|
| 437 | GPIO77_GPIO77 = 0x4D000000,
|
| 438 | GPIO77_M_JTAG_TDI = 0x4D000001,
|
| 439 | GPIO77_SD1_DATA3 = 0x4D001000,
|
| 440 | GPIO77_PS_JTAG_TDI = 0x4D001001,
|
| 441 | GPIO77_PHY_JTAG_TDI = 0x4D001002,
|
| 442 | GPIO77_AP_JTAG_TDI = 0x4D001003,
|
| 443 | GPIO78_M_JTAG_TCK = 0x4E000000,
|
| 444 | GPIO78_GPIO78 = 0x4E000001,
|
| 445 | GPIO78_PS_JTAG_TCK = 0x4E001000,
|
| 446 | GPIO78_PHY_JTAG_TCK = 0x4E001001,
|
| 447 | GPIO78_AP_JTAG_TCK = 0x4E001002,
|
| 448 | GPIO79_M_JTAG_TDI = 0x4F000000,
|
| 449 | GPIO79_GPIO79 = 0x4F000001,
|
| 450 | GPIO79_PS_JTAG_TDI = 0x4F001000,
|
| 451 | GPIO79_PHY_JTAG_TDI = 0x4F001001,
|
| 452 | GPIO79_AP_JTAG_TDI = 0x4F001002,
|
| 453 | GPIO80_M_JTAG_TDO = 0x50000000,
|
| 454 | GPIO80_GPIO80 = 0x50000001,
|
| 455 | GPIO80_PS_JTAG_TDO = 0x50001000,
|
| 456 | GPIO80_PHY_JTAG_TDO = 0x50001001,
|
| 457 | GPIO80_AP_JTAG_TDO = 0x50001002,
|
| 458 | GPIO81_M_JTAG_TMS = 0x51000000,
|
| 459 | GPIO81_GPIO81 = 0x51000001,
|
| 460 | GPIO81_PS_JTAG_TMS = 0x51001000,
|
| 461 | GPIO81_PHY_JTAG_TMS = 0x51001001,
|
| 462 | GPIO81_AP_JTAG_TMS = 0x51001002,
|
| 463 | GPIO82_M_JTAG_TRST = 0x52000000,
|
| 464 | GPIO82_GPIO82 = 0x52000001,
|
| 465 | GPIO82_PS_JTAG_TRST = 0x52001000,
|
| 466 | GPIO82_PHY_JTAG_TRST = 0x52001001,
|
| 467 | GPIO82_AP_JTAG_TRST = 0x52001002,
|
| 468 | GPIO83_KEY_COL0 = 0x53000000,
|
| 469 | GPIO83_GPIO83 = 0x53000001,
|
| 470 | GPIO84_KEY_COL1 = 0x54000000,
|
| 471 | GPIO84_GPIO84 = 0x54000001,
|
| 472 | GPIO85_KEY_ROW0 = 0x55000000,
|
| 473 | GPIO85_GPIO85 = 0x55000001,
|
| 474 | GPIO86_KEY_ROW1 = 0x56000000,
|
| 475 | GPIO86_GPIO86 = 0x56000001,
|
| 476 | GPIO87_GPIO87 = 0x57000000,
|
| 477 | GPIO87_CAM_SPI_CS = 0x57001000,
|
| 478 | GPIO88_GPIO88 = 0x58000000,
|
| 479 | GPIO88_CAM_SPI_CLK = 0x58001000,
|
| 480 | GPIO89_GPIO89 = 0x59000000,
|
| 481 | GPIO89_CAM_SPI_DATA0 = 0x59001000,
|
| 482 | GPIO90_GPIO90 = 0x5A000000,
|
| 483 | GPIO90_CAM_SPI_DATA1 = 0x5A001000,
|
| 484 | GPIO90_CAM_SPI_TXD = 0x5A001001,
|
| 485 | GPIO91_GPIO91 = 0x5B000000,
|
| 486 | GPIO91_CAM_SPI_DATA2 = 0x5B001000,
|
| 487 | GPIO92_GPIO92 = 0x5C000000,
|
| 488 | GPIO92_CAM_SPI_DATA3 = 0x5C001000,
|
| 489 | GPIO93_GPIO93 = 0x5D000000,
|
| 490 | GPIO93_SPIFC_CS = 0x5D001000,
|
| 491 | GPIO94_GPIO94 = 0x5E000000,
|
| 492 | GPIO94_SPIFC_CLK = 0x5E001000,
|
| 493 | GPIO95_GPIO95 = 0x5F000000,
|
| 494 | GPIO95_SPIFC_DATA0 = 0x5F001000,
|
| 495 | GPIO96_GPIO96 = 0x60000000,
|
| 496 | GPIO96_SPIFC_DATA1 = 0x60001000,
|
| 497 | GPIO97_GPIO97 = 0x61000000,
|
| 498 | GPIO97_SPIFC_DATA2 = 0x61001000,
|
| 499 | GPIO98_GPIO98 = 0x62000000,
|
| 500 | GPIO98_SPIFC_DATA3 = 0x62001000,
|
| 501 | GPIO99_GPIO99 = 0x63000000,
|
| 502 | GPIO100_GPIO100 = 0x64000000,
|
| 503 | GPIO100_RF_SPI_STR = 0x64001000,
|
| 504 | GPIO101_GPIO101 = 0x65000000,
|
| 505 | GPIO101_RF_SPI_CLK = 0x65001000,
|
| 506 | GPIO102_GPIO102 = 0x66000000,
|
| 507 | GPIO102_RF_SPI_DATA = 0x66001000,
|
| 508 | GPIO103_GPIO103 = 0x67000000,
|
| 509 | GPIO104_GPIO104 = 0x68000000,
|
| 510 | GPIO104_TD_G0_GPIO2 = 0x68001081,
|
| 511 | GPIO104_LTE_TPU_OUT0_5 = 0x68001009,
|
| 512 | GPIO104_W_G0_GPIO2 = 0x68001011,
|
| 513 | GPIO104_GSM_T_OUT_O_0 = 0x68001021,
|
| 514 | GPIO105_GPIO105 = 0x69000000,
|
| 515 | GPIO105_TD_G0_GPIO3 = 0x69001081,
|
| 516 | GPIO105_LTE_TPU_OUT0_6 = 0x69001009,
|
| 517 | GPIO105_W_G0_GPIO3 = 0x69001011,
|
| 518 | GPIO105_GSM_T_OUT_O_1 = 0x69001021,
|
| 519 | GPIO106_GPIO106 = 0x6A000000,
|
| 520 | GPIO106_TD_G0_GPIO4 = 0x6A001081,
|
| 521 | GPIO106_LTE_TPU_OUT0_7 = 0x6A001009,
|
| 522 | GPIO106_W_G0_GPIO4 = 0x6A001011,
|
| 523 | GPIO106_GSM_T_OUT_O_2 = 0x6A001021,
|
| 524 | GPIO107_GPIO107 = 0x6B000000,
|
| 525 | GPIO107_TD_G0_GPIO5 = 0x6B001081,
|
| 526 | GPIO107_LTE_TPU_OUT0_8 = 0x6B001009,
|
| 527 | GPIO107_W_G0_GPIO5 = 0x6B001011,
|
| 528 | GPIO107_GSM_T_OUT_O_3 = 0x6B001021,
|
| 529 | GPIO108_GPIO108 = 0x6C000000,
|
| 530 | GPIO108_TD_G0_GPIO6 = 0x6C001081,
|
| 531 | GPIO108_LTE_TPU_OUT0_9 = 0x6C001009,
|
| 532 | GPIO108_W_G0_GPIO6 = 0x6C001011,
|
| 533 | GPIO108_GSM_T_OUT_O_4 = 0x6C001021,
|
| 534 | GPIO109_GPIO109 = 0x6D000000,
|
| 535 | GPIO109_TD_G0_GPIO7 = 0x6D001081,
|
| 536 | GPIO109_LTE_TPU_OUT0_10 = 0x6D001009,
|
| 537 | GPIO109_W_G0_GPIO7 = 0x6D001011,
|
| 538 | GPIO109_GSM_T_OUT_O_5 = 0x6D001021,
|
| 539 | GPIO110_GPIO110 = 0x6E000000,
|
| 540 | GPIO110_TD_G0_GPIO8 = 0x6E001081,
|
| 541 | GPIO110_LTE_TPU_OUT0_11 = 0x6E001009,
|
| 542 | GPIO110_W_G0_GPIO8 = 0x6E001011,
|
| 543 | GPIO110_GSM_T_OUT_O_6 = 0x6E001021,
|
| 544 | GPIO111_GPIO111 = 0x6F000000,
|
| 545 | GPIO111_TD_G0_GPIO9 = 0x6F001081,
|
| 546 | GPIO111_LTE_TPU_OUT0_12 = 0x6F001009,
|
| 547 | GPIO111_W_G0_GPIO9 = 0x6F001011,
|
| 548 | GPIO111_GSM_T_OUT_O_7 = 0x6F001021,
|
| 549 | GPIO112_GPIO112 = 0x70000000,
|
| 550 | GPIO112_MIPI_RFFE_CLK0 = 0x70001006,
|
| 551 | GPIO112_TD_G0_GPIO10 = 0x70001081,
|
| 552 | GPIO112_LTE_TPU_OUT0_13 = 0x70001009,
|
| 553 | GPIO112_W_G0_GPIO10 = 0x70001011,
|
| 554 | GPIO112_GSM_T_OUT_O_8 = 0x70001021,
|
| 555 | GPIO113_GPIO113 = 0x71000000,
|
| 556 | GPIO113_MIPI_RFFE_DATA0 = 0x71001006,
|
| 557 | GPIO113_TD_G0_GPIO11 = 0x71001081,
|
| 558 | GPIO113_LTE_TPU_OUT0_14 = 0x71001009,
|
| 559 | GPIO113_W_G0_GPIO11 = 0x71001011,
|
| 560 | GPIO113_GSM_T_OUT_O_9 = 0x71001021,
|
| 561 | GPIO114_GPIO114 = 0x72000000,
|
| 562 | GPIO114_MIPI_RFFE_CLK1 = 0x72001006,
|
| 563 | GPIO114_ABB_I2C_SEL_PINMUX = 0x72000001,
|
| 564 | GPIO114_TD_G0_GPIO12 = 0x72001081,
|
| 565 | GPIO114_LTE_TPU_OUT0_15 = 0x72001009,
|
| 566 | GPIO114_W_G0_GPIO12 = 0x72001011,
|
| 567 | GPIO114_GSM_T_OUT_O_10 = 0x72001021,
|
| 568 | GPIO115_GPIO115 = 0x73000000,
|
| 569 | GPIO115_ABB_I2C_SDA_PINMUX = 0x73000001,
|
| 570 | GPIO115_MIPI_RFFE_DATA1 = 0x73001006,
|
| 571 | GPIO115_TD_G1_GPIO0 = 0x73001081,
|
| 572 | GPIO115_LTE_TPU_OUT1_0 = 0x73001009,
|
| 573 | GPIO115_W_G1_GPIO0 = 0x73001011,
|
| 574 | GPIO115_GSM_T_OUT_O_11 = 0x73001021,
|
| 575 |
|
| 576 | GPIO133_GPIO133 = 0x85000000,
|
| 577 | GPIO133_SIM1_RST = 0x85000001,
|
| 578 | GPIO133_TD_G1_GPIO1 = 0x85001081,
|
| 579 | GPIO133_LTE_TPU_OUT1_1 = 0x85001009,
|
| 580 | GPIO133_W_G1_GPIO1 = 0x85001011,
|
| 581 | GPIO133_GSM_T_OUT_O_12 = 0x85001021,
|
| 582 | GPIO134_GPIO134 = 0x86000000,
|
| 583 | GPIO134_SIM1_CLK = 0x86000001,
|
| 584 | GPIO134_TD_G1_GPIO2 = 0x86001081,
|
| 585 | GPIO134_LTE_TPU_OUT1_2 = 0x86001009,
|
| 586 | GPIO134_W_G1_GPIO2 = 0x86001011,
|
| 587 | GPIO134_GSM_T_OUT_O_13 = 0x86001021,
|
| 588 | GPIO135_GPIO135 = 0x87000000,
|
| 589 | GPIO135_SIM1_RST = 0x87000001,
|
| 590 | GPIO135_TD_G1_GPIO3 = 0x87001081,
|
| 591 | GPIO135_LTE_TPU_OUT1_3 = 0x87001009,
|
| 592 | GPIO135_W_G1_GPIO3 = 0x87001011,
|
| 593 | GPIO135_GSM_T_OUT_O_14 = 0x87001021,
|
| 594 | GPIO116_SIM_RST = 0x74000000,
|
| 595 | GPIO116_GPIO116 = 0x74000001,
|
| 596 | GPIO117_SIM_CLK = 0x75000000,
|
| 597 | GPIO117_GPIO117 = 0x75000001,
|
| 598 | GPIO118_SIM_DATA = 0x76000000,
|
| 599 | GPIO118_GPIO118 = 0x76000001,
|
| 600 | GPIO119_GPIO119 = 0x77000000,
|
| 601 | GPIO119_EXT_INT8 = 0x77000001,
|
| 602 | GPIO119_M_JTAG_TDO = 0x77000002,
|
| 603 | GPIO119_URAT0_RTS = 0x77000003,
|
| 604 | GPIO119_PSJTAG_TDO = 0x77001000,
|
| 605 | GPIO119_PHYJTAG_TDO = 0x77001001,
|
| 606 | GPIO119_APJTAG_TDO = 0x77001002,
|
| 607 | GPIO119_PWM0 = 0x77001003,
|
| 608 | GPIO120_GPIO120 = 0x78000000,
|
| 609 | GPIO120_EXT_INT9 = 0x78000001,
|
| 610 | GPIO120_M_JTAG_TCK = 0x78000002,
|
| 611 | GPIO120_UART0_CTS = 0x78000003,
|
| 612 | GPIO120_PSJTAG_TCK = 0x78001000,
|
| 613 | GPIO120_PHYJTAG_TCK = 0x78001001,
|
| 614 | GPIO120_APJTAG_TCK = 0x78001002,
|
| 615 | GPIO120_PWM1 = 0x78001003,
|
| 616 | GPIO121_GPIO121 = 0x79000000,
|
| 617 | GPIO121_EXT_INT10 = 0x79000001,
|
| 618 | GPIO121_M_JTAG_TRST = 0x79000002,
|
| 619 | GPIO121_PSJTAG_TRST = 0x79001000,
|
| 620 | GPIO121_PHYJTAG_TRST = 0x79001001,
|
| 621 | GPIO121_APJTAG_TRST = 0x79001002,
|
| 622 | GPIO121_UART2_RXD = 0x79001003,
|
| 623 | GPIO122_GPIO122 = 0x7A000000,
|
| 624 | GPIO122_EXT_INT11 = 0x7A000001,
|
| 625 | GPIO122_M_JTAG_TMS = 0x7A000002,
|
| 626 | GPIO122_PSJTAG_TMS = 0x7A001000,
|
| 627 | GPIO122_PHYJTAG_TMS = 0x7A001001,
|
| 628 | GPIO122_APJTAG_TMS = 0x7A001002,
|
| 629 | GPIO122_UART2_TXD = 0x7A001003,
|
| 630 | GPIO123_GPIO123 = 0x7B000000,
|
| 631 | GPIO123_EXT_INT12 = 0x7B000001,
|
| 632 | GPIO123_M_JTAG_TDI = 0x7B000002,
|
| 633 | GPIO123_PSJTAG_TDI = 0x7B001000,
|
| 634 | GPIO123_PHYJTAG_TDI = 0x7B001001,
|
| 635 | GPIO123_APJTAG_TDI = 0x7B001002,
|
| 636 | GPIO123_UART2_RTS = 0x7B001003,
|
| 637 | GPIO124_GPIO124 = 0x7C000000,
|
| 638 | GPIO124_EXT_INT13 = 0x7C000001,
|
| 639 | GPIO124_UART2_CTS = 0x7C001000,
|
| 640 | GPIO125_GPIO125 = 0x7D000000,
|
| 641 | GPIO125_EXT_INT14 = 0x7D000001,
|
| 642 | GPIO125_UART1_RTS = 0x7D001000,
|
| 643 | GPIO126_GPIO126 = 0x7E000000,
|
| 644 | GPIO126_EXT_INT15 = 0x7E000001,
|
| 645 | GPIO126_KEY_COL2 = 0x7E000002,
|
| 646 | GPIO126_UART1_CTS = 0x7E001000,
|
| 647 | GPIO127_GPIO127 = 0x7F000000,
|
| 648 | GPIO127_EXT_INT8 = 0x7F000001,
|
| 649 | GPIO127_KEY_COL3 = 0x7F000002,
|
| 650 | GPIO128_GPIO128 = 0x80000000,
|
| 651 | GPIO128_EXT_INT9 = 0x80000001,
|
| 652 | GPIO128_KEY_COL4 = 0x80000002,
|
| 653 | GPIO129_GPIO129 = 0x81000000,
|
| 654 | GPIO129_EXT_INT10 = 0x81000001,
|
| 655 | GPIO129_KEY_COL5 = 0x81000002,
|
| 656 | GPIO130_GPIO130 = 0x82000000,
|
| 657 | GPIO130_EXT_INT11 = 0x82000001,
|
| 658 | GPIO130_KEY_ROW2 = 0x82000002,
|
| 659 | GPIO131_GPIO131 = 0x83000000,
|
| 660 | GPIO131_EXT_INT12 = 0x83000001,
|
| 661 | GPIO131_KEY_ROW3 = 0x83000002,
|
| 662 | GPIO132_GPIO132 = 0x84000000,
|
| 663 | GPIO132_EXT_INT13 = 0x84000001,
|
| 664 | GPIO132_KEY_ROW4 = 0x84000002,
|
| 665 |
|
| 666 |
|
| 667 | }T_ZDrvGpio_FuncSel;
|
| 668 |
|
| 669 |
|
| 670 | /****************************************************************************
|
| 671 | * Constants
|
| 672 | ****************************************************************************/
|
| 673 |
|
| 674 | /****************************************************************************
|
| 675 | * Global Variables
|
| 676 | ****************************************************************************/
|
| 677 |
|
| 678 | /****************************************************************************
|
| 679 | * Function Prototypes
|
| 680 | ****************************************************************************/
|
| 681 |
|
| 682 |
|
| 683 | /****************************************************************************
|
| 684 | * Function Definitions
|
| 685 | ****************************************************************************/
|
| 686 |
|
| 687 |
|
| 688 |
|
| 689 |
|
| 690 | /**************************************************************************
|
| 691 | * Functin: zDrvGpio_SetFunc
|
| 692 | * Description: set the pin use ,used as GPIO or other module,when use for GPIO
|
| 693 | * Parameters:
|
| 694 | * Input:
|
| 695 | * gpio_id: gpio id
|
| 696 | * func_sel: sel pd or aon func
|
| 697 | * Output:
|
| 698 | * NONE
|
| 699 | * Returns:
|
| 700 | * success or parameter fault
|
| 701 | * Others:
|
| 702 | * None.
|
| 703 | **************************************************************************/
|
| 704 | SINT32 zDrvGpio_SetFunc(UINT32 gpio_id, T_ZDrvGpio_FuncSel func_sel);
|
| 705 |
|
| 706 | /**************************************************************************
|
| 707 | * Functin: zDrvGpio_PullUpDown
|
| 708 | * Description: internal pull up or pull down
|
| 709 | * Parameters:
|
| 710 | * Input:
|
| 711 | * gpio_id: gpio id
|
| 712 | * value: pull up or down val
|
| 713 | * Output:
|
| 714 | * NONE
|
| 715 | * Returns:
|
| 716 | * success or parameter fault
|
| 717 | * Others:
|
| 718 | * None.
|
| 719 | **************************************************************************/
|
| 720 | SINT32 zDrvGpio_PullUpDown(UINT32 gpio_id, UINT32 val);
|
| 721 |
|
| 722 | /**************************************************************************
|
| 723 | * Functin: zDrvGpio_PullUpDown
|
| 724 | * Description: internal pull up or pull down
|
| 725 | * Parameters:
|
| 726 | * Input:
|
| 727 | * gpio_id: gpio id
|
| 728 | * value: pull up or down val
|
| 729 | * Output:
|
| 730 | * NONE
|
| 731 | * Returns:
|
| 732 | * success or parameter fault
|
| 733 | * Others:
|
| 734 | * None.
|
| 735 | **************************************************************************/
|
| 736 |
|
| 737 | void zDrvGpio_SetDirection(UINT32 gpio_id, T_ZDrvGpio_IoDirection value);
|
| 738 |
|
| 739 | /**************************************************************************
|
| 740 | * Functin: zDrvGpio_GetDirection
|
| 741 | * Description: get direction
|
| 742 | * Parameters:
|
| 743 | * Input:
|
| 744 | * gpio_id: gpio id
|
| 745 | * Output:
|
| 746 | * gpio input or output
|
| 747 | * Returns:
|
| 748 | *
|
| 749 | * Others:
|
| 750 | * None.
|
| 751 | **************************************************************************/
|
| 752 | T_ZDrvGpio_IoDirection zDrvGpio_GetDirection(UINT32 gpio_id);
|
| 753 |
|
| 754 |
|
| 755 | /**************************************************************************
|
| 756 | * Functin: zDrvGpio_SetOutputValue
|
| 757 | * Description: set output value
|
| 758 | * Parameters:
|
| 759 | * Input:
|
| 760 | * gpio_id: gpio id
|
| 761 | * value: high or low.
|
| 762 | * Output:
|
| 763 | * NONE
|
| 764 | * Returns:
|
| 765 | * success or parameter fault
|
| 766 | * Others:
|
| 767 | * None.
|
| 768 | **************************************************************************/
|
| 769 | void zDrvGpio_SetOutputValue(UINT32 gpio_id, T_ZDrvGpio_IoVal value);
|
| 770 |
|
| 771 | /**************************************************************************
|
| 772 | * Functin: zDrvGpio_GetOutputValue
|
| 773 | * Description: get output value
|
| 774 | * Parameters:
|
| 775 | * Input:
|
| 776 | * gpio_id: gpio id
|
| 777 | * Output:
|
| 778 | * output high or low
|
| 779 | * Returns:
|
| 780 | * NONE
|
| 781 | * Others:
|
| 782 | * None.
|
| 783 | **************************************************************************/
|
| 784 | T_ZDrvGpio_IoVal zDrvGpio_GetOutputValue(UINT32 gpio_id);
|
| 785 |
|
| 786 | /**************************************************************************
|
| 787 | * Functin: zDrvGpio_GetInputValue
|
| 788 | * Description: get input value
|
| 789 | * Parameters:
|
| 790 | * Input:
|
| 791 | * gpio_id: gpio id
|
| 792 | * Output:
|
| 793 | * input high or low
|
| 794 | * Returns:
|
| 795 | * NONE
|
| 796 | * Others:
|
| 797 | * None.
|
| 798 | **************************************************************************/
|
| 799 | T_ZDrvGpio_IoVal zDrvGpio_GetInputValue(UINT32 gpio_id);
|
| 800 |
|
| 801 |
|
| 802 | #endif
|