|
oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
|
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. | |
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.
| int ove_hal_spi_open | ( | ove_spi_t | spi, |
| const struct ove_spi_cfg * | cfg | ||
| ) |
Configure and enable the SPI peripheral.
| [in] | spi | SPI handle with storage already assigned. |
| [in] | cfg | Bus configuration descriptor. |
| void ove_hal_spi_close | ( | ove_spi_t | spi | ) |
Disable and release the SPI peripheral.
| [in] | spi | SPI handle. |
| 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.
| [in] | spi | SPI handle. |
| [in] | tx | Transmit buffer, or NULL. |
| [out] | rx | Receive buffer, or NULL. |
| [in] | len | Number of bytes to transfer. |
| [in] | timeout_ms | Maximum wait time. |