8#ifndef ZEPHYR_MCTP_I2C_GPIO_TARGET_H_
9#define ZEPHYR_MCTP_I2C_GPIO_TARGET_H_
24 struct mctp_binding binding;
32 struct mctp_pktbuf *rx_pkt;
33 struct k_sem *tx_lock;
34 struct k_sem *tx_complete;
36 struct mctp_pktbuf *tx_pkt;
37 uint8_t tx_storage[MCTP_PKTBUF_SIZE(MCTP_I2C_GPIO_MAX_PKT_SIZE)] PKTBUF_STORAGE_ALIGN;
43int mctp_i2c_gpio_target_start(
struct mctp_binding *binding);
44int mctp_i2c_gpio_target_tx(
struct mctp_binding *binding,
struct mctp_pktbuf *pkt);
72#define MCTP_I2C_GPIO_TARGET_DT_DEFINE(_name, _node_id) \
73 K_SEM_DEFINE(_name ##_tx_lock, 1, 1); \
74 K_SEM_DEFINE(_name ##_tx_complete, 0, 1); \
75 struct mctp_binding_i2c_gpio_target _name = { \
77 .name = STRINGIFY(_name), .version = 1, \
78 .start = mctp_i2c_gpio_target_start, \
79 .tx = mctp_i2c_gpio_target_tx, \
80 .pkt_size = MCTP_I2C_GPIO_MAX_PKT_SIZE, \
81 .tx_storage = _name.tx_storage, \
83 .i2c = DEVICE_DT_GET(DT_PHANDLE(_node_id, i2c)), \
85 .address = DT_PROP(_node_id, i2c_addr), \
86 .callbacks = &mctp_i2c_gpio_target_callbacks, \
88 .endpoint_id = DT_PROP(_node_id, endpoint_id), \
89 .endpoint_gpio = GPIO_DT_SPEC_GET(_node_id, endpoint_gpios), \
90 .tx_lock = &_name##_tx_lock, \
91 .tx_complete = &_name##_tx_complete, \
Main header file for GPIO driver API.
Main header file for I2C (Inter-Integrated Circuit) driver API.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Container for GPIO pin information specified in devicetree.
Definition gpio.h:296
Structure providing callbacks to be implemented for devices that supports the I2C target API.
Definition i2c.h:465
Structure describing a device that supports the I2C target API.
Definition i2c.h:503
Semaphore structure.
Definition kernel.h:3663
An MCTP binding for Zephyr's I2C target interface using GPIO.
Definition mctp_i2c_gpio_target.h:22