hw/drivers: Lack of simple UART string transmit API
- Dominant language
- C
- Stars
- 891
- Forks
- 381
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 14
Description
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");`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the UART HAL around hal_uart_blocking_tx and compare it with the existing console_printf API. Define the transmit API's expected string and blocking behavior, then verify that a selected UART can send a complete string including the example newline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100