/* Select UART module clock source as HXT and UART module clock divider as 1 */
CLK_SetModuleClock(UART16_MODULE, CLK_CLKSEL3_UART16SEL_HXT, CLK_CLKDIV3_UART16(1));
/* Set GPD multi-function pins for UART16 RXD and TXD */
SYS->GPD_MFPH &= ~(SYS_GPD_MFPH_PD10MFP_Msk | SYS_GPD_MFPH_PD11MFP_Msk);
SYS->GPD_MFPH |= SYS_GPD_MFPH_PD10MFP_UART16_RXD | SYS_GPD_MFPH_PD11MFP_UART16_TXD;
/* Update System Core Clock */
/* User can use SystemCoreClockUpdate() to calculate SystemCoreClock and CyclesPerUs automatically. */
SystemCoreClockUpdate();
}
/* Main */
int main(void)
{
/* Unlock protected registers */
SYS_UnlockReg();
/* Init System, IP clock and multi-function I/O. */
SYS_Init();
/* Init UART to 115200-8n1 for print message */
UART_Open(UART16, 115200);