7#ifndef ZEPHYR_DRIVERS_I2C_RTIO_H_
8#define ZEPHYR_DRIVERS_I2C_RTIO_H_
39#define I2C_RTIO_DEFINE(_name, _sq_sz, _cq_sz) \
40 RTIO_DEFINE(CONCAT(_name, _r), _sq_sz, _cq_sz); \
41 static struct i2c_rtio _name = { \
42 .r = &CONCAT(_name, _r), \
workaround assembler barfing for ST r
Definition asm-macro-32-bit-gnu.h:24
struct rtio_sqe * i2c_rtio_copy(struct rtio *r, struct rtio_iodev *iodev, const struct i2c_msg *msgs, uint8_t num_msgs)
Copy an array of i2c_msgs to rtio submissions and a transaction.
void i2c_rtio_init(struct i2c_rtio *ctx, const struct device *dev)
Initialize an i2c rtio context.
bool i2c_rtio_complete(struct i2c_rtio *ctx, int status)
Signal that the current (ctx->txn_curr) submission has been completed.
int i2c_rtio_transfer(struct i2c_rtio *ctx, struct i2c_msg *msgs, uint8_t num_msgs, uint16_t addr)
Transfer i2c messages in a blocking call.
bool i2c_rtio_submit(struct i2c_rtio *ctx, struct rtio_iodev_sqe *iodev_sqe)
Submit, atomically, a submission to work on at some point.
int i2c_rtio_configure(struct i2c_rtio *ctx, uint32_t i2c_config)
Configure the I2C bus controller.
int i2c_rtio_recover(struct i2c_rtio *ctx)
Perform an I2C bus recovery in a blocking call.
Public APIs for the I2C drivers.
Real-Time IO device API for moving bytes with low effort.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Complete I2C DT information.
Definition i2c.h:77
One I2C Message.
Definition i2c.h:184
Driver context for implementing i2c with rtio.
Definition rtio.h:21
struct k_spinlock slock
Definition rtio.h:23
struct mpsc io_q
Definition rtio.h:25
struct rtio_iodev iodev
Definition rtio.h:26
struct k_sem lock
Definition rtio.h:22
struct i2c_dt_spec dt_spec
Definition rtio.h:29
struct rtio * r
Definition rtio.h:24
struct rtio_iodev_sqe * txn_curr
Definition rtio.h:28
struct rtio_iodev_sqe * txn_head
Definition rtio.h:27
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:423
An IO device with a function table for submitting requests.
Definition rtio.h:448
A submission queue event.
Definition rtio.h:232
uint32_t i2c_config
OP_I2C_CONFIGURE.
Definition rtio.h:282
const struct rtio_iodev * iodev
Device to operation on.
Definition rtio.h:243
An RTIO context containing what can be viewed as a pair of queues.
Definition rtio.h:327