This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

请教C5535中Uart例程GPIO的问题



例程中Uart测试程序如下,请问红色部分三句代码的作用是什么,为什么要设置GPIO[15],查询datasheet发现Uart复用的引脚应该是GP[28-31]。

删除掉红色部分代码后发现例程仍然可以正常运行。

Int16 uart_test()
{
    char rx;

    /* Enable UART to FTDI chip */
    EZDSP5535_GPIO_init();
    EZDSP5535_GPIO_setDirection( 15, GPIO_OUT );
    EZDSP5535_GPIO_setOutput( 15, 0 );

    printf("    This program tests the UART over the FTDI chip.\n");
    printf("    Open a Terminal window set to 115200 baud.\n");
    printf("    Type in the terminal and a message returns on the button pressed.\n");
    printf("    Press escape to exit.\n");

    /* Open Uart Handle */
    EZDSP5535_UART_open( );

    /* UART Test */
    while(1)
    {
        /* Waitin for RX */
        EVM5515_UART_getChar( &rx );   // Read 1 byte
     
     /* Was Esc pressed? */
     if(rx == 27)
            break;
     
        /* TX Message */
        EVM5515_UART_putChar('Y' );   // Write Y
        EVM5515_UART_putChar('o' );   // Write o
        EVM5515_UART_putChar('u' );   // Write u
        EVM5515_UART_putChar(' ' );   // Write space
        EVM5515_UART_putChar('p' );   // Write p
        EVM5515_UART_putChar('r' );   // Write r
        EVM5515_UART_putChar('e' );   // Write e
        EVM5515_UART_putChar('s' );   // Write s
        EVM5515_UART_putChar('s' );   // Write s
        EVM5515_UART_putChar('e' );   // Write e
        EVM5515_UART_putChar('d' );   // Write d
        EVM5515_UART_putChar(' ' );   // Write space
        EVM5515_UART_putChar('"' );   // Write "
        EVM5515_UART_putChar( rx );   // Write 1 byte
        EVM5515_UART_putChar('"' );   // Write "
        EVM5515_UART_putChar( 13 );   // Write CR
        EVM5515_UART_putChar( 10 );   // Write LF
    }

    return 0;
}