7#ifndef ZEPHYR_DRIVERS_SPI_RTIO_H_
8#define ZEPHYR_DRIVERS_SPI_RTIO_H_
38#define SPI_RTIO_DEFINE(_name, _sq_sz, _cq_sz) \
39 RTIO_DEFINE(CONCAT(_name, _r), _sq_sz, _cq_sz); \
40 static struct spi_rtio _name = { \
41 .r = &CONCAT(_name, _r), \
workaround assembler barfing for ST r
Definition asm-macro-32-bit-gnu.h:24
bool spi_rtio_submit(struct spi_rtio *ctx, struct rtio_iodev_sqe *iodev_sqe)
Submit, atomically, a submission to work on at some point.
void spi_rtio_init(struct spi_rtio *ctx, const struct device *dev)
Initialize a SPI RTIO context.
bool spi_rtio_complete(struct spi_rtio *ctx, int status)
Signal that the current (ctx->txn_curr) submission has been completed.
int spi_rtio_copy(struct rtio *r, struct rtio_iodev *iodev, const struct spi_buf_set *tx_bufs, const struct spi_buf_set *rx_bufs, struct rtio_sqe **last_sqe)
Copy the tx_bufs and rx_bufs into a set of RTIO requests.
void spi_rtio_iodev_default_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
Fallback SPI RTIO submit implementation.
int spi_rtio_transceive(struct spi_rtio *ctx, const struct spi_config *config, const struct spi_buf_set *tx_bufs, const struct spi_buf_set *rx_bufs)
Perform a SPI Transfer (transceive) in a blocking call.
Public API for SPI drivers and applications.
Real-Time IO device API for moving bytes with low effort.
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Kernel Spin Lock.
Definition spinlock.h:45
MPSC Queue.
Definition mpsc_lockfree.h:86
Compute the mempool block index for a given pointer.
Definition rtio.h:429
An IO device with a function table for submitting requests.
Definition rtio.h:454
A submission queue event.
Definition rtio.h:232
An RTIO context containing what can be viewed as a pair of queues.
Definition rtio.h:333
SPI buffer array structure.
Definition spi.h:471
SPI controller configuration structure.
Definition spi.h:301
Complete SPI DT information.
Definition spi.h:377
struct spi_config config
Slave specific configuration.
Definition spi.h:381
Driver context for implementing SPI with RTIO.
Definition rtio.h:21
struct rtio_iodev iodev
Definition rtio.h:25
struct rtio_iodev_sqe * txn_head
Definition rtio.h:26
struct k_spinlock lock
Definition rtio.h:22
struct rtio * r
Definition rtio.h:23
struct spi_dt_spec dt_spec
Definition rtio.h:28
struct rtio_iodev_sqe * txn_curr
Definition rtio.h:27
struct mpsc io_q
Definition rtio.h:24