MCU Domain PINMUX Setup

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

1.1. MCU Domain PINMUX Setup

MCU domain has 34 pins(id)which can be setup. Every pin has its own functions accordingly as the below table:

idfunction0function1function2function3function4
1POWERDOWNPD1PORT01
2UART0RXPD1PORT02
3UART0TXPD1PORT03
4OTPAVDDENPD1PORT04
5SDBGTDIDDBGTDISNDBGTDIPD1PORT05
6SDBGTDODDBGTDOSNDBGTDOPD1PORT06
7SDBGTMSDDBGTMSSNDBGTMSPCM1INBCLKPD1PORT07
8SDBGTCKDDBGTCKSNDBGTCKPCM1INLRCKPD1PORT08
9SDBGTRSTDDBGTRSTSNBGTRSTPCM1INDAT0PD1PORT09
11PCM1INBCLKPD1PORT11
12PCM1INLRCKPD1PORT12
13PCM1INDAT0PD1PORT13
14PCMOUTMCLKDUARTTXSNUARTTXPD1PORT14
15PCMOUTDAT0SPDIFPD1PORT15
16PCMOUTLRCKPD1PORT16
17PCMOUTBCLKPD1PORT17
18UART1RXPD1PORT18
19UART1TXPD1PORT19
20DDBGTDISNDBGTDIPD1PORT20
21DDBGTDOSNDBGTDOPD1PORT21
22DDBGTMSSNDBGTMSPD1PORT22
23DDBGTCKSNDBGTCKPD1PORT23
24DDBGTRSTSNDBGTRSTPD1PORT24
25DUARTTXSNUARTTXPD1PORT25
26SDA0PD1PORT26
27SCL0PD1PORT27
28SDA1PD1PORT28
29SCL1PD1PORT29
30PCM0INDAT1PDMDAT3PD1PORT30
31PCM0INDAT0PDMDAT2PD1PORT31
32PCM0INMCLKPDMDAT1PD1PORT32
33PCM0INLRCKPDMDAT0PCM0OUTLRCKPD1PORT33
34PCM0INBCLKPDMCLKPCM0OUTBCLKPD1PORT34
35IRPD1PORT35

The PINMUX in MCU domain is setup in the below code:

$(K18DIR)/vsp/mcu/board/nationalchip/leo_k18_universal/misc_board.c

static const PADMUX_PAD_CONFIG _pad_configs[] = {

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

{ 1, 0}, // POWERDOWN | PD1PORT01 |

{ 2, 0}, // UART0RX | PD1PORT02 |

{ 3, 0}, // UART0TX | PD1PORT03 |

{33, 1}, // PCM0INLRCK | PDMDAT0 | PCM0OUTLRCK | PD1PORT33

{34, 1}, // PCM0INBCLK | PDMCLK | PCM0OUTBCLK | PD1PORT34

{35, 1}, // IR | PD1PORT35

};

The first column stands for K18 MCU port id. The other columns stand for the port functions. According to K18 spec, PINMUX table show every MCU port functions accordingly.