NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
|
Hardware Abstraction Layer (HAL) for asynchronous SPI Master communication. More...
Go to the source code of this file.
Functions | |
nhal_result_t | nhal_spi_master_init_async (struct nhal_spi_context *ctx, const struct nhal_async_config *async_cfg) |
Initialize SPI context for async mode. | |
nhal_result_t | nhal_spi_master_deinit_async (struct nhal_spi_context *ctx) |
Deinitialize SPI async mode. | |
nhal_result_t | nhal_spi_master_set_async_callback (struct nhal_spi_context *ctx, nhal_async_complete_cb_t callback) |
Set callback for async operation completion. | |
nhal_result_t | nhal_spi_master_disable_async_callback (struct nhal_spi_context *ctx) |
Disable async completion callback. | |
nhal_async_status_t | nhal_spi_master_get_async_status (struct nhal_spi_context *ctx) |
Get current async operation status. | |
nhal_result_t | nhal_spi_master_write_async (struct nhal_spi_context *ctx, const uint8_t *data, size_t len,) |
Write data asynchronously. | |
nhal_result_t | nhal_spi_master_read_async (struct nhal_spi_context *ctx, uint8_t *data, size_t len,) |
Read data asynchronously. | |
nhal_result_t | nhal_spi_master_write_read_async (struct nhal_spi_context *ctx, const uint8_t *tx_data, size_t tx_len, uint8_t *rx_data, size_t rx_len,) |
Write and read data simultaneously (full-duplex) asynchronously. | |
Hardware Abstraction Layer (HAL) for asynchronous SPI Master communication.
This header defines the public interface for asynchronous SPI Master operations using DMA. It provides functions for enabling async mode and performing non-blocking read/write operations with automatic DMA optimization.
Async mode provides non-blocking data transfers with callback completion. This mode requires NHAL_SPI_ASYNC_SUPPORT to be defined at compile time.
Definition in file nhal_spi_master_async.h.
nhal_result_t nhal_spi_master_deinit_async | ( | struct nhal_spi_context * | ctx | ) |
Deinitialize SPI async mode.
ctx | Pointer to SPI context structure |
nhal_result_t nhal_spi_master_disable_async_callback | ( | struct nhal_spi_context * | ctx | ) |
Disable async completion callback.
ctx | Pointer to SPI context structure |
nhal_async_status_t nhal_spi_master_get_async_status | ( | struct nhal_spi_context * | ctx | ) |
Get current async operation status.
ctx | Pointer to SPI context structure |
nhal_result_t nhal_spi_master_init_async | ( | struct nhal_spi_context * | ctx, |
const struct nhal_async_config * | async_cfg | ||
) |
Initialize SPI context for async mode.
ctx | Pointer to SPI context structure |
async_cfg | Pointer to async configuration |
nhal_result_t nhal_spi_master_read_async | ( | struct nhal_spi_context * | ctx, |
uint8_t * | data, | ||
size_t | len | ||
) |
Read data asynchronously.
ctx | Pointer to SPI context structure |
data | Pointer to buffer for received data |
len | Number of bytes to read |
timeout_ms | Timeout in milliseconds |
nhal_result_t nhal_spi_master_set_async_callback | ( | struct nhal_spi_context * | ctx, |
nhal_async_complete_cb_t | callback | ||
) |
Set callback for async operation completion.
ctx | Pointer to SPI context structure |
callback | Callback function to execute on completion |
nhal_result_t nhal_spi_master_write_async | ( | struct nhal_spi_context * | ctx, |
const uint8_t * | data, | ||
size_t | len | ||
) |
Write data asynchronously.
ctx | Pointer to SPI context structure |
data | Pointer to data to transmit |
len | Number of bytes to transmit |
timeout_ms | Timeout in milliseconds |
nhal_result_t nhal_spi_master_write_read_async | ( | struct nhal_spi_context * | ctx, |
const uint8_t * | tx_data, | ||
size_t | tx_len, | ||
uint8_t * | rx_data, | ||
size_t | rx_len | ||
) |
Write and read data simultaneously (full-duplex) asynchronously.
ctx | Pointer to SPI context structure |
tx_data | Pointer to data to transmit |
tx_len | Number of bytes to transmit |
rx_data | Pointer to buffer for received data |
rx_len | Number of bytes to read |
timeout_ms | Timeout in milliseconds |