Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
I3C Target Device API. More...
Data Structures | |
struct | i3c_config_target |
Configuration parameters for I3C hardware to act as target device. More... | |
struct | i3c_target_config |
Structure describing a device that supports the I3C target API. More... | |
struct | i3c_target_callbacks |
struct | i3c_target_driver_api |
Functions | |
static int | i3c_target_tx_write (const struct device *dev, uint8_t *buf, uint16_t len) |
Writes to the target's TX FIFO. | |
static int | i3c_target_register (const struct device *dev, struct i3c_target_config *cfg) |
Registers the provided config as target device of a controller. | |
static int | i3c_target_unregister (const struct device *dev, struct i3c_target_config *cfg) |
Unregisters the provided config as target device. | |
I3C Target Device API.
|
inlinestatic |
#include <zephyr/drivers/i3c/target_device.h>
Registers the provided config as target device of a controller.
Enable I3C target mode for the dev
I3C bus driver using the provided config struct (cfg
) containing the functions and parameters to send bus events. The I3C target will be registered at the address provided as i3c_target_config::address struct member. Any I3C bus events related to the target mode will be passed onto I3C target device driver via a set of callback functions provided in the 'callbacks' struct member.
Most of the existing hardware allows simultaneous support for master and target mode. This is however not guaranteed.
dev | Pointer to the device structure for an I3C controller driver configured in target mode. |
cfg | Config struct with functions and parameters used by the I3C target driver to send bus events |
0 | Is successful |
-EINVAL | If parameters are invalid |
-EIO | General input / output error. |
-ENOSYS | If target mode is not implemented |
|
inlinestatic |
#include <zephyr/drivers/i3c/target_device.h>
Writes to the target's TX FIFO.
Write to the TX FIFO dev
I3C bus driver using the provided buffer and length. Some I3C targets will NACK read requests until data is written to the TX FIFO. This function will write as much as it can to the FIFO return the total number of bytes written. It is then up to the application to utalize the target callbacks to write the remaining data. Negative returns indicate error.
Most of the existing hardware allows simultaneous support for master and target mode. This is however not guaranteed.
dev | Pointer to the device structure for an I3C controller driver configured in target mode. |
buf | Pointer to the buffer |
len | Length of the buffer |
Total | number of bytes written |
-ENOTSUP | Not in Target Mode |
-ENOSPC | No space in Tx FIFO |
-ENOSYS | If target mode is not implemented |
|
inlinestatic |
#include <zephyr/drivers/i3c/target_device.h>
Unregisters the provided config as target device.
This routine disables I3C target mode for the dev
I3C bus driver using the provided config struct (cfg
) containing the functions and parameters to send bus events.
dev | Pointer to the device structure for an I3C controller driver configured in target mode. |
cfg | Config struct with functions and parameters used by the I3C target driver to send bus events |
0 | Is successful |
-EINVAL | If parameters are invalid |
-ENOSYS | If target mode is not implemented |