예제 #1
0
int main(void)
{
    uint32_t u32Item;
    /* Init System, IP clock and multi-function I/O */
    SYS_Init();
    /* Init UART0 for printf */
    UART0_Init();
    /* Init UART1 for testing */
    UART1_Init();

/*---------------------------------------------------------------------------------------------------------*/
/* SAMPLE CODE                                                                                             */
/*---------------------------------------------------------------------------------------------------------*/
    
    printf("\n\nCPU @ %dHz\n", SystemCoreClock);

    do{
        TestItem();
        u32Item = getchar();
        printf("%c\n",u32Item);
        switch(u32Item)
        {
            case '1':   UART_FunctionTest();     break;
            case '2':   IrDA_FunctionTest();     break;
            case '3':   RS485_FunctionTest();    break;
            case '4':   LIN_FunctionTest();      break;
            case '5':   AutoFlow_FunctionTest(); break;
            case '6':   LIN_FunctionTestUsingLinCtlReg();      break;            
            default:    break;
        }
    }while(u32Item != 27); 

}
예제 #2
0
파일: main.c 프로젝트: kasparwu/Mini51
int main(void)
{
    /* Init System, IP clock and multi-function I/O */
    SYS_Init();
    /* Init UART for printf */
    UART_Init();

/*---------------------------------------------------------------------------------------------------------*/
/* SAMPLE CODE                                                                                             */
/*---------------------------------------------------------------------------------------------------------*/
    
    printf("\n\nCPU @ %dHz\n", SystemCoreClock);

    printf("+------------------------+\n");
    printf("| IrDA funtion test |\n");
    printf("+------------------------+\n");
    
    IrDA_FunctionTest();
}