如图所示,我把UART用到的IO端口功能选择位串口的功能。
得到了如下的配置文件
void SYS_Init(void)
{
//SYS->P0_MFP = 0x00000000;
//SYS->P1_MFP = 0x00000000;
//SYS->P2_MFP = 0x00000000;
//SYS->P3_MFP = 0x00000003;
//SYS->P4_MFP = 0x00000000;
//SYS->P5_MFP = 0x00000000;
//SYS->P6_MFP = 0x00000000;
//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->P0_MFP = 0x00000000;
SYS->P1_MFP = 0x00000000;
SYS->P2_MFP = 0x00000000;
SYS->P3_MFP = SYS_MFP_P31_TXD | SYS_MFP_P30_RXD;
SYS->P4_MFP = 0x00000000;
SYS->P5_MFP = 0x00000000;
SYS->P6_MFP = 0x00000000;
return;
}
怎么就只有一条
SYS->P3_MFP = SYS_MFP_P31_TXD | SYS_MFP_P30_RXD;
|