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;
38#ifdef CONFIG_MCTP_I3C_CONTROLLER_POLLING_MODE
46int mctp_i3c_controller_start(
struct mctp_binding *binding);
47int mctp_i3c_controller_tx(
struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
49#define MCTP_I3C_ENDPOINT_IDS(_node_id, _name) \
50 static uint8_t _name##_endpoint_ids[DT_PROP_LEN(_node_id, endpoints)] \
51 = DT_PROP(_node_id, endpoint_ids)
53#define MCTP_I3C_ENDPOINT_DEVICE(_idx, _node_id, ...) \
54 DEVICE_DT_GET_BY_IDX(_node_id, endpoints, _idx)
56#define MCTP_I3C_CONTROLLER_DEFINE_DEVICES(_node_id, _name) \
57 const struct device *_name##_endpoints[] = { \
58 LISTIFY(DT_PROP_LEN(_node_id, endpoints), \
59 MCTP_I3C_ENDPOINT_DEVICE, (,), _node_id) \
73#define MCTP_I3C_CONTROLLER_DT_DEFINE(_name, _node_id) \
74 MCTP_I3C_CONTROLLER_DEFINE_DEVICES(_node_id, _name); \
75 MCTP_I3C_ENDPOINT_IDS(_node_id, _name); \
76 static struct i3c_device_desc \
77 *_name##_endpoint_i3c_devs[DT_PROP_LEN(_node_id, endpoints)]; \
78 static struct mctp_binding_i3c_controller _name = { \
80 .name = STRINGIFY(_name), .version = 1, \
81 .start = mctp_i3c_controller_start, \
82 .tx = mctp_i3c_controller_tx, \
83 .pkt_size = MCTP_I3C_MAX_PKT_SIZE, \
84 .tx_storage = _name.tx_storage, \
86 .num_endpoints = DT_PROP_LEN(_node_id, endpoints), \
87 .devices = _name##_endpoints, \
88 .endpoint_ids = _name##_endpoint_ids, \
89 .endpoint_i3c_devs = _name##_endpoint_i3c_devs, \
90 COND_CODE_1(CONFIG_MCTP_I3C_CONTROLLER_POLLING_MODE, \
92 K_MSEC(CONFIG_MCTP_I3C_CONTROLLER_POLL_INTERVAL_MS)), ()) \
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
Kernel timeout type.
Definition clock.h:65
A structure used to submit work after a delay.
Definition kernel.h:4759
An MCTP binding for Zephyr's I3C interface using IBI interrupts for signaling.
Definition mctp_i3c_controller.h:27