Part Number: TM4C129ENCPDT
Tool/software: Code Composer Studio
I have used the TIVA library to setup and use a non-flow control UART successfully. However I need to support DCE RTS/CTS control - how do you do this?
I want to use hardware flow-control. I have set the flow control bits in the hardware register -see the code below on the last lines.
How do you assign the pins to the UART RTS and CTS pins to the uart hardware so that these pins are automatically set in hardware?
// Create UART 1 parameters from the configuration parameters
UART_Params_init(&uartParams1);
uartParams1.writeDataMode = UART_DATA_BINARY;
uartParams1.readDataMode = UART_DATA_BINARY;
uartParams1.readReturnMode = UART_RETURN_FULL;
uartParams1.readTimeout = 1;
uartParams1.writeTimeout = 1;
uartParams1.readEcho = UART_ECHO_OFF;
uartParams1.baudRate = WorkingConfigParams.rs232_param[1].baud;
uartParams1.parityType = WorkingConfigParams.rs232_param[1].parity;
uartParams1.stopBits = WorkingConfigParams.rs232_param[1].stop;
uartParams1.readMode = UART_MODE_BLOCKING;
// sanity check the baud rate
if (uartParams1.baudRate < 300)
uartParams1.baudRate = 9600;
// open the UART1 device
Rs232Uart1 = UART_open(Board_UART1, &uartParams1);
if (Rs232Uart1 == NULL)
{
System_printf("Error Opening UART 1...%d\n",errno);
}
else
{
// cancel any pending read or write
UART_readCancel(Rs232Uart1);
UART_writeCancel(Rs232Uart1);
}
// set the ISOLATORS to terminal mode to DCE
SetRJ45Bot_DCE();
// set the flow control
UARTFlowControlSet(UART1_BASE, 0);
if (WorkingConfigParams.rs232_param[1].flowControl)
{
UARTFlowControlSet(UART1_BASE, UART_FLOWCONTROL_TX | UART_FLOWCONTROL_RX);
}