oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
SPI

SPI bus master driver. More...

Data Structures

struct  ove_spi_cfg
 SPI bus configuration descriptor. More...
 
struct  ove_spi_cs
 SPI chip-select descriptor. More...
 
struct  ove_spi_xfer
 SPI transfer segment for multi-segment transactions. More...
 

Enumerations

enum  ove_spi_mode_t { OVE_SPI_MODE_0 = 0 , OVE_SPI_MODE_1 = 1 , OVE_SPI_MODE_2 = 2 , OVE_SPI_MODE_3 = 3 }
 SPI clock polarity / phase mode. More...
 
enum  ove_spi_bit_order_t { OVE_SPI_MSB_FIRST = 0 , OVE_SPI_LSB_FIRST = 1 }
 SPI bit order. More...
 

Functions

static int ove_spi_create (ove_spi_t *s, const struct ove_spi_cfg *c)
 
static void ove_spi_destroy (ove_spi_t s)
 
static int ove_spi_transfer (ove_spi_t s, const struct ove_spi_cs *cs, const void *tx, void *rx, size_t l, uint32_t t)
 
static int ove_spi_write (ove_spi_t s, const struct ove_spi_cs *cs, const void *d, size_t l, uint32_t t)
 
static int ove_spi_read (ove_spi_t s, const struct ove_spi_cs *cs, void *b, size_t l, uint32_t t)
 
static int ove_spi_transfer_seq (ove_spi_t s, const struct ove_spi_cs *cs, const struct ove_spi_xfer *x, unsigned int n, uint32_t t)
 

Detailed Description

SPI bus master driver.

Provides a portable SPI master API with configurable clock, mode, thread-safe bus locking, and software chip-select management via GPIO.

Two allocation strategies are supported:

Note
Requires CONFIG_OVE_SPI.

Enumeration Type Documentation

◆ ove_spi_mode_t

SPI clock polarity / phase mode.

Enumerator
OVE_SPI_MODE_0 

CPOL=0, CPHA=0.

OVE_SPI_MODE_1 

CPOL=0, CPHA=1.

OVE_SPI_MODE_2 

CPOL=1, CPHA=0.

OVE_SPI_MODE_3 

CPOL=1, CPHA=1.

◆ ove_spi_bit_order_t

SPI bit order.

Enumerator
OVE_SPI_MSB_FIRST 

Most significant bit first (common).

OVE_SPI_LSB_FIRST 

Least significant bit first.