hi, i am suing TM4C1294NCZAD, and designed a board using RTSCTS hardware flowcontrol, but encounter 2 problem.
1. how could i configure UART0 and use this RTSCTS flowcontrol?
in my code, i wrote like this,
first configure rts and cts pin
ROM_GPIOPinConfigure(GPIO_PB5_U0RTS);
ROM_GPIOPinConfigure(GPIO_PE6_U0CTS);
ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_5);
ROM_GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_6);
UARTFlowControlSet(g_ui32UARTBase[ulPort], UART_FLOWCONTROL_TX | UART_FLOWCONTROL_RX);
then when i want to insert RTS , use
UARTModemControlClear(g_ui32UARTBase[ulPort], UART_OUTPUT_RTS);
UARTModemControlSet(g_ui32UARTBase[ulPort], UART_OUTPUT_RTS);
could this work to change RTS pin status?
2. when i enabled RTSCTS, i use UARTDisable(), the program will stuck in it, and it will wait for the data in tx fifo get out. but how could i clear the fifo and pass this step?
the code in UARTDisable listed below.
void
UARTDisable(uint32_t ui32Base)
{
//
// Check the arguments.
//
ASSERT(_UARTBaseValid(ui32Base));
//
// Wait for end of TX.
//
while(HWREG(ui32Base + UART_O_FR) & UART_FR_BUSY)
{
}
//
// Disable the FIFO.
//
HWREG(ui32Base + UART_O_LCRH) &= ~(UART_LCRH_FEN);
//
// Disable the UART.
//
HWREG(ui32Base + UART_O_CTL) &= ~(UART_CTL_UARTEN | UART_CTL_TXE |
UART_CTL_RXE);
}
i use 6911 before, and i want to use tm4c now to implmented program into this platform.
very thankful for your suggestions!