NHAL Interface v0.5.0
Hardware Abstraction Layer Interface for Embedded Systems
Loading...
Searching...
No Matches
Functions
nhal_spi_master.h File Reference

Hardware Abstraction Layer for synchronous SPI Master mode communication. More...

#include <stdint.h>
#include <stddef.h>
#include "nhal_common.h"
#include "nhal_spi_types.h"

Go to the source code of this file.

Functions

nhal_result_t nhal_spi_master_init (struct nhal_spi_context *ctx)
 
nhal_result_t nhal_spi_master_deinit (struct nhal_spi_context *ctx)
 
nhal_result_t nhal_spi_master_set_config (struct nhal_spi_context *ctx, struct nhal_spi_config *config)
 
nhal_result_t nhal_spi_master_get_config (struct nhal_spi_context *ctx, struct nhal_spi_config *config)
 
nhal_result_t nhal_spi_master_write (struct nhal_spi_context *ctx, const uint8_t *data, size_t len)
 
nhal_result_t nhal_spi_master_read (struct nhal_spi_context *ctx, uint8_t *data, size_t len)
 
nhal_result_t nhal_spi_master_write_read (struct nhal_spi_context *ctx, const uint8_t *tx_data, size_t tx_len, uint8_t *rx_data, size_t rx_len)
 

Detailed Description

Hardware Abstraction Layer for synchronous SPI Master mode communication.

This file defines the API for interacting with an SPI bus in master mode. It provides functions for initialization, configuration, reading, writing, and combined operations using synchronous blocking transfers.

Synchronous mode provides blocking operations with automatic transfer optimization. The HAL automatically selects the best transfer method (CPU vs DMA) based on transfer size and hardware capabilities - applications don't need to know. All operations block until completion or timeout.

Note
For non-blocking asynchronous operations, see nhal_spi_master_async.h

Definition in file nhal_spi_master.h.

Function Documentation

◆ nhal_spi_master_deinit()

nhal_result_t nhal_spi_master_deinit ( struct nhal_spi_context ctx)

◆ nhal_spi_master_get_config()

nhal_result_t nhal_spi_master_get_config ( struct nhal_spi_context ctx,
struct nhal_spi_config config 
)

◆ nhal_spi_master_init()

nhal_result_t nhal_spi_master_init ( struct nhal_spi_context ctx)

◆ nhal_spi_master_read()

nhal_result_t nhal_spi_master_read ( struct nhal_spi_context ctx,
uint8_t *  data,
size_t  len 
)

◆ nhal_spi_master_set_config()

nhal_result_t nhal_spi_master_set_config ( struct nhal_spi_context ctx,
struct nhal_spi_config config 
)

◆ nhal_spi_master_write()

nhal_result_t nhal_spi_master_write ( struct nhal_spi_context ctx,
const uint8_t *  data,
size_t  len 
)

◆ nhal_spi_master_write_read()

nhal_result_t nhal_spi_master_write_read ( struct nhal_spi_context ctx,
const uint8_t *  tx_data,
size_t  tx_len,
uint8_t *  rx_data,
size_t  rx_len 
)