|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
Hardware Abstraction Layer interface for UART operations. More...
Functions | |
| int | ove_hal_uart_open (ove_uart_t uart, const struct ove_uart_cfg *cfg) |
| Configure and enable the UART peripheral. | |
| void | ove_hal_uart_close (ove_uart_t uart) |
| Disable and release the UART peripheral. | |
| int | ove_hal_uart_tx (ove_uart_t uart, const void *data, size_t len, uint32_t timeout_ms, size_t *bytes_written) |
| Blocking transmit of data. | |
| int | ove_hal_uart_rx_enable (ove_uart_t uart) |
| Enable the RX interrupt / start RX reception. | |
| int | ove_hal_uart_tx_flush (ove_uart_t uart) |
| Flush the TX hardware FIFO. | |
Hardware Abstraction Layer interface for UART operations.
Declares the low-level UART functions that every platform HAL must implement. The portable UART layer handles RX buffering (via Stream) and TX locking.
The HAL does not manage the RX buffer. Instead, the backend's RX ISR calls ove_uart_rx_isr_push() to deliver bytes to the portable layer's internal stream.
| int ove_hal_uart_open | ( | ove_uart_t | uart, |
| const struct ove_uart_cfg * | cfg | ||
| ) |
Configure and enable the UART peripheral.
Maps the instance index to hardware, configures baud rate and framing, and enables the RX interrupt path.
| [in] | uart | UART handle with storage already assigned. |
| [in] | cfg | UART configuration descriptor. |
| void ove_hal_uart_close | ( | ove_uart_t | uart | ) |
Disable and release the UART peripheral.
| [in] | uart | UART handle. |
| int ove_hal_uart_tx | ( | ove_uart_t | uart, |
| const void * | data, | ||
| size_t | len, | ||
| uint32_t | timeout_ms, | ||
| size_t * | bytes_written | ||
| ) |
Blocking transmit of data.
Called under the TX mutex.
| [in] | uart | UART handle. |
| [in] | data | Data to transmit. |
| [in] | len | Number of bytes. |
| [in] | timeout_ms | Maximum wait time. |
| [out] | bytes_written | Actual bytes written, or NULL. |
| int ove_hal_uart_rx_enable | ( | ove_uart_t | uart | ) |
Enable the RX interrupt / start RX reception.
Called after the RX stream is set up. The ISR should call ove_uart_rx_isr_push() for each received byte.
| [in] | uart | UART handle. |
| int ove_hal_uart_tx_flush | ( | ove_uart_t | uart | ) |
Flush the TX hardware FIFO.
Blocks until all pending bytes have been physically transmitted.
| [in] | uart | UART handle. |