mynewt-core icon indicating copy to clipboard operation
mynewt-core copied to clipboard

hw/drivers: Lack of simple UART string transmit API

Open wiktorkwiatkowski opened this issue 5 months ago • 1 comments

Currently, there is no easy way to send a full string over a UART interface. You have to send each character manually, like this:

char *str = "Hello World!";
char *ptr = str;

while (*ptr) {
    hal_uart_blocking_tx(MY_UART, *ptr++);
}
hal_uart_blocking_tx(MY_UART, '\n');

For the console, there is console_printf(), but there isnt similar function for general UARTs.

Proposal: Add function, for example: void hal_uart_transmit(int uart, char *str); that would send the whole string over the selected UART.

Example usage: hal_uart_transmit(1, "Hello World!\n");

wiktorkwiatkowski avatar Jul 29 '25 08:07 wiktorkwiatkowski

can this be assigned to me.

spnirmal avatar Oct 25 '25 04:10 spnirmal