/* Update System Core Clock */
/* User can use SystemCoreClockUpdate() to calculate PllClock, SystemCoreClock and CycylesPerUs automatically. */
SystemCoreClockUpdate();
/* Set GPC multi-function pins for UART2 RXD and TXD */
SYS->GPC_MFPH = SYS_GPC_MFPH_PC10MFP_UART2_RXD | SYS_GPC_MFPH_PC11MFP_UART2_TXD ;
/* Set PB multi-function pins for UART1 RXD, TXD, RTS and CTS */
SYS->GPD_MFPL = SYS_GPD_MFPL_PD4MFP_UART3_RXD | SYS_GPD_MFPL_PD5MFP_UART3_TXD;
/* Lock protected registers */
SYS_LockReg();
}
/*---------------------------------------------------------------------------------------------------------*/
/* MAIN function */
/*---------------------------------------------------------------------------------------------------------*/
int main (void)
{
int i;
/* Init System, IP clock and multi-function I/O
In the end of SYS_Init() will issue SYS_LockReg()
to lock protected register. If user want to write
protected register, please issue SYS_UnlockReg()
to unlock protected register if necessary */
SYS_Init();
/* Init UART to 115200-8n1 for print message */
UART_Open(UART2, 115200);
// UART_Open(UART0, 115200);