掌機 - Miyoo Mini Plus - GPIO Address



位址如下

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_PADPAD_GPIO0
GPIO0_OEN0x103C00BIT5
GPIO0_OUT0x103C00BIT4
GPIO0_IN0x103C00BIT0
GPIO1_PADPAD_GPIO1
GPIO1_OEN0x103C02BIT5
GPIO1_OUT0x103C02BIT4
GPIO1_IN0x103C02BIT0
GPIO2_PADPAD_GPIO2
GPIO2_OEN0x103C04BIT5
GPIO2_OUT0x103C04BIT4
GPIO2_IN0x103C04BIT0
GPIO3_PADPAD_GPIO3
GPIO3_OEN0x103C06BIT5
GPIO3_OUT0x103C06BIT4
GPIO3_IN0x103C06BIT0
GPIO4_PADPAD_GPIO4
GPIO4_OEN0x103C08BIT5
GPIO4_OUT0x103C08BIT4
GPIO4_IN0x103C08BIT0
GPIO5_PADPAD_GPIO5
GPIO5_OEN0x103C0ABIT5
GPIO5_OUT0x103C0ABIT4
GPIO5_IN0x103C0ABIT0
GPIO6_PADPAD_GPIO6
GPIO6_OEN0x103C0CBIT5
GPIO6_OUT0x103C0CBIT4
GPIO6_IN0x103C0CBIT0
GPIO7_PADPAD_GPIO7
GPIO7_OEN0x103C0EBIT5
GPIO7_OUT0x103C0EBIT4
GPIO7_IN0x103C0EBIT0
GPIO8_PADPAD_GPIO8
GPIO8_OEN0x103C10BIT5
GPIO8_OUT0x103C10BIT4
GPIO8_IN0x103C10BIT0
GPIO9_PADPAD_GPIO9
GPIO9_OEN0x103C12BIT5
GPIO9_OUT0x103C12BIT4
GPIO9_IN0x103C12BIT0
GPIO10_PADPAD_GPIO10
GPIO10_OEN0x103C14BIT5
GPIO10_OUT0x103C14BIT4
GPIO10_IN0x103C14BIT0
GPIO11_PADPAD_GPIO11
GPIO11_OEN0x103C16BIT5
GPIO11_OUT0x103C16BIT4
GPIO11_IN0x103C16BIT0
GPIO12_PADPAD_GPIO12
GPIO12_OEN0x103C18BIT5
GPIO12_OUT0x103C18BIT4
GPIO12_IN0x103C18BIT0
GPIO13_PADPAD_GPIO13
GPIO13_OEN0x103C1ABIT5
GPIO13_OUT0x103C1ABIT4
GPIO13_IN0x103C1ABIT0
GPIO14_PADPAD_GPIO14
GPIO14_OEN0x103C1CBIT5
GPIO14_OUT0x103C1CBIT4
GPIO14_IN0x103C1CBIT0
GPIO15_PADPAD_FUART_RX
GPIO15_OEN0x103C28BIT5
GPIO15_OUT0x103C28BIT4
GPIO15_IN0x103C28BIT0
GPIO16_PADPAD_FUART_TX
GPIO16_OEN0x103C2ABIT5
GPIO16_OUT0x103C2ABIT4
GPIO16_IN0x103C2ABIT0
GPIO17_PADPAD_FUART_CTS
GPIO17_OEN0x103C2CBIT5
GPIO17_OUT0x103C2CBIT4
GPIO17_IN0x103C2CBIT0
GPIO18_PADPAD_FUART_RTS
GPIO18_OEN0x103C2EBIT5
GPIO18_OUT0x103C2EBIT4
GPIO18_IN0x103C2EBIT0
GPIO19_PADPAD_TTL0
GPIO19_OEN0x103C40BIT5
GPIO19_OUT0x103C40BIT4
GPIO19_IN0x103C40BIT0
GPIO20_PADPAD_TTL1
GPIO20_OEN0x103C42BIT5
GPIO20_OUT0x103C42BIT4
GPIO20_IN0x103C42BIT0
GPIO21_PADPAD_TTL2
GPIO21_OEN0x103C44BIT5
GPIO21_OUT0x103C44BIT4
GPIO21_IN0x103C44BIT0
GPIO22_PADPAD_TTL3
GPIO22_OEN0x103C46BIT5
GPIO22_OUT0x103C46BIT4
GPIO22_IN0x103C46BIT0
GPIO23_PADPAD_TTL4
GPIO23_OEN0x103C48BIT5
GPIO23_OUT0x103C48BIT4
GPIO23_IN0x103C48BIT0
GPIO24_PADPAD_TTL5
GPIO24_OEN0x103C4ABIT5
GPIO24_OUT0x103C4ABIT4
GPIO24_IN0x103C4ABIT0
GPIO25_PADPAD_TTL6
GPIO25_OEN0x103C4CBIT5
GPIO25_OUT0x103C4CBIT4
GPIO25_IN0x103C4CBIT0
GPIO26_PADPAD_TTL7
GPIO26_OEN0x103C4EBIT5
GPIO26_OUT0x103C4EBIT4
GPIO26_IN0x103C4EBIT0
GPIO27_PADPAD_TTL8
GPIO27_OEN0x103C50BIT5
GPIO27_OUT0x103C50BIT4
GPIO27_IN0x103C50BIT0
GPIO28_PADPAD_TTL9
GPIO28_OEN0x103C52BIT5
GPIO28_OUT0x103C52BIT4
GPIO28_IN0x103C52BIT0
GPIO29_PADPAD_TTL10
GPIO29_OEN0x103C54BIT5
GPIO29_OUT0x103C54BIT4
GPIO29_IN0x103C54BIT0
GPIO30_PADPAD_TTL11
GPIO30_OEN0x103C56BIT5
GPIO30_OUT0x103C56BIT4
GPIO30_IN0x103C56BIT0
GPIO31_PADPAD_TTL12
GPIO31_OEN0x103C58BIT5
GPIO31_OUT0x103C58BIT4
GPIO31_IN0x103C58BIT0
GPIO32_PADPAD_TTL13
GPIO32_OEN0x103C5ABIT5
GPIO32_OUT0x103C5ABIT4
GPIO32_IN0x103C5ABIT0
GPIO33_PADPAD_TTL14
GPIO33_OEN0x103C5CBIT5
GPIO33_OUT0x103C5CBIT4
GPIO33_IN0x103C5CBIT0
GPIO34_PADPAD_TTL15
GPIO34_OEN0x103C5EBIT5
GPIO34_OUT0x103C5EBIT4
GPIO34_IN0x103C5EBIT0
GPIO35_PADPAD_TTL16
GPIO35_OEN0x103C60BIT5
GPIO35_OUT0x103C60BIT4
GPIO35_IN0x103C60BIT0
GPIO36_PADPAD_TTL17
GPIO36_OEN0x103C62BIT5
GPIO36_OUT0x103C62BIT4
GPIO36_IN0x103C62BIT0
GPIO37_PADPAD_TTL18
GPIO37_OEN0x103C64BIT5
GPIO37_OUT0x103C64BIT4
GPIO37_IN0x103C64BIT0
GPIO38_PADPAD_TTL19
GPIO38_OEN0x103C66BIT5
GPIO38_OUT0x103C66BIT4
GPIO38_IN0x103C66BIT0
GPIO39_PADPAD_TTL20
GPIO39_OEN0x103C68BIT5
GPIO39_OUT0x103C68BIT4
GPIO39_IN0x103C68BIT0
GPIO40_PADPAD_TTL21
GPIO40_OEN0x103C6ABIT5
GPIO40_OUT0x103C6ABIT4
GPIO40_IN0x103C6ABIT0
GPIO41_PADPAD_TTL22
GPIO41_OEN0x103C6CBIT5
GPIO41_OUT0x103C6CBIT4
GPIO41_IN0x103C6CBIT0
GPIO42_PADPAD_TTL23
GPIO42_OEN0x103C6EBIT5
GPIO42_OUT0x103C6EBIT4
GPIO42_IN0x103C6EBIT0
GPIO43_PADPAD_TTL24
GPIO43_OEN0x103C70BIT5
GPIO43_OUT0x103C70BIT4
GPIO43_IN0x103C70BIT0
GPIO44_PADPAD_TTL25
GPIO44_OEN0x103C72BIT5
GPIO44_OUT0x103C72BIT4
GPIO44_IN0x103C72BIT0
GPIO45_PADPAD_TTL26
GPIO45_OEN0x103C74BIT5
GPIO45_OUT0x103C74BIT4
GPIO45_IN0x103C74BIT0
GPIO46_PADPAD_TTL27
GPIO46_OEN0x103C76BIT5
GPIO46_OUT0x103C76BIT4
GPIO46_IN0x103C76BIT0
GPIO47_PADPAD_UART0_RX
GPIO47_OEN0x103C30BIT5
GPIO47_OUT0x103C30BIT4
GPIO47_IN0x103C30BIT0
GPIO48_PADPAD_UART0_TX
GPIO48_OEN0x103C32BIT5
GPIO48_OUT0x103C32BIT4
GPIO48_IN0x103C32BIT0
GPIO49_PADPAD_UART1_RX
GPIO49_OEN0x103C34BIT5
GPIO49_OUT0x103C34BIT4
GPIO49_IN0x103C34BIT0
GPIO50_PADPAD_UART1_TX
GPIO50_OEN0x103C36BIT5
GPIO50_OUT0x103C36BIT4
GPIO50_IN0x103C36BIT0
GPIO51_PADPAD_SD_CLK
GPIO51_OEN0x103CAABIT5
GPIO51_OUT0x103CAABIT4
GPIO51_IN0x103CAABIT0
GPIO52_PADPAD_SD_CMD
GPIO52_OEN0x103CA8BIT5
GPIO52_OUT0x103CA8BIT4
GPIO52_IN0x103CA8BIT0
GPIO53_PADPAD_SD_D0
GPIO53_OEN0x103CA0BIT5
GPIO53_OUT0x103CA0BIT4
GPIO53_IN0x103CA0BIT0
GPIO54_PADPAD_SD_D1
GPIO54_OEN0x103CA2BIT5
GPIO54_OUT0x103CA2BIT4
GPIO54_IN0x103CA2BIT0
GPIO55_PADPAD_SD_D2
GPIO55_OEN0x103CA4BIT5
GPIO55_OUT0x103CA4BIT4
GPIO55_IN0x103CA4BIT0
GPIO56_PADPAD_SD_D3
GPIO56_OEN0x103CA6BIT5
GPIO56_OUT0x103CA6BIT4
GPIO56_IN0x103CA6BIT0
GPIO57_PADPAD_SD_GPIO
GPIO57_OEN0x103CACBIT5
GPIO57_OUT0x103CACBIT4
GPIO57_IN0x103CACBIT0
GPIO58_PADPAD_PM_SD_CDZ
GPIO58_OEN0xF8EBIT0
GPIO58_OUT0xF8EBIT1
GPIO58_IN0xF8EBIT2
GPIO59_PADPAD_PM_IRIN
GPIO59_OEN0xF28BIT0
GPIO59_OUT0xF28BIT1
GPIO59_IN0xF28BIT2
GPIO60_PADPADA_IDAC_OUT_B
GPIO60_OEN0x112724BIT0
GPIO60_OUT0x112750BIT0
GPIO60_IN0x112722BIT0
GPIO61_PADPADA_IDAC_OUT_G
GPIO61_OEN0x112724BIT1
GPIO61_OUT0x112750BIT1
GPIO61_IN0x112722BIT1
GPIO62_PADPADA_IDAC_OUT_R
GPIO62_OEN0x112724BIT2
GPIO62_OUT0x112750BIT2
GPIO62_IN0x112722BIT2
GPIO63_PADPAD_PM_SPI_CZ
GPIO63_OEN0xF30BIT0
GPIO63_OUT0xF30BIT1
GPIO63_IN0xF30BIT2
GPIO64_PADPAD_PM_SPI_CK
GPIO64_OEN0xF32BIT0
GPIO64_OUT0xF32BIT1
GPIO64_IN0xF32BIT2
GPIO65_PADPAD_PM_SPI_DI
GPIO65_OEN0xF34BIT0
GPIO65_OUT0xF34BIT1
GPIO65_IN0xF34BIT2
GPIO66_PADPAD_PM_SPI_DO
GPIO66_OEN0xF36BIT0
GPIO66_OUT0xF36BIT1
GPIO66_IN0xF36BIT2
GPIO67_PADPAD_PM_SPI_WPZ
GPIO67_OEN0xF88BIT0
GPIO67_OUT0xF88BIT1
GPIO67_IN0xF88BIT2
GPIO68_PADPAD_PM_SPI_HLD
GPIO68_OEN0xF8ABIT0
GPIO68_OUT0xF8ABIT1
GPIO68_IN0xF8ABIT2
GPIO69_PADPAD_PM_LED0
GPIO69_OEN0xF94BIT0
GPIO69_OUT0xF94BIT1
GPIO69_IN0xF94BIT2
GPIO70_PADPAD_PM_LED1
GPIO70_OEN0xF96BIT0
GPIO70_OUT0xF96BIT1
GPIO70_IN0xF96BIT2
GPIO71_PADPAD_SAR_GPIO0
GPIO71_OEN0x1423BIT0
GPIO71_OUT0x1424BIT0
GPIO71_IN0x1425BIT0
GPIO72_PADPAD_SAR_GPIO1
GPIO72_OEN0x1423BIT1
GPIO72_OUT0x1424BIT1
GPIO72_IN0x1425BIT1
GPIO73_PADPAD_SAR_GPIO2
GPIO73_OEN0x1423BIT2
GPIO73_OUT0x1424BIT2
GPIO73_IN0x1425BIT2
GPIO74_PADPAD_SAR_GPIO3
GPIO74_OEN0x1423BIT3
GPIO74_OUT0x1424BIT3
GPIO74_IN0x1425BIT3
GPIO75_PADPAD_ETH_RN
GPIO75_OEN0x33E2BIT4
GPIO75_OUT0x33E4BIT0
GPIO75_IN0x33E4BIT4
GPIO76_PADPAD_ETH_RP
GPIO76_OEN0x33E2BIT5
GPIO76_OUT0x33E4BIT1
GPIO76_IN0x33E4BIT5
GPIO77_PADPAD_ETH_TN
GPIO77_OEN0x33E2BIT6
GPIO77_OUT0x33E4BIT2
GPIO77_IN0x33E4BIT6
GPIO78_PADPAD_ETH_TP
GPIO78_OEN0x33E2BIT7
GPIO78_OUT0x33E4BIT3
GPIO78_IN0x33E4BIT7
GPIO79_PADPAD_DM_P1
GPIO79_OEN0x14210aBIT4
GPIO79_OUT0x14210aBIT2
GPIO79_IN0x142131BIT5
GPIO80_PADPAD_DP_P1
GPIO80_OEN0x14210aBIT5
GPIO80_OUT0x14210aBIT3
GPIO80_IN0x142131BIT4
GPIO81_PADPAD_DM_P2
GPIO81_OEN0x14250aBIT4
GPIO81_OUT0x14250aBIT2
GPIO81_IN0x142531BIT5
GPIO82_PADPAD_DP_P2
GPIO82_OEN0x14250aBIT5
GPIO82_OUT0x14250aBIT3
GPIO82_IN0x142531BIT4
GPIO83_PADPAD_DM_P3
GPIO83_OEN0x14290aBIT4
GPIO83_OUT0x14290aBIT2
GPIO83_IN0x142931BIT5
GPIO84_PADPAD_DP_P3
GPIO84_OEN0x14290aBIT5
GPIO84_OUT0x14290aBIT3
GPIO84_IN0x142931BIT4
GPIO85_PADPAD_HSYNC_OUT
GPIO85_OEN0x103C80BIT5
GPIO85_OUT0x103C80BIT4
GPIO85_IN0x103C80BIT0
GPIO86_PADPAD_VSYNC_OUT
GPIO86_OEN0x103C82BIT5
GPIO86_OUT0x103C82BIT4
GPIO86_IN0x103C82BIT0
GPIO87_PADPAD_HDMITX_SCL
GPIO87_OEN0x103C84BIT5
GPIO87_OUT0x103C84BIT4
GPIO87_IN0x103C84BIT0
GPIO88_PADPAD_HDMITX_SDA
GPIO88_OEN0x103C86BIT5
GPIO88_OUT0x103C86BIT4
GPIO88_IN0x103C86BIT0
GPIO89_PADPAD_HDMITX_HPD
GPIO89_OEN0x103C88BIT5
GPIO89_OUT0x103C88BIT4
GPIO89_IN0x103C88BIT0
GPIO90_PADPAD_SATA_GPIO
GPIO90_OEN0x103C8ABIT5
GPIO90_OUT0x103C8ABIT4
GPIO90_IN0x103C8ABIT0

例如:GPIO11_IN = (0x1f20782c & (1 << 0))

(*(volatile U8 *)(0x1F000000 + (((0x103C16) & ~1) << 1) + (0x103C16 & 1))) = 0x1f20782c