[quote userid="345142" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1420221/tm4c129xnczad-any-sample-code-for-uartcharputnonblocking-using-interrupt-based-communication-instead-of-looping-to-wait-and-turn-off-rs485-transmitter/5446907#5446907"] Starting on Line 87, I see what you posted: // // Loop while there are characters in the receive FIFO. // while(MAP_UARTCharsAvail(UART0_BASE)) { // // Read the next character from the UART and write it back to the UART. // MAP_UARTCharPutNonBlocking(UART0_BASE, UARTCharGetNonBlocking(UART0_BASE)); } [/quote] This is the code to echo back what is received. [quote userid="345142" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1420221/tm4c129xnczad-any-sample-code-for-uartcharputnonblocking-using-interrupt-based-communication-instead-of-looping-to-wait-and-turn-off-rs485-transmitter/5446907#5446907"]//***************************************************************************** // // Send a string to the UART. // //***************************************************************************** void UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count) { // // Loop while there are more characters to send. // while(ui32Count--) { // // Write the next character to the UART. // MAP_UARTCharPutNonBlocking(UART0_BASE, *pui8Buffer++); } }[/quote] UARTSend is the function to send any arbitrary length of characters to the UART. You can use this function to send whatever you want to send based on your application..
↧