oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Functions
HAL SPI Interface

Hardware Abstraction Layer interface for SPI bus operations. More...

Functions

int ove_hal_spi_open (ove_spi_t spi, const struct ove_spi_cfg *cfg)
 Configure and enable the SPI peripheral.
 
void ove_hal_spi_close (ove_spi_t spi)
 Disable and release the SPI peripheral.
 
int ove_hal_spi_transfer (ove_spi_t spi, const void *tx, void *rx, size_t len, uint32_t timeout_ms)
 Full-duplex SPI data transfer.
 

Detailed Description

Hardware Abstraction Layer interface for SPI bus operations.

Declares the low-level SPI functions that every platform HAL must implement. The portable SPI layer handles bus locking and chip-select management before delegating to these functions.

Function Documentation

◆ ove_hal_spi_open()

int ove_hal_spi_open ( ove_spi_t  spi,
const struct ove_spi_cfg cfg 
)

Configure and enable the SPI peripheral.

Parameters
[in]spiSPI handle with storage already assigned.
[in]cfgBus configuration descriptor.
Returns
OVE_OK on success, negative error code on failure.

◆ ove_hal_spi_close()

void ove_hal_spi_close ( ove_spi_t  spi)

Disable and release the SPI peripheral.

Parameters
[in]spiSPI handle.

◆ ove_hal_spi_transfer()

int ove_hal_spi_transfer ( ove_spi_t  spi,
const void *  tx,
void *  rx,
size_t  len,
uint32_t  timeout_ms 
)

Full-duplex SPI data transfer.

Called under the bus mutex, with CS already asserted by the portable layer. tx or rx may be NULL for half-duplex.

Parameters
[in]spiSPI handle.
[in]txTransmit buffer, or NULL.
[out]rxReceive buffer, or NULL.
[in]lenNumber of bytes to transfer.
[in]timeout_msMaximum wait time.
Returns
OVE_OK on success, negative error code on failure.