b.liu | 85565a7 | 2023-11-09 16:47:40 +0800 | [diff] [blame] | 1 | /** |
| 2 | * \file gpio-define.h |
| 3 | * \brief A Documented file. |
| 4 | * |
| 5 | * Detailed description |
| 6 | * \Author: Sniper <js.wang@mobiletek.cn> |
| 7 | * \Version: 1.0.0 |
| 8 | * \Date: 2022-04-26 |
| 9 | */ |
| 10 | |
| 11 | #ifndef __GPIO_DEFINE_H__ |
| 12 | #define __GPIO_DEFINE_H__ |
| 13 | |
| 14 | typedef unsigned int uint32; /* Unsigned 32 bit value */ |
| 15 | typedef unsigned short uint16; /* Unsigned 16 bit value */ |
| 16 | typedef unsigned char uint8; /* Unsigned 8 bit value */ |
| 17 | |
| 18 | |
| 19 | /* |
| 20 | 4组GPIO共128个GPIO,分别从GPIO_0到GPIO_127 |
| 21 | GPIO22位于0xd4019000这一组的BIT22 |
| 22 | |
| 23 | GPIO0_BASE 0xD4019000 |
| 24 | GPIO1_BASE 0xD4019004 |
| 25 | GPIO2_BASE 0xD4019008 |
| 26 | GPIO3_BASE 0xD4019100 |
| 27 | */ |
| 28 | /* |
| 29 | MMC_CMD GPIO_41 |
| 30 | MMC_DATA0 GPIO_40 |
| 31 | MMC_DATA1 GPIO_39 |
| 32 | MMC_DATA2 GPIO_38 |
| 33 | MMC_DATA3 GPIO_37 |
| 34 | |
| 35 | SD_DET GPIO_43 |
| 36 | WLAN_DAT3 GPIO_48 |
| 37 | |
| 38 | |
| 39 | */ |
| 40 | #define GPIO_FUNC_MMC1_DAT3 0xD401E094 |
| 41 | #define GPIO_FUNC_MMC1_DAT2 0xD401E098 |
| 42 | #define GPIO_FUNC_MMC1_DAT1 0xD401E09C |
| 43 | #define GPIO_FUNC_MMC1_DAT0 0xD401E0A0 |
| 44 | #define GPIO_FUNC_MMC1_CMD 0xD401E0A4 |
| 45 | #define GPIO_FUNC_MMC1_CLK 0xD401E0A8 |
| 46 | #define GPIO_FUNC_MMC1_CD 0xD401E0AC |
| 47 | #define GPIO_FUNC_USB_ID 0xD401E0B0 |
| 48 | #define GPIO_FUNC_PRI_TDI 0xD401E0B4 |
| 49 | #define GPIO_FUNC_PRI_TMS 0xD401E0B8 |
| 50 | #define GPIO_FUNC_PRI_TCK 0xD401E0BC |
| 51 | #define GPIO_FUNC_PRI_TDO 0xD401E0C0 |
| 52 | #define GPIO_FUNC_QSPI_VMODE_GPIO 0xD401E0C4 |
| 53 | #define GPIO_FUNC_VBUS_DRV 0xD401E0C8 |
| 54 | #define GPIO_FUNC_CLK_REQ 0xD401E0CC |
| 55 | #define GPIO_FUNC_VCXO_REQ 0xD401E0D4 |
| 56 | #define GPIO_FUNC_VCXO_OUT 0xD401E0D8 |
| 57 | #define GPIO_FUNC_GPIO_00 0xD401E0DC |
| 58 | #define GPIO_FUNC_GPIO_01 0xD401E0E0 |
| 59 | #define GPIO_FUNC_GPIO_02 0xD401E0E4 |
| 60 | #define GPIO_FUNC_GPIO_03 0xD401E0E8 |
| 61 | #define GPIO_FUNC_GPIO_04 0xD401E0EC |
| 62 | #define GPIO_FUNC_GPIO_05 0xD401E0F0 |
| 63 | #define GPIO_FUNC_GPIO_06 0xD401E0F4 |
| 64 | #define GPIO_FUNC_GPIO_07 0xD401E0F8 |
| 65 | #define GPIO_FUNC_GPIO_08 0xD401E0FC |
| 66 | #define GPIO_FUNC_GPIO_09 0xD401E100 |
| 67 | #define GPIO_FUNC_GPIO_10 0xD401E104 |
| 68 | #define GPIO_FUNC_GPIO_11 0xD401E108 |
| 69 | #define GPIO_FUNC_GPIO_12 0xD401E10C |
| 70 | #define GPIO_FUNC_GPIO_13 0xD401E110 |
| 71 | #define GPIO_FUNC_GPIO_14 0xD401E114 |
| 72 | #define GPIO_FUNC_GPIO_15 0xD401E118 |
| 73 | #define GPIO_FUNC_GPIO_16 0xD401E11C |
| 74 | #define GPIO_FUNC_GPIO_17 0xD401E120 |
| 75 | #define GPIO_FUNC_GPIO_18 0xD401E124 |
| 76 | #define GPIO_FUNC_GPIO_19 0xD401E128 |
| 77 | #define GPIO_FUNC_GPIO_20 0xD401E12C |
| 78 | #define GPIO_FUNC_GPIO_21 0xD401E130 |
| 79 | #define GPIO_FUNC_GPIO_22 0xD401E134 |
| 80 | #define GPIO_FUNC_GPIO_23 0xD401E138 |
| 81 | #define GPIO_FUNC_GPIO_24 0xD401E13C |
| 82 | #define GPIO_FUNC_GPIO_25 0xD401E140 |
| 83 | #define GPIO_FUNC_GPIO_26 0xD401E144 |
| 84 | #define GPIO_FUNC_GPIO_27 0xD401E148 |
| 85 | #define GPIO_FUNC_GPIO_28 0xD401E14C |
| 86 | #define GPIO_FUNC_GPIO_29 0xD401E150 |
| 87 | #define GPIO_FUNC_GPIO_30 0xD401E154 |
| 88 | #define GPIO_FUNC_GPIO_31 0xD401E158 |
| 89 | #define GPIO_FUNC_GPIO_32 0xD401E15C |
| 90 | #define GPIO_FUNC_GPIO_33 0xD401E160 |
| 91 | #define GPIO_FUNC_GPIO_34 0xD401E164 |
| 92 | #define GPIO_FUNC_GPIO_35 0xD401E168 |
| 93 | #define GPIO_FUNC_GPIO_36 0xD401E16C |
wangyouqiang | 7775cbf | 2023-12-29 16:35:24 +0800 | [diff] [blame] | 94 | #define GPIO_FUNC_GPIO_43 0xD401E188 |
| 95 | #define GPIO_FUNC_GPIO_44 0xD401E18C |
| 96 | #define GPIO_FUNC_GPIO_45 0xD401E190 |
| 97 | #define GPIO_FUNC_GPIO_46 0xD401E194 |
| 98 | #define GPIO_FUNC_GPIO_47 0xD401E198 |
| 99 | #define GPIO_FUNC_GPIO_48 0xD401E19C |
b.liu | 85565a7 | 2023-11-09 16:47:40 +0800 | [diff] [blame] | 100 | #define GPIO_FUNC_GPIO_49 0xD401E1A0 |
| 101 | #define GPIO_FUNC_GPIO_50 0xD401E1A4 |
| 102 | #define GPIO_FUNC_GPIO_51 0xD401E1A8 |
| 103 | #define GPIO_FUNC_GPIO_52 0xD401E1AC |
| 104 | #define GPIO_FUNC_GPIO_53 0xD401E1B0 |
| 105 | #define GPIO_FUNC_GPIO_54 0xD401E1B4 |
| 106 | #define GPIO_FUNC_DVL_0 0xD401E2B4 |
| 107 | #define GPIO_FUNC_DVL_1 0xD401E2B8 |
| 108 | #define GPIO_FUNC_GPIO_69 0xD401E2BC |
| 109 | #define GPIO_FUNC_GPIO_70 0xD401E2C0 |
| 110 | #define GPIO_FUNC_QSPI_DAT3 0xD401E2C4 |
| 111 | #define GPIO_FUNC_QSPI_DAT2 0xD401E2C8 |
| 112 | #define GPIO_FUNC_QSPI_DAT1 0xD401E2CC |
| 113 | #define GPIO_FUNC_QSPI_DAT0 0xD401E2D0 |
| 114 | #define GPIO_FUNC_QSPI_CLK 0xD401E2D4 |
| 115 | #define GPIO_FUNC_QSPI_CS1 0xD401E2D8 |
| 116 | #define GPIO_FUNC_GPIO_77 0xD401E2DC |
| 117 | #define GPIO_FUNC_GPIO_78 0xD401E2E0 |
| 118 | #define GPIO_FUNC_GPIO_79 0xD401E2E4 |
| 119 | #define GPIO_FUNC_GPIO_80 0xD401E2E8 |
| 120 | #define GPIO_FUNC_SDIO_DAT3 0xD401E2EC |
| 121 | #define GPIO_FUNC_SDIO_DAT2 0xD401E2F0 |
| 122 | #define GPIO_FUNC_SDIO_DAT1 0xD401E2F4 |
| 123 | #define GPIO_FUNC_SDIO_DAT0 0xD401E2F8 |
| 124 | #define GPIO_FUNC_SDIO_CMD 0xD401E2FC |
| 125 | #define GPIO_FUNC_SDIO_CLK 0xD401E300 |
| 126 | #define GPIO_FUNC_GPIO_60 0xD401E304 |
| 127 | #define GPIO_FUNC_USIM_UCLK 0xD401E320 |
| 128 | #define GPIO_FUNC_USIM_UIO 0xD401E324 |
| 129 | #define GPIO_FUNC_USIM_URSTn 0xD401E328 |
| 130 | |
wangyouqiang | 7775cbf | 2023-12-29 16:35:24 +0800 | [diff] [blame] | 131 | #define MMC1_DAT3 0x |
| 132 | |
| 133 | |
b.liu | 85565a7 | 2023-11-09 16:47:40 +0800 | [diff] [blame] | 134 | |
| 135 | #define GPIO0_BASE 0xD4019000 |
| 136 | #define GPIO1_BASE 0xD4019004 |
| 137 | #define GPIO2_BASE 0xD4019008 |
| 138 | #define GPIO3_BASE 0xD4019100 |
| 139 | |
| 140 | struct gpio_register_function |
| 141 | { |
| 142 | int reg; |
| 143 | int func_gpio; // 第 [func_gpio] 功能为 GPIO |
| 144 | }; |
| 145 | |
| 146 | typedef struct |
| 147 | { |
| 148 | uint16 output_pin; |
| 149 | uint16 input_pin; |
| 150 | uint8 mbtk_gpio_test_result; // 0 is pass, 1 is low failed, 2 is high failed |
| 151 | }mbtk_gpio_test_pin_paired; |
| 152 | |
| 153 | |
| 154 | #endif /*__GPIO_DEFINE_H__*/ |
| 155 | |