NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
|
Hardware Abstraction Layer (HAL) for synchronous UART communication. More...
Go to the source code of this file.
Functions | |
nhal_result_t | nhal_uart_init (struct nhal_uart_context *ctx) |
Initialize UART context in basic mode. | |
nhal_result_t | nhal_uart_deinit (struct nhal_uart_context *ctx) |
Deinitialize UART context. | |
nhal_result_t | nhal_uart_set_config (struct nhal_uart_context *ctx, struct nhal_uart_config *cfg) |
Set UART configuration. | |
nhal_result_t | nhal_uart_get_config (struct nhal_uart_context *ctx, struct nhal_uart_config *cfg) |
Get current UART configuration. | |
nhal_result_t | nhal_uart_write (struct nhal_uart_context *ctx, const uint8_t *data, size_t len) |
Write data to UART (blocking) | |
nhal_result_t | nhal_uart_read (struct nhal_uart_context *ctx, uint8_t *data, size_t len) |
Read data from UART (blocking) | |
Hardware Abstraction Layer (HAL) for synchronous UART communication.
This header defines the public interface for synchronous (blocking) UART operations. It provides functions for initializing, deinitializing, configuring, writing to, and reading from UART instances in blocking mode.
Synchronous mode provides blocking operations with automatic transfer optimization. All operations block until completion or timeout.
Definition in file nhal_uart_basic.h.
nhal_result_t nhal_uart_deinit | ( | struct nhal_uart_context * | ctx | ) |
Deinitialize UART context.
ctx | Pointer to UART context structure |
nhal_result_t nhal_uart_get_config | ( | struct nhal_uart_context * | ctx, |
struct nhal_uart_config * | cfg | ||
) |
Get current UART configuration.
ctx | Pointer to UART context structure |
cfg | Pointer to configuration structure to fill |
nhal_result_t nhal_uart_init | ( | struct nhal_uart_context * | ctx | ) |
Initialize UART context in basic mode.
ctx | Pointer to UART context structure |
nhal_result_t nhal_uart_read | ( | struct nhal_uart_context * | ctx, |
uint8_t * | data, | ||
size_t | len | ||
) |
Read data from UART (blocking)
ctx | Pointer to UART context structure |
data | Pointer to buffer for received data |
len | Number of bytes to read |
timeout | Timeout in milliseconds |
nhal_result_t nhal_uart_set_config | ( | struct nhal_uart_context * | ctx, |
struct nhal_uart_config * | cfg | ||
) |
Set UART configuration.
ctx | Pointer to UART context structure |
cfg | Pointer to configuration structure |
nhal_result_t nhal_uart_write | ( | struct nhal_uart_context * | ctx, |
const uint8_t * | data, | ||
size_t | len | ||
) |
Write data to UART (blocking)
ctx | Pointer to UART context structure |
data | Pointer to data to transmit |
len | Number of bytes to transmit |
timeout | Timeout in milliseconds |