嗯 已经搞定了 在用M0518的时候, 其实利用nuvoton的 pinconfig工具就好了 自动生产代码 ,
自动一个引脚去设置还是比较麻烦.
//If the defines do not exist in your project, please refer to the related sys.h in the sys_h folder appended to the tool package.
SYS->ALT_MFP = 0x00000000;
SYS->ALT_MFP2 = 0x00000000;
SYS->ALT_MFP3 = 0x00000000;
SYS->ALT_MFP4 = SYS_ALT_MFP4_PA3_UART3_RXD | SYS_ALT_MFP4_PA2_UART3_TXD |
SYS_ALT_MFP4_PA1_UART5_RXD | SYS_ALT_MFP4_PA0_UART5_TXD;
SYS->GPA_MFP = SYS_GPA_MFP_PA3_UART3_RXD | SYS_GPA_MFP_PA2_UART3_TXD |
SYS_GPA_MFP_PA1_UART5_RXD | SYS_GPA_MFP_PA0_UART5_TXD;
SYS->GPB_MFP = SYS_GPB_MFP_PB5_UART1_TXD | SYS_GPB_MFP_PB4_UART1_RXD |
SYS_GPB_MFP_PB1_UART0_TXD | SYS_GPB_MFP_PB0_UART0_RXD;
SYS->GPC_MFP = SYS_GPC_MFP_PC7_UART4_RXD | SYS_GPC_MFP_PC6_UART4_TXD;
SYS->GPD_MFP = SYS_GPD_MFP_PD15_UART2_TXD | SYS_GPD_MFP_PD14_UART2_RXD;
SYS->GPF_MFP = SYS_GPF_MFP_PF7_ICE_DAT | SYS_GPF_MFP_PF6_ICE_CLK;
|