int main(void) { /* Unlock protected registers */ SYS->REGWRPROT = 0x59; SYS->REGWRPROT = 0x16; SYS->REGWRPROT = 0x88; /* Init System, IP clock and multi-function I/O */ SYS_Init(); /* Lock protected registers */ SYS->REGWRPROT = 0x0; /* Init UART0 for printf */ UART0_Init(); /* Init UART1 for testing */ UART1_Init(); /*---------------------------------------------------------------------------------------------------------*/ /* SAMPLE CODE */ /*---------------------------------------------------------------------------------------------------------*/ printf("\n\nCPU @ %dHz\n", SystemCoreClock); printf("\n\nUART Sample Program\n"); /* UART auto flow sample slave function */ AutoFlow_FunctionRxTest(); while(1); }
int32_t main(void) { /* Unlock protected registers */ SYS_UnlockReg(); /* Init System, peripheral clock and multi-function I/O */ SYS_Init(); /* Lock protected registers */ SYS_LockReg(); /* Init UART0 for printf */ UART0_Init(); /* Init UART1 for testing */ UART1_Init(); /*---------------------------------------------------------------------------------------------------------*/ /* SAMPLE CODE */ /*---------------------------------------------------------------------------------------------------------*/ printf("\n\nCPU @ %dHz\n", SystemCoreClock); printf("\n\nUART Sample Program\n"); /* UART auto flow sample slave function */ AutoFlow_FunctionRxTest(); while(1); }