ARM 域 PINMUX 设置

优质
小牛编辑
192浏览
2023-12-01

1.1. ARM域PINMUX设置

ARM域中有52个pin(id)可以配置,每个pin对应的function如下表所示:

idfunction0function1function2function3function4function5
0BTDAT00PD2PORT00
1BTDAT01PD2PORT01
2BTDAT02PD2PORT02
3BTDAT03PD2PORT03
4BTCLKINPD2PORT04
5BTRESETPD2PORT05
6BTCLKVSYNCPD2PORT06
7BTCLKHREFPD2PORT07
8BTCLKOUTPD2PORT08
9BTDAT04SDA2SPI1SCKPD2PORT09
10BTDAT05SCL2SPI1MOSIPD2PORT10
11BTDAT06UART2RXSPI1CSnPD2PORT11
12BTDAT07UART2TXSPI1MISONUARTTXAUARTTXPD2PORT12
13BTDAT08PD2PORT13
14BTDAT09PD2PORT14
15BTDAT10PD2PORT15
16BTDAT11PD2PORT16
17BTDAT12PD2PORT17
18BTDAT13PD2PORT18
19BTDAT14PD2PORT19
20BTDAT15PD2PORT20
21UART3RXSD1CDnSDA3PD2PORT21
22UART3TXSD1DAT1SCL3PD2PORT22
23DBGTDISD1DAT0SPI2SCKPD2PORT23
24DBGTDOSD1CLKSPI2MOSIPD2PORT24
25DBGTMSSD1CMDSPI2CSnPD2PORT25
26DBGTCKSD1DAT3SPI2MISOPD2PORT26
27DBGTRSTSD1DAT2PD2PORT27
28UART2RXSDA2PD2PORT28
29UART2TXSCL2PD2PORT29
30SPI1SCKNDBGTDIADBGTDIPD2PORT30
31SPI1MOSINDBGTDOADBGTDOPD2PORT31
32SPI1CSnNDBGTMSADBGTMSPD2PORT32
33SPI1MISONDBGTCKADBGTCKPD2PORT33
34SPI2SCKNDBGTRSTADBGTRSTPD2PORT34
35SPI2MOSIPD2PORT35
36SPI2CSnPD2PORT36
37SPI2MISOPD2PORT37
38SD0CDnPD2PORT38
39SD0DAT1PD2PORT39
40SD0DAT0PD2PORT40
41SD0CLKPD2PORT41
42SD0CMDPD2PORT42
43SD0DAT3PD2PORT43
44SD0DAT2PD2PORT44
45SD1CDnPD2PORT45
46SD1DAT1PD2PORT46
47SD1DAT0PD2PORT47
48SD1CLKPD2PORT48
49SD1CMDPD2PORT49
50SD1DAT3PD2PORT50
51SD1DAT2PD2PORT51

ARM域的PINMUX设置统一在如下的数组中:

$(K18DIR)/uboot/board/nationalchip/leo_k18_universal/pinmux.c

static const struct pin_config pin_table[] = {

/ id |func function0 | function1 | function2 | function3 | function4 | function5 /

{ 0, 1}, // BTDAT00 | PD2PORT00

{ 1, 1}, // BTDAT01 | PD2PORT01

{ 2, 1}, // BTDAT02 | PD2PORT02

{ 3, 1}, // BTDAT03 | PD2PORT03

{49, 0}, // SD1CMD | PD2PORT49

{50, 0}, // SD1DAT3 | PD2PORT50

{51, 0}, // SD1DAT2 | PD2PORT51

};

配置表中的第一列表示芯片的port口,第二列表示port口的功能,根据硬件给出的管脚复用表,对应修改每个port口的功能即可。