位址如下
U32 gChipBaseAddr = 0x1F203C00; U32 gPmSleepBaseAddr = 0x1F001C00; U32 gSarBaseAddr = 0x1F002800; U32 gRIUBaseAddr = 0x1F000000;
計算方式
#define MHal_CHIPTOP_REG(addr) (*(volatile U8 *)(gChipBaseAddr + (((addr) & ~1) << 1) + (addr & 1))) #define MHal_PM_SLEEP_REG(addr) (*(volatile U8 *)(gPmSleepBaseAddr + (((addr) & ~1) << 1) + (addr & 1))) #define MHal_SAR_GPIO_REG(addr) (*(volatile U8 *)(gSarBaseAddr + (((addr) & ~1) << 1) + (addr & 1))) #define MHal_RIU_REG(addr) (*(volatile U8 *)(gRIUBaseAddr + (((addr) & ~1) << 1) + (addr & 1)))
腳位 | 位址 | 位元 |
---|---|---|
GPIO0_PAD | PAD_GPIO0 | |
GPIO0_OEN | 0x103C00 | BIT5 |
GPIO0_OUT | 0x103C00 | BIT4 |
GPIO0_IN | 0x103C00 | BIT0 |
GPIO1_PAD | PAD_GPIO1 | |
GPIO1_OEN | 0x103C02 | BIT5 |
GPIO1_OUT | 0x103C02 | BIT4 |
GPIO1_IN | 0x103C02 | BIT0 |
GPIO2_PAD | PAD_GPIO2 | |
GPIO2_OEN | 0x103C04 | BIT5 |
GPIO2_OUT | 0x103C04 | BIT4 |
GPIO2_IN | 0x103C04 | BIT0 |
GPIO3_PAD | PAD_GPIO3 | |
GPIO3_OEN | 0x103C06 | BIT5 |
GPIO3_OUT | 0x103C06 | BIT4 |
GPIO3_IN | 0x103C06 | BIT0 |
GPIO4_PAD | PAD_GPIO4 | |
GPIO4_OEN | 0x103C08 | BIT5 |
GPIO4_OUT | 0x103C08 | BIT4 |
GPIO4_IN | 0x103C08 | BIT0 |
GPIO5_PAD | PAD_GPIO5 | |
GPIO5_OEN | 0x103C0A | BIT5 |
GPIO5_OUT | 0x103C0A | BIT4 |
GPIO5_IN | 0x103C0A | BIT0 |
GPIO6_PAD | PAD_GPIO6 | |
GPIO6_OEN | 0x103C0C | BIT5 |
GPIO6_OUT | 0x103C0C | BIT4 |
GPIO6_IN | 0x103C0C | BIT0 |
GPIO7_PAD | PAD_GPIO7 | |
GPIO7_OEN | 0x103C0E | BIT5 |
GPIO7_OUT | 0x103C0E | BIT4 |
GPIO7_IN | 0x103C0E | BIT0 |
GPIO8_PAD | PAD_GPIO8 | |
GPIO8_OEN | 0x103C10 | BIT5 |
GPIO8_OUT | 0x103C10 | BIT4 |
GPIO8_IN | 0x103C10 | BIT0 |
GPIO9_PAD | PAD_GPIO9 | |
GPIO9_OEN | 0x103C12 | BIT5 |
GPIO9_OUT | 0x103C12 | BIT4 |
GPIO9_IN | 0x103C12 | BIT0 |
GPIO10_PAD | PAD_GPIO10 | |
GPIO10_OEN | 0x103C14 | BIT5 |
GPIO10_OUT | 0x103C14 | BIT4 |
GPIO10_IN | 0x103C14 | BIT0 |
GPIO11_PAD | PAD_GPIO11 | |
GPIO11_OEN | 0x103C16 | BIT5 |
GPIO11_OUT | 0x103C16 | BIT4 |
GPIO11_IN | 0x103C16 | BIT0 |
GPIO12_PAD | PAD_GPIO12 | |
GPIO12_OEN | 0x103C18 | BIT5 |
GPIO12_OUT | 0x103C18 | BIT4 |
GPIO12_IN | 0x103C18 | BIT0 |
GPIO13_PAD | PAD_GPIO13 | |
GPIO13_OEN | 0x103C1A | BIT5 |
GPIO13_OUT | 0x103C1A | BIT4 |
GPIO13_IN | 0x103C1A | BIT0 |
GPIO14_PAD | PAD_GPIO14 | |
GPIO14_OEN | 0x103C1C | BIT5 |
GPIO14_OUT | 0x103C1C | BIT4 |
GPIO14_IN | 0x103C1C | BIT0 |
GPIO15_PAD | PAD_FUART_RX | |
GPIO15_OEN | 0x103C28 | BIT5 |
GPIO15_OUT | 0x103C28 | BIT4 |
GPIO15_IN | 0x103C28 | BIT0 |
GPIO16_PAD | PAD_FUART_TX | |
GPIO16_OEN | 0x103C2A | BIT5 |
GPIO16_OUT | 0x103C2A | BIT4 |
GPIO16_IN | 0x103C2A | BIT0 |
GPIO17_PAD | PAD_FUART_CTS | |
GPIO17_OEN | 0x103C2C | BIT5 |
GPIO17_OUT | 0x103C2C | BIT4 |
GPIO17_IN | 0x103C2C | BIT0 |
GPIO18_PAD | PAD_FUART_RTS | |
GPIO18_OEN | 0x103C2E | BIT5 |
GPIO18_OUT | 0x103C2E | BIT4 |
GPIO18_IN | 0x103C2E | BIT0 |
GPIO19_PAD | PAD_TTL0 | |
GPIO19_OEN | 0x103C40 | BIT5 |
GPIO19_OUT | 0x103C40 | BIT4 |
GPIO19_IN | 0x103C40 | BIT0 |
GPIO20_PAD | PAD_TTL1 | |
GPIO20_OEN | 0x103C42 | BIT5 |
GPIO20_OUT | 0x103C42 | BIT4 |
GPIO20_IN | 0x103C42 | BIT0 |
GPIO21_PAD | PAD_TTL2 | |
GPIO21_OEN | 0x103C44 | BIT5 |
GPIO21_OUT | 0x103C44 | BIT4 |
GPIO21_IN | 0x103C44 | BIT0 |
GPIO22_PAD | PAD_TTL3 | |
GPIO22_OEN | 0x103C46 | BIT5 |
GPIO22_OUT | 0x103C46 | BIT4 |
GPIO22_IN | 0x103C46 | BIT0 |
GPIO23_PAD | PAD_TTL4 | |
GPIO23_OEN | 0x103C48 | BIT5 |
GPIO23_OUT | 0x103C48 | BIT4 |
GPIO23_IN | 0x103C48 | BIT0 |
GPIO24_PAD | PAD_TTL5 | |
GPIO24_OEN | 0x103C4A | BIT5 |
GPIO24_OUT | 0x103C4A | BIT4 |
GPIO24_IN | 0x103C4A | BIT0 |
GPIO25_PAD | PAD_TTL6 | |
GPIO25_OEN | 0x103C4C | BIT5 |
GPIO25_OUT | 0x103C4C | BIT4 |
GPIO25_IN | 0x103C4C | BIT0 |
GPIO26_PAD | PAD_TTL7 | |
GPIO26_OEN | 0x103C4E | BIT5 |
GPIO26_OUT | 0x103C4E | BIT4 |
GPIO26_IN | 0x103C4E | BIT0 |
GPIO27_PAD | PAD_TTL8 | |
GPIO27_OEN | 0x103C50 | BIT5 |
GPIO27_OUT | 0x103C50 | BIT4 |
GPIO27_IN | 0x103C50 | BIT0 |
GPIO28_PAD | PAD_TTL9 | |
GPIO28_OEN | 0x103C52 | BIT5 |
GPIO28_OUT | 0x103C52 | BIT4 |
GPIO28_IN | 0x103C52 | BIT0 |
GPIO29_PAD | PAD_TTL10 | |
GPIO29_OEN | 0x103C54 | BIT5 |
GPIO29_OUT | 0x103C54 | BIT4 |
GPIO29_IN | 0x103C54 | BIT0 |
GPIO30_PAD | PAD_TTL11 | |
GPIO30_OEN | 0x103C56 | BIT5 |
GPIO30_OUT | 0x103C56 | BIT4 |
GPIO30_IN | 0x103C56 | BIT0 |
GPIO31_PAD | PAD_TTL12 | |
GPIO31_OEN | 0x103C58 | BIT5 |
GPIO31_OUT | 0x103C58 | BIT4 |
GPIO31_IN | 0x103C58 | BIT0 |
GPIO32_PAD | PAD_TTL13 | |
GPIO32_OEN | 0x103C5A | BIT5 |
GPIO32_OUT | 0x103C5A | BIT4 |
GPIO32_IN | 0x103C5A | BIT0 |
GPIO33_PAD | PAD_TTL14 | |
GPIO33_OEN | 0x103C5C | BIT5 |
GPIO33_OUT | 0x103C5C | BIT4 |
GPIO33_IN | 0x103C5C | BIT0 |
GPIO34_PAD | PAD_TTL15 | |
GPIO34_OEN | 0x103C5E | BIT5 |
GPIO34_OUT | 0x103C5E | BIT4 |
GPIO34_IN | 0x103C5E | BIT0 |
GPIO35_PAD | PAD_TTL16 | |
GPIO35_OEN | 0x103C60 | BIT5 |
GPIO35_OUT | 0x103C60 | BIT4 |
GPIO35_IN | 0x103C60 | BIT0 |
GPIO36_PAD | PAD_TTL17 | |
GPIO36_OEN | 0x103C62 | BIT5 |
GPIO36_OUT | 0x103C62 | BIT4 |
GPIO36_IN | 0x103C62 | BIT0 |
GPIO37_PAD | PAD_TTL18 | |
GPIO37_OEN | 0x103C64 | BIT5 |
GPIO37_OUT | 0x103C64 | BIT4 |
GPIO37_IN | 0x103C64 | BIT0 |
GPIO38_PAD | PAD_TTL19 | |
GPIO38_OEN | 0x103C66 | BIT5 |
GPIO38_OUT | 0x103C66 | BIT4 |
GPIO38_IN | 0x103C66 | BIT0 |
GPIO39_PAD | PAD_TTL20 | |
GPIO39_OEN | 0x103C68 | BIT5 |
GPIO39_OUT | 0x103C68 | BIT4 |
GPIO39_IN | 0x103C68 | BIT0 |
GPIO40_PAD | PAD_TTL21 | |
GPIO40_OEN | 0x103C6A | BIT5 |
GPIO40_OUT | 0x103C6A | BIT4 |
GPIO40_IN | 0x103C6A | BIT0 |
GPIO41_PAD | PAD_TTL22 | |
GPIO41_OEN | 0x103C6C | BIT5 |
GPIO41_OUT | 0x103C6C | BIT4 |
GPIO41_IN | 0x103C6C | BIT0 |
GPIO42_PAD | PAD_TTL23 | |
GPIO42_OEN | 0x103C6E | BIT5 |
GPIO42_OUT | 0x103C6E | BIT4 |
GPIO42_IN | 0x103C6E | BIT0 |
GPIO43_PAD | PAD_TTL24 | |
GPIO43_OEN | 0x103C70 | BIT5 |
GPIO43_OUT | 0x103C70 | BIT4 |
GPIO43_IN | 0x103C70 | BIT0 |
GPIO44_PAD | PAD_TTL25 | |
GPIO44_OEN | 0x103C72 | BIT5 |
GPIO44_OUT | 0x103C72 | BIT4 |
GPIO44_IN | 0x103C72 | BIT0 |
GPIO45_PAD | PAD_TTL26 | |
GPIO45_OEN | 0x103C74 | BIT5 |
GPIO45_OUT | 0x103C74 | BIT4 |
GPIO45_IN | 0x103C74 | BIT0 |
GPIO46_PAD | PAD_TTL27 | |
GPIO46_OEN | 0x103C76 | BIT5 |
GPIO46_OUT | 0x103C76 | BIT4 |
GPIO46_IN | 0x103C76 | BIT0 |
GPIO47_PAD | PAD_UART0_RX | |
GPIO47_OEN | 0x103C30 | BIT5 |
GPIO47_OUT | 0x103C30 | BIT4 |
GPIO47_IN | 0x103C30 | BIT0 |
GPIO48_PAD | PAD_UART0_TX | |
GPIO48_OEN | 0x103C32 | BIT5 |
GPIO48_OUT | 0x103C32 | BIT4 |
GPIO48_IN | 0x103C32 | BIT0 |
GPIO49_PAD | PAD_UART1_RX | |
GPIO49_OEN | 0x103C34 | BIT5 |
GPIO49_OUT | 0x103C34 | BIT4 |
GPIO49_IN | 0x103C34 | BIT0 |
GPIO50_PAD | PAD_UART1_TX | |
GPIO50_OEN | 0x103C36 | BIT5 |
GPIO50_OUT | 0x103C36 | BIT4 |
GPIO50_IN | 0x103C36 | BIT0 |
GPIO51_PAD | PAD_SD_CLK | |
GPIO51_OEN | 0x103CAA | BIT5 |
GPIO51_OUT | 0x103CAA | BIT4 |
GPIO51_IN | 0x103CAA | BIT0 |
GPIO52_PAD | PAD_SD_CMD | |
GPIO52_OEN | 0x103CA8 | BIT5 |
GPIO52_OUT | 0x103CA8 | BIT4 |
GPIO52_IN | 0x103CA8 | BIT0 |
GPIO53_PAD | PAD_SD_D0 | |
GPIO53_OEN | 0x103CA0 | BIT5 |
GPIO53_OUT | 0x103CA0 | BIT4 |
GPIO53_IN | 0x103CA0 | BIT0 |
GPIO54_PAD | PAD_SD_D1 | |
GPIO54_OEN | 0x103CA2 | BIT5 |
GPIO54_OUT | 0x103CA2 | BIT4 |
GPIO54_IN | 0x103CA2 | BIT0 |
GPIO55_PAD | PAD_SD_D2 | |
GPIO55_OEN | 0x103CA4 | BIT5 |
GPIO55_OUT | 0x103CA4 | BIT4 |
GPIO55_IN | 0x103CA4 | BIT0 |
GPIO56_PAD | PAD_SD_D3 | |
GPIO56_OEN | 0x103CA6 | BIT5 |
GPIO56_OUT | 0x103CA6 | BIT4 |
GPIO56_IN | 0x103CA6 | BIT0 |
GPIO57_PAD | PAD_SD_GPIO | |
GPIO57_OEN | 0x103CAC | BIT5 |
GPIO57_OUT | 0x103CAC | BIT4 |
GPIO57_IN | 0x103CAC | BIT0 |
GPIO58_PAD | PAD_PM_SD_CDZ | |
GPIO58_OEN | 0xF8E | BIT0 |
GPIO58_OUT | 0xF8E | BIT1 |
GPIO58_IN | 0xF8E | BIT2 |
GPIO59_PAD | PAD_PM_IRIN | |
GPIO59_OEN | 0xF28 | BIT0 |
GPIO59_OUT | 0xF28 | BIT1 |
GPIO59_IN | 0xF28 | BIT2 |
GPIO60_PAD | PADA_IDAC_OUT_B | |
GPIO60_OEN | 0x112724 | BIT0 |
GPIO60_OUT | 0x112750 | BIT0 |
GPIO60_IN | 0x112722 | BIT0 |
GPIO61_PAD | PADA_IDAC_OUT_G | |
GPIO61_OEN | 0x112724 | BIT1 |
GPIO61_OUT | 0x112750 | BIT1 |
GPIO61_IN | 0x112722 | BIT1 |
GPIO62_PAD | PADA_IDAC_OUT_R | |
GPIO62_OEN | 0x112724 | BIT2 |
GPIO62_OUT | 0x112750 | BIT2 |
GPIO62_IN | 0x112722 | BIT2 |
GPIO63_PAD | PAD_PM_SPI_CZ | |
GPIO63_OEN | 0xF30 | BIT0 |
GPIO63_OUT | 0xF30 | BIT1 |
GPIO63_IN | 0xF30 | BIT2 |
GPIO64_PAD | PAD_PM_SPI_CK | |
GPIO64_OEN | 0xF32 | BIT0 |
GPIO64_OUT | 0xF32 | BIT1 |
GPIO64_IN | 0xF32 | BIT2 |
GPIO65_PAD | PAD_PM_SPI_DI | |
GPIO65_OEN | 0xF34 | BIT0 |
GPIO65_OUT | 0xF34 | BIT1 |
GPIO65_IN | 0xF34 | BIT2 |
GPIO66_PAD | PAD_PM_SPI_DO | |
GPIO66_OEN | 0xF36 | BIT0 |
GPIO66_OUT | 0xF36 | BIT1 |
GPIO66_IN | 0xF36 | BIT2 |
GPIO67_PAD | PAD_PM_SPI_WPZ | |
GPIO67_OEN | 0xF88 | BIT0 |
GPIO67_OUT | 0xF88 | BIT1 |
GPIO67_IN | 0xF88 | BIT2 |
GPIO68_PAD | PAD_PM_SPI_HLD | |
GPIO68_OEN | 0xF8A | BIT0 |
GPIO68_OUT | 0xF8A | BIT1 |
GPIO68_IN | 0xF8A | BIT2 |
GPIO69_PAD | PAD_PM_LED0 | |
GPIO69_OEN | 0xF94 | BIT0 |
GPIO69_OUT | 0xF94 | BIT1 |
GPIO69_IN | 0xF94 | BIT2 |
GPIO70_PAD | PAD_PM_LED1 | |
GPIO70_OEN | 0xF96 | BIT0 |
GPIO70_OUT | 0xF96 | BIT1 |
GPIO70_IN | 0xF96 | BIT2 |
GPIO71_PAD | PAD_SAR_GPIO0 | |
GPIO71_OEN | 0x1423 | BIT0 |
GPIO71_OUT | 0x1424 | BIT0 |
GPIO71_IN | 0x1425 | BIT0 |
GPIO72_PAD | PAD_SAR_GPIO1 | |
GPIO72_OEN | 0x1423 | BIT1 |
GPIO72_OUT | 0x1424 | BIT1 |
GPIO72_IN | 0x1425 | BIT1 |
GPIO73_PAD | PAD_SAR_GPIO2 | |
GPIO73_OEN | 0x1423 | BIT2 |
GPIO73_OUT | 0x1424 | BIT2 |
GPIO73_IN | 0x1425 | BIT2 |
GPIO74_PAD | PAD_SAR_GPIO3 | |
GPIO74_OEN | 0x1423 | BIT3 |
GPIO74_OUT | 0x1424 | BIT3 |
GPIO74_IN | 0x1425 | BIT3 |
GPIO75_PAD | PAD_ETH_RN | |
GPIO75_OEN | 0x33E2 | BIT4 |
GPIO75_OUT | 0x33E4 | BIT0 |
GPIO75_IN | 0x33E4 | BIT4 |
GPIO76_PAD | PAD_ETH_RP | |
GPIO76_OEN | 0x33E2 | BIT5 |
GPIO76_OUT | 0x33E4 | BIT1 |
GPIO76_IN | 0x33E4 | BIT5 |
GPIO77_PAD | PAD_ETH_TN | |
GPIO77_OEN | 0x33E2 | BIT6 |
GPIO77_OUT | 0x33E4 | BIT2 |
GPIO77_IN | 0x33E4 | BIT6 |
GPIO78_PAD | PAD_ETH_TP | |
GPIO78_OEN | 0x33E2 | BIT7 |
GPIO78_OUT | 0x33E4 | BIT3 |
GPIO78_IN | 0x33E4 | BIT7 |
GPIO79_PAD | PAD_DM_P1 | |
GPIO79_OEN | 0x14210a | BIT4 |
GPIO79_OUT | 0x14210a | BIT2 |
GPIO79_IN | 0x142131 | BIT5 |
GPIO80_PAD | PAD_DP_P1 | |
GPIO80_OEN | 0x14210a | BIT5 |
GPIO80_OUT | 0x14210a | BIT3 |
GPIO80_IN | 0x142131 | BIT4 |
GPIO81_PAD | PAD_DM_P2 | |
GPIO81_OEN | 0x14250a | BIT4 |
GPIO81_OUT | 0x14250a | BIT2 |
GPIO81_IN | 0x142531 | BIT5 |
GPIO82_PAD | PAD_DP_P2 | |
GPIO82_OEN | 0x14250a | BIT5 |
GPIO82_OUT | 0x14250a | BIT3 |
GPIO82_IN | 0x142531 | BIT4 |
GPIO83_PAD | PAD_DM_P3 | |
GPIO83_OEN | 0x14290a | BIT4 |
GPIO83_OUT | 0x14290a | BIT2 |
GPIO83_IN | 0x142931 | BIT5 |
GPIO84_PAD | PAD_DP_P3 | |
GPIO84_OEN | 0x14290a | BIT5 |
GPIO84_OUT | 0x14290a | BIT3 |
GPIO84_IN | 0x142931 | BIT4 |
GPIO85_PAD | PAD_HSYNC_OUT | |
GPIO85_OEN | 0x103C80 | BIT5 |
GPIO85_OUT | 0x103C80 | BIT4 |
GPIO85_IN | 0x103C80 | BIT0 |
GPIO86_PAD | PAD_VSYNC_OUT | |
GPIO86_OEN | 0x103C82 | BIT5 |
GPIO86_OUT | 0x103C82 | BIT4 |
GPIO86_IN | 0x103C82 | BIT0 |
GPIO87_PAD | PAD_HDMITX_SCL | |
GPIO87_OEN | 0x103C84 | BIT5 |
GPIO87_OUT | 0x103C84 | BIT4 |
GPIO87_IN | 0x103C84 | BIT0 |
GPIO88_PAD | PAD_HDMITX_SDA | |
GPIO88_OEN | 0x103C86 | BIT5 |
GPIO88_OUT | 0x103C86 | BIT4 |
GPIO88_IN | 0x103C86 | BIT0 |
GPIO89_PAD | PAD_HDMITX_HPD | |
GPIO89_OEN | 0x103C88 | BIT5 |
GPIO89_OUT | 0x103C88 | BIT4 |
GPIO89_IN | 0x103C88 | BIT0 |
GPIO90_PAD | PAD_SATA_GPIO | |
GPIO90_OEN | 0x103C8A | BIT5 |
GPIO90_OUT | 0x103C8A | BIT4 |
GPIO90_IN | 0x103C8A | BIT0 |
例如:GPIO11_IN = (0x1f20782c & (1 << 0))
(*(volatile U8 *)(0x1F000000 + (((0x103C16) & ~1) << 1) + (0x103C16 & 1))) = 0x1f20782c