Skip to content

hw/drivers: Lack of simple UART string transmit API #3487

Description

@wiktorkwiatkowski

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");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions