7#ifndef ZEPHYR_INCLUDE_DRIVERS_I3C_TARGET_DEVICE_H_
8#define ZEPHYR_INCLUDE_DRIVERS_I3C_TARGET_DEVICE_H_
245 const struct i3c_driver_api *api =
246 (
const struct i3c_driver_api *)dev->
api;
248 if (api->target_tx_write == NULL) {
252 return api->target_tx_write(dev, buf, len);
281 const struct i3c_driver_api *api =
282 (
const struct i3c_driver_api *)dev->
api;
284 if (api->target_register == NULL) {
288 return api->target_register(dev, cfg);
310 const struct i3c_driver_api *api =
311 (
const struct i3c_driver_api *)dev->
api;
313 if (api->target_unregister == NULL) {
317 return api->target_unregister(dev, cfg);
static int i3c_target_unregister(const struct device *dev, struct i3c_target_config *cfg)
Unregisters the provided config as target device.
Definition: target_device.h:307
static int i3c_target_tx_write(const struct device *dev, uint8_t *buf, uint16_t len)
Writes to the target's TX FIFO.
Definition: target_device.h:242
static int i3c_target_register(const struct device *dev, struct i3c_target_config *cfg)
Registers the provided config as target device of a controller.
Definition: target_device.h:278
struct _snode sys_snode_t
Single-linked list node structure.
Definition: slist.h:39
#define ENOSYS
Function not implemented.
Definition: errno.h:83
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__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:399
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:405
Configuration parameters for I3C hardware to act as target device.
Definition: target_device.h:34
uint8_t bcr
Bus Characteristics Register (BCR).
Definition: target_device.h:61
bool pid_random
True if lower 32-bit of Provisioned ID is random.
Definition: target_device.h:58
uint16_t max_read_len
Maximum Read Length (MRL).
Definition: target_device.h:67
uint64_t pid
Provisioned ID.
Definition: target_device.h:50
uint8_t supported_hdr
Bit mask of supported HDR modes (0 - 7).
Definition: target_device.h:78
uint8_t static_addr
I3C target address.
Definition: target_device.h:47
bool enable
If the hardware is to act as a target device on the bus.
Definition: target_device.h:39
uint16_t max_write_len
Maximum Write Length (MWL).
Definition: target_device.h:70
uint8_t dcr
Device Characteristics Register (DCR).
Definition: target_device.h:64
Definition: target_device.h:109
int(* stop_cb)(struct i3c_target_config *config)
Function called when a stop condition is observed after a start condition addressed to a particular d...
Definition: target_device.h:211
int(* write_received_cb)(struct i3c_target_config *config, uint8_t val)
Function called when a write to the device is continued.
Definition: target_device.h:147
int(* read_requested_cb)(struct i3c_target_config *config, uint8_t *val)
Function called when a read from the device is initiated.
Definition: target_device.h:170
int(* write_requested_cb)(struct i3c_target_config *config)
Function called when a write to the device is initiated.
Definition: target_device.h:126
int(* read_processed_cb)(struct i3c_target_config *config, uint8_t *val)
Function called when a read from the device is continued.
Definition: target_device.h:193
Structure describing a device that supports the I3C target API.
Definition: target_device.h:92
const struct i3c_target_callbacks * callbacks
Callback functions.
Definition: target_device.h:106
sys_snode_t node
Private, do not modify.
Definition: target_device.h:94
uint8_t address
Address for this target device.
Definition: target_device.h:103
uint8_t flags
Flags for the target device defined by I3C_TARGET_FLAGS_* constants.
Definition: target_device.h:100
Definition: target_device.h:214
int(* driver_unregister)(const struct device *dev)
Definition: target_device.h:216
int(* driver_register)(const struct device *dev)
Definition: target_device.h:215