GPIO 扩展接口
K1预留了一个40Pin的GPIO扩展接口,采用2.54双列直插的座子,方便爱好者们可以根据自己的需求连接外设,扩展出来不同的功能。我们的系统会将这些IO默认设置为一些特定功能,但是用户可 以通过软件的重新配置是这些通用的IO具备一些特殊的功能,因为这些IO都是多功能复用的引脚。
1.引脚定义
2.多功能引脚定义列表
所有的GPIO都可以设置成通用的输入或者输出,也能通过内核配置成更多功能。下面的表格给我们展示了各个GPIO的扩展功能。
https://developer.spacemit.com/documentation?token=An1vwTwKaigaXRkYfwmcznTXned
Pin Number | Function 0 | Function 1 | Function 2 | Function 3 | Function 4 | Function 5 | Function 6 | Function 7 |
---|---|---|---|---|---|---|---|---|
3 | GPIO[52] | R_SPI_RXD | R_UART1_RXD | R_PWM7 | I2C4_SDA | |||
5 | GPIO[51] | R_SPI_TXD | R_UART1_TXD | R_PWM6 | I2C4_SCL | |||
7 | PRI_TDI | GPIO[70] | AP_I2C2_SCL | DCLK <SPI_LCD> | UART5_TXD | |||
8 | GPIO[47] | R_UART0_TXD | R_CAN_TX0 | R_PWM8 | AP_I2C3_SCL | ONE_WIRE | ||
10 | GPIO[48] | R_UART0_RXD | R_CAN_RX0 | R_IR_RX | AP_I2C3_SDA | KP_MKOUT[2] | ||
11 | PRI_TMS | GPIO[71] | AP_I2C2_SDA | DCX/DOUT1 <SPI_LCD> | UART5_RXD | |||
12 | GPIO[74] | PWM9 | CS<SPI_LCD> | PCIe2_WAKEN | ||||
13 | PRI_TCK | GPIO[72] | UART9_TXD | DIN<SPI_LCD> | UART5_CTS_N | |||
15 | PRI_TDO | GPIO[73] | UART9_RXD | DOUT0 <SPI_LCD> | UART5_RTS_N | |||
16 | GPIO[91] | MN_CLK2 | VCXO_OUT | DSI_TE | R_I2C0_SCL | |||
18 | GPIO[92] | MN_CLK | PWM7 | R_I2C0_SDA | ||||
19 | GPIO[77] | SPI2_TXD | SPI3_TXD | AP_I2C3_SCL | UART8_CTS_N | R_PWM0 | KP_MKOUT[2] | |
20 | GPIO[49] | R_SPI_SCLK | R_UART1_CTS_N | R_PWM4 | R_I2C0_SCL | KP_MKIN[3] | ||
21 | GPIO[78] | SPI2_RXD | SPI3_RXD | AP_I2C3_SDA | UART8_RTS_N | R_PWM1 | KP_MKIN[3] | |
23 | GPIO[75] | SPI2_SCLK | SPI3_SCLK | CAN_TX0 | UART8_TXD | AP_I2C4_SCL | ||
24 | GPIO[76] | SPI2_FRM | SPI3_FRM | CAN_RX0 | UART8_RXD | AP_I2C4_SDA | ||
26 | GPIO[50] | R_SPI_FRM | R_UART1_RTS_N | R_PWM5 | R_I2C0_SDA | KP_MKOUT[3] | ||
27 | GPIO[39] | GMAC1_TX_D3 | I2C3_SDA | R_I2S3_LRCK | PWM9 | |||
28 | GPIO[38] | GMAC1_TX_D2 | I2C3_SCL | R_I2S3_SCLK | PWM8 | |||
29 | GPIO[29] | GMAC1_RXDV | UART1_TXD | PWM1 | PCIe0_PERSTN | |||
31 | GPIO[30] | GMAC1_RX_D0 | UART1_RXD | PWM2 | PCIe0_WAKEN | |||
32 | GPIO[34] | GMAC1_RX_D3 | UART4_RXD | PWM4 | PCIe1_CLKREQN | |||
33 | GPIO[31] | GMAC1_RX_D1 | UART1_CTS_N | 32K_OUT | PCIe0_CLKREQN | |||
35 | GPIO[32] | GMAC1_RX_CLK | UART1_RTS_N | MN_CLK | PCIe1_PERSTN | |||
36 | GPIO[35] | GMAC1_TX_D0 | UART4_CTS_N | PWM5 | PCIe2_PERSTN | |||
37 | GPIO[33] | GMAC1_RX_D2 | UART4_TXD | PWM3 | PCIe1_WAKEN | |||
38 | GPIO[46] | GMAC1_CLK_REF | PWM16 | |||||
40 | GPIO[37] | GMAC1_TX | PWM7 | PCIe2_CLKREQN |
备注:
电压
板子上所有的3.3V,5V和地都是不能配置的,剩下的所有引脚都是3.3V的,也就是说GPIO的输入和输出都是3.3V的,当然这些引脚从芯片端并不是3.3V,而是通过电平转换将所有的IO都转换成3.3V。
输入输出
GPIO的高电平设置为3.3V,低电平是0V。