14#ifndef ZEPHYR_INCLUDE_PMCI_MCTP_MCTP_I3C_CONTROLLER_H_
15#define ZEPHYR_INCLUDE_PMCI_MCTP_MCTP_I3C_CONTROLLER_H_
29 struct mctp_binding binding;
31 const struct device **devices;
34 enum mctp_i3c_endpoint_state *endpoint_states;
37 uint8_t tx_storage[MCTP_PKTBUF_SIZE(MCTP_I3C_MAX_PKT_SIZE)] PKTBUF_STORAGE_ALIGN;
42int mctp_i3c_controller_start(
struct mctp_binding *binding);
43int mctp_i3c_controller_tx(
struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
45#define MCTP_I3C_ENDPOINT_IDS(_node_id, _name) \
46 static uint8_t _name##_endpoint_ids[DT_PROP_LEN(_node_id, endpoints)] \
47 = DT_PROP(_node_id, endpoint_ids)
49#define MCTP_I3C_ENDPOINT_DEVICE(_idx, _node_id, ...) \
50 DEVICE_DT_GET_BY_IDX(_node_id, endpoints, _idx)
52#define MCTP_I3C_CONTROLLER_DEFINE_DEVICES(_node_id, _name) \
53 const struct device *_name##_endpoints[] = { \
54 LISTIFY(DT_PROP_LEN(_node_id, endpoints), \
55 MCTP_I3C_ENDPOINT_DEVICE, (,), _node_id) \
70#define MCTP_I3C_CONTROLLER_DT_DEFINE(_name, _node_id) \
71 MCTP_I3C_CONTROLLER_DEFINE_DEVICES(_node_id, _name); \
72 MCTP_I3C_ENDPOINT_IDS(_node_id, _name); \
73 static struct i3c_device_desc \
74 *_name##_endpoint_i3c_devs[DT_PROP_LEN(_node_id, endpoints)]; \
75 static struct mctp_binding_i3c_controller _name = { \
77 .name = STRINGIFY(_name), .version = 1, \
78 .start = mctp_i3c_controller_start, \
79 .tx = mctp_i3c_controller_tx, \
80 .pkt_size = MCTP_I3C_MAX_PKT_SIZE, \
81 .tx_storage = _name.tx_storage, \
83 .num_endpoints = DT_PROP_LEN(_node_id, endpoints), \
84 .devices = _name##_endpoints, \
85 .endpoint_ids = _name##_endpoint_ids, \
86 .endpoint_i3c_devs = _name##_endpoint_i3c_devs, \
Main header file for I3C (Inter-Integrated Circuit) driver API.
Internal definitions shared by the MCTP I3C controller and target bindings.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Structure describing a I3C target device.
Definition i3c.h:1011
An MCTP binding for Zephyr's I3C interface using IBI interrupts for signaling.
Definition mctp_i3c_controller.h:27