Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
i3c.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Intel Corporation
3 * Copyright 2023 Meta Platforms, Inc. and its affiliates
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
13
14#ifndef ZEPHYR_INCLUDE_DRIVERS_I3C_H_
15#define ZEPHYR_INCLUDE_DRIVERS_I3C_H_
16
25
26#include <errno.h>
27#include <stdint.h>
28#include <stddef.h>
29
30#include <zephyr/device.h>
36#include <zephyr/drivers/i2c.h>
37#include <zephyr/sys/slist.h>
38#include <zephyr/sys/util.h>
39#include <zephyr/rtio/rtio.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
49#define I3C_OD_TLOW_MIN_NS 200
50#define I3C_OD_MIXED_BUS_THIGH_MAX_NS 41
51#define I3C_OD_FIRST_BC_THIGH_MIN_NS 200
52
93
100#define I3C_BCR_MAX_DATA_SPEED_LIMIT BIT(0)
101
103#define I3C_BCR_IBI_REQUEST_CAPABLE BIT(1)
104
112#define I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE BIT(2)
113
120#define I3C_BCR_OFFLINE_CAPABLE BIT(3)
121
128#define I3C_BCR_VIRTUAL_TARGET BIT(4)
129
137#define I3C_BCR_ADV_CAPABILITIES BIT(5)
138
140#define I3C_BCR_DEVICE_ROLE_I3C_TARGET 0U
141
143#define I3C_BCR_DEVICE_ROLE_I3C_CONTROLLER_CAPABLE 1U
144
146#define I3C_BCR_DEVICE_ROLE_MASK GENMASK(7U, 6U)
147
155#define I3C_BCR_DEVICE_ROLE(bcr) \
156 FIELD_GET(I3C_BCR_DEVICE_ROLE_MASK, (bcr))
157
159
179
181#define I3C_LVR_I2C_FM_PLUS_MODE 0
182
184#define I3C_LVR_I2C_FM_MODE 1
185
187#define I3C_LVR_I2C_MODE_MASK BIT(4)
188
196#define I3C_LVR_I2C_MODE(lvr) \
197 FIELD_GET(I3C_LVR_I2C_MODE_MASK, (lvr))
198
205#define I3C_LVR_I2C_DEV_IDX_0 0
206
213#define I3C_LVR_I2C_DEV_IDX_1 1
214
221#define I3C_LVR_I2C_DEV_IDX_2 2
222
224#define I3C_LVR_I2C_DEV_IDX_MASK GENMASK(7U, 5U)
225
233#define I3C_LVR_I2C_DEV_IDX(lvr) \
234 FIELD_GET(I3C_LVR_I2C_DEV_IDX_MASK, (lvr))
235
237
268
284
309
315
316/*
317 * I3C_MSG_* are I3C Message flags.
318 */
319
321#define I3C_MSG_WRITE (0U << 0U)
322
324#define I3C_MSG_READ BIT(0)
325
327#define I3C_MSG_RW_MASK BIT(0)
329
331#define I3C_MSG_STOP BIT(1)
332
342#define I3C_MSG_RESTART BIT(2)
343
345#define I3C_MSG_HDR BIT(3)
346
348#define I3C_MSG_NBCH BIT(4)
349
351#define I3C_MSG_HDR_MODE0 BIT(0)
352
354#define I3C_MSG_HDR_MODE1 BIT(1)
355
357#define I3C_MSG_HDR_MODE2 BIT(2)
358
360#define I3C_MSG_HDR_MODE3 BIT(3)
361
363#define I3C_MSG_HDR_MODE4 BIT(4)
364
366#define I3C_MSG_HDR_MODE5 BIT(5)
367
369#define I3C_MSG_HDR_MODE6 BIT(6)
370
372#define I3C_MSG_HDR_MODE7 BIT(7)
373
375#define I3C_MSG_HDR_DDR I3C_MSG_HDR_MODE0
376
378#define I3C_MSG_HDR_TSP I3C_MSG_HDR_MODE1
379
381#define I3C_MSG_HDR_TSL I3C_MSG_HDR_MODE2
382
384#define I3C_MSG_HDR_BT I3C_MSG_HDR_MODE3
385
387
392
445
447
456
499
511
512 union {
515
522 void *ptr;
523 };
524};
525
532struct i3c_device_desc;
533struct i3c_device_id;
535struct i3c_target_config;
536struct i3c_config_target;
537
538__subsystem struct i3c_driver_api {
548 struct i2c_driver_api i2c_api;
549
562 int (*configure)(const struct device *dev,
563 enum i3c_config_type type, void *config);
564
577 int (*config_get)(const struct device *dev,
578 enum i3c_config_type type, void *config);
579#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
591 int (*recover_bus)(const struct device *dev);
592
605 int (*attach_i3c_device)(const struct device *dev,
606 struct i3c_device_desc *target);
607
621 int (*reattach_i3c_device)(const struct device *dev,
622 struct i3c_device_desc *target,
623 uint8_t old_dyn_addr);
624
637 int (*detach_i3c_device)(const struct device *dev,
638 struct i3c_device_desc *target);
639
652 int (*attach_i2c_device)(const struct device *dev,
653 struct i3c_i2c_device_desc *target);
654
667 int (*detach_i2c_device)(const struct device *dev,
668 struct i3c_i2c_device_desc *target);
669
681 int (*do_daa)(const struct device *dev);
682
695 int (*do_ccc)(const struct device *dev,
696 struct i3c_ccc_payload *payload);
697
710 int (*i3c_xfers)(const struct device *dev,
711 struct i3c_device_desc *target,
712 struct i3c_msg *msgs,
713 uint8_t num_msgs);
714
728 struct i3c_device_desc *(*i3c_device_find)(const struct device *dev,
729 const struct i3c_device_id *id);
730#endif /* CONFIG_I3C_CONTROLLER */
731#ifdef CONFIG_I3C_USE_IBI
732#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
745 int (*ibi_raise)(const struct device *dev,
746 struct i3c_ibi *request);
747#endif /* CONFIG_I3C_TARGET */
748#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
759 int (*ibi_hj_response)(const struct device *dev,
760 bool ack);
761
774 int (*ibi_enable)(const struct device *dev,
775 struct i3c_device_desc *target);
776
789 int (*ibi_disable)(const struct device *dev,
790 struct i3c_device_desc *target);
791#endif /* CONFIG_I3C_CONTROLLER */
792#endif /* CONFIG_I3C_USE_IBI */
793#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
809 int (*target_register)(const struct device *dev,
810 struct i3c_target_config *cfg);
811
827 int (*target_unregister)(const struct device *dev,
828 struct i3c_target_config *cfg);
829
846 int (*target_tx_write)(const struct device *dev,
847 uint8_t *buf, uint16_t len, uint8_t hdr_mode);
848
864 int (*target_controller_handoff)(const struct device *dev,
865 bool accept);
866#endif /* CONFIG_I3C_TARGET */
867#if defined(CONFIG_I3C_RTIO) || defined(__DOXYGEN__)
878 void (*iodev_submit)(const struct device *dev,
879 struct rtio_iodev_sqe *iodev_sqe);
880#endif /* CONFIG_I3C_RTIO */
881};
882
886
893};
894
903#define I3C_DEVICE_ID(pid) \
904 { \
905 .pid = pid \
906 }
907
926
928 const struct device *bus;
929
931 const struct device *dev;
932
935
949
960
969
984
990
998
999 struct {
1002
1005
1009
1010 struct {
1013
1016
1020
1023
1025 struct {
1026 union {
1035
1045 };
1046
1055
1068
1075
1076 /* Describes Controller Feature Capabilities */
1077 struct {
1086
1097
1102 void *controller_priv;
1104
1105#if defined(CONFIG_I3C_USE_IBI) || defined(__DOXYGEN__)
1111#endif /* CONFIG_I3C_USE_IBI */
1112};
1113
1129
1131 const struct device *bus;
1132
1135
1141
1146 void *controller_priv;
1148};
1149
1179
1192 struct i3c_device_desc * const i3c;
1193
1197 struct i3c_i2c_device_desc * const i2c;
1198
1203
1208};
1209
1216#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1219
1222#elif defined(CONFIG_CPP)
1223 /* Empty struct has size 0 in C, size 1 in C++. Force them to be the same. */
1224 uint8_t unused_cpp_size_compatibility;
1225#endif
1226};
1227
1228#if defined(CONFIG_CPP)
1229BUILD_ASSERT(sizeof(struct i3c_driver_config) >= 1);
1230#endif
1231
1239#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1242#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
1245
1248#endif /* CONFIG_I3C_TARGET */
1249#endif /* CONFIG_I3C_CONTROLLER */
1250};
1251#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1259#define I3C_BUS_FOR_EACH_I3CDEV(bus, desc) \
1260 SYS_SLIST_FOR_EACH_CONTAINER( \
1261 &((struct i3c_driver_data *)(bus->data))->attached_dev.devices.i3c, desc, node)
1262
1270#define I3C_BUS_FOR_EACH_I2CDEV(bus, desc) \
1271 SYS_SLIST_FOR_EACH_CONTAINER( \
1272 &((struct i3c_driver_data *)(bus->data))->attached_dev.devices.i2c, desc, node)
1273
1286struct i3c_device_desc *i3c_dev_list_find(const struct i3c_dev_list *dev_list,
1287 const struct i3c_device_id *id);
1288
1302 uint8_t addr);
1303
1317 uint8_t addr);
1318
1332 uint16_t addr);
1333
1386 const struct i3c_dev_list *dev_list,
1387 uint64_t pid, bool must_match,
1388 bool assigned_okay,
1389 struct i3c_device_desc **target,
1390 uint8_t *addr);
1391#endif /* CONFIG_I3C_CONTROLLER */
1405static inline int i3c_configure(const struct device *dev,
1406 enum i3c_config_type type, void *config)
1407{
1408 const struct i3c_driver_api *api =
1409 (const struct i3c_driver_api *)dev->api;
1410
1411 if (api->configure == NULL) {
1412 return -ENOSYS;
1413 }
1414
1415 return api->configure(dev, type, config);
1416}
1417#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1433static inline int i3c_configure_controller(const struct device *dev,
1434 struct i3c_config_controller *config)
1435{
1436 return i3c_configure(dev, I3C_CONFIG_CONTROLLER, config);
1437}
1438#endif /* CONFIG_I3C_CONTROLLER */
1439#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
1455static inline int i3c_configure_target(const struct device *dev,
1456 struct i3c_config_target *config)
1457{
1458 return i3c_configure(dev, I3C_CONFIG_TARGET, config);
1459}
1460#endif /* CONFIG_I3C_TARGET */
1481static inline int i3c_config_get(const struct device *dev,
1482 enum i3c_config_type type, void *config)
1483{
1484 const struct i3c_driver_api *api =
1485 (const struct i3c_driver_api *)dev->api;
1486
1487 if (api->config_get == NULL) {
1488 return -ENOSYS;
1489 }
1490
1491 return api->config_get(dev, type, config);
1492}
1493#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1509static inline int i3c_config_get_controller(const struct device *dev,
1510 struct i3c_config_controller *config)
1511{
1512 return i3c_config_get(dev, I3C_CONFIG_CONTROLLER, config);
1513}
1514#endif /* CONFIG_I3C_CONTROLLER */
1515#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
1531static inline int i3c_config_get_target(const struct device *dev,
1532 struct i3c_config_target *config)
1533{
1534 return i3c_config_get(dev, I3C_CONFIG_TARGET, config);
1535}
1536#endif /* CONFIG_I3C_TARGET */
1537#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1548static inline int i3c_recover_bus(const struct device *dev)
1549{
1550 const struct i3c_driver_api *api =
1551 (const struct i3c_driver_api *)dev->api;
1552
1553 if (api->recover_bus == NULL) {
1554 return -ENOSYS;
1555 }
1556
1557 return api->recover_bus(dev);
1558}
1559
1580
1605int i3c_reattach_i3c_device(struct i3c_device_desc *target, uint8_t old_dyn_addr);
1606
1627
1647
1666
1690static inline int i3c_do_daa(const struct device *dev)
1691{
1692 const struct i3c_driver_api *api =
1693 (const struct i3c_driver_api *)dev->api;
1694
1695 if (api->do_daa == NULL) {
1696 return -ENOSYS;
1697 }
1698
1699 return api->do_daa(dev);
1700}
1701
1715__syscall int i3c_do_ccc(const struct device *dev,
1716 struct i3c_ccc_payload *payload);
1717
1718static inline int z_impl_i3c_do_ccc(const struct device *dev,
1719 struct i3c_ccc_payload *payload)
1720{
1721 const struct i3c_driver_api *api =
1722 (const struct i3c_driver_api *)dev->api;
1723
1724 if (api->do_ccc == NULL) {
1725 return -ENOSYS;
1726 }
1727
1728 return api->do_ccc(dev, payload);
1729}
1730
1735
1762__syscall int i3c_transfer(struct i3c_device_desc *target,
1763 struct i3c_msg *msgs, uint8_t num_msgs);
1764
1765static inline int z_impl_i3c_transfer(struct i3c_device_desc *target,
1766 struct i3c_msg *msgs, uint8_t num_msgs)
1767{
1768 const struct i3c_driver_api *api =
1769 (const struct i3c_driver_api *)target->bus->api;
1770
1771 return api->i3c_xfers(target->bus, target, msgs, num_msgs);
1772}
1773
1775
1790static inline
1792 const struct i3c_device_id *id)
1793{
1794 const struct i3c_driver_api *api =
1795 (const struct i3c_driver_api *)dev->api;
1796
1797 if (api->i3c_device_find == NULL) {
1798 return NULL;
1799 }
1800
1801 return api->i3c_device_find(dev, id);
1802}
1803#endif /* CONFIG_I3C_CONTROLLER */
1804#if defined(CONFIG_I3C_USE_IBI) || defined(__DOXYGEN__)
1809
1810#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1823static inline int i3c_ibi_hj_response(const struct device *dev,
1824 bool ack)
1825{
1826 const struct i3c_driver_api *api =
1827 (const struct i3c_driver_api *)dev->api;
1828
1829 if (api->ibi_hj_response == NULL) {
1830 return -ENOSYS;
1831 }
1832
1833 return api->ibi_hj_response(dev, ack);
1834}
1835#endif /* CONFIG_I3C_CONTROLLER */
1836#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
1848static inline int i3c_ibi_raise(const struct device *dev,
1849 struct i3c_ibi *request)
1850{
1851 const struct i3c_driver_api *api =
1852 (const struct i3c_driver_api *)dev->api;
1853
1854 if (api->ibi_raise == NULL) {
1855 return -ENOSYS;
1856 }
1857
1858 return api->ibi_raise(dev, request);
1859}
1860#endif /* CONFIG_I3C_TARGET */
1861#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1876static inline int i3c_ibi_enable(struct i3c_device_desc *target)
1877{
1878 const struct i3c_driver_api *api =
1879 (const struct i3c_driver_api *)target->bus->api;
1880
1881 if (api->ibi_enable == NULL) {
1882 return -ENOSYS;
1883 }
1884
1885 return api->ibi_enable(target->bus, target);
1886}
1887
1900static inline int i3c_ibi_disable(struct i3c_device_desc *target)
1901{
1902 const struct i3c_driver_api *api =
1903 (const struct i3c_driver_api *)target->bus->api;
1904
1905 if (api->ibi_disable == NULL) {
1906 return -ENOSYS;
1907 }
1908
1909 return api->ibi_disable(target->bus, target);
1910}
1911#endif /* CONFIG_I3C_CONTROLLER */
1912#endif /* CONFIG_I3C_USE_IBI */
1924static inline int i3c_ibi_has_payload(struct i3c_device_desc *target)
1925{
1926 return (target->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE)
1928}
1929
1941static inline int i3c_device_is_ibi_capable(struct i3c_device_desc *target)
1942{
1943 return (target->bcr & I3C_BCR_IBI_REQUEST_CAPABLE)
1945}
1946
1958static inline int i3c_device_is_controller_capable(struct i3c_device_desc *target)
1959{
1960 return I3C_BCR_DEVICE_ROLE(target->bcr)
1962}
1963
1965#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
1970
1984static inline int i3c_write(struct i3c_device_desc *target,
1985 const uint8_t *buf, uint32_t num_bytes)
1986{
1987 struct i3c_msg msg;
1988
1989 msg.buf = (uint8_t *)buf;
1990 msg.len = num_bytes;
1992 msg.hdr_mode = 0;
1993 msg.hdr_cmd_code = 0;
1994
1995 return i3c_transfer(target, &msg, 1);
1996}
1997
2011static inline int i3c_read(struct i3c_device_desc *target,
2012 uint8_t *buf, uint32_t num_bytes)
2013{
2014 struct i3c_msg msg;
2015
2016 msg.buf = buf;
2017 msg.len = num_bytes;
2019 msg.hdr_mode = 0;
2020 msg.hdr_cmd_code = 0;
2021
2022 return i3c_transfer(target, &msg, 1);
2023}
2024
2042static inline int i3c_write_read(struct i3c_device_desc *target,
2043 const void *write_buf, size_t num_write,
2044 void *read_buf, size_t num_read)
2045{
2046 struct i3c_msg msg[2];
2047
2048 msg[0].buf = (uint8_t *)write_buf;
2049 msg[0].len = num_write;
2050 msg[0].flags = I3C_MSG_WRITE;
2051 msg[0].hdr_mode = 0;
2052 msg[0].hdr_cmd_code = 0;
2053
2054 msg[1].buf = (uint8_t *)read_buf;
2055 msg[1].len = num_read;
2057 msg[1].hdr_mode = 0;
2058 msg[1].hdr_cmd_code = 0;
2059
2060 return i3c_transfer(target, msg, 2);
2061}
2062
2080static inline int i3c_burst_read(struct i3c_device_desc *target,
2081 uint8_t start_addr,
2082 uint8_t *buf,
2083 uint32_t num_bytes)
2084{
2085 return i3c_write_read(target,
2086 &start_addr, sizeof(start_addr),
2087 buf, num_bytes);
2088}
2089
2110static inline int i3c_burst_write(struct i3c_device_desc *target,
2111 uint8_t start_addr,
2112 const uint8_t *buf,
2113 uint32_t num_bytes)
2114{
2115 struct i3c_msg msg[2];
2116
2117 msg[0].buf = &start_addr;
2118 msg[0].len = 1U;
2119 msg[0].flags = I3C_MSG_WRITE;
2120 msg[0].hdr_mode = 0;
2121 msg[0].hdr_cmd_code = 0;
2122
2123 msg[1].buf = (uint8_t *)buf;
2124 msg[1].len = num_bytes;
2125 msg[1].flags = I3C_MSG_WRITE | I3C_MSG_STOP;
2126 msg[1].hdr_mode = 0;
2127 msg[1].hdr_cmd_code = 0;
2128
2129 return i3c_transfer(target, msg, 2);
2130}
2131
2146static inline int i3c_reg_read_byte(struct i3c_device_desc *target,
2147 uint8_t reg_addr, uint8_t *value)
2148{
2149 return i3c_write_read(target,
2150 &reg_addr, sizeof(reg_addr),
2151 value, sizeof(*value));
2152}
2153
2171static inline int i3c_reg_write_byte(struct i3c_device_desc *target,
2172 uint8_t reg_addr, uint8_t value)
2173{
2174 uint8_t tx_buf[2] = {reg_addr, value};
2175
2176 return i3c_write(target, tx_buf, 2);
2177}
2178
2197static inline int i3c_reg_update_byte(struct i3c_device_desc *target,
2198 uint8_t reg_addr, uint8_t mask,
2199 uint8_t value)
2200{
2201 uint8_t old_value, new_value;
2202 int rc;
2203
2204 rc = i3c_reg_read_byte(target, reg_addr, &old_value);
2205 if (rc != 0) {
2206 return rc;
2207 }
2208
2209 new_value = (old_value & ~mask) | (value & mask);
2210 if (new_value == old_value) {
2211 return 0;
2212 }
2213
2214 return i3c_reg_write_byte(target, reg_addr, new_value);
2215}
2216
2241void i3c_dump_msgs(const char *name, const struct i3c_msg *msgs,
2242 uint8_t num_msgs, struct i3c_device_desc *target);
2243
2245
2261int i3c_bus_init(const struct device *dev,
2262 const struct i3c_dev_list *i3c_dev_list);
2263
2282
2306
2328static inline int i3c_device_info_get(struct i3c_device_desc *target)
2329{
2330 int rc;
2331
2332 rc = i3c_device_basic_info_get(target);
2333 if (rc != 0) {
2334 return rc;
2335 }
2336
2337 return i3c_device_adv_info_get(target);
2338}
2339
2350bool i3c_bus_has_sec_controller(const struct device *dev);
2351
2362int i3c_bus_rstdaa_all(const struct device *dev);
2363
2376int i3c_bus_setdasa(struct i3c_device_desc *desc, uint8_t dynamic_addr);
2377
2390int i3c_bus_setnewda(struct i3c_device_desc *desc, uint8_t dynamic_addr);
2391
2402int i3c_bus_setaasa(const struct device *dev);
2403
2415
2427
2439
2451
2463
2476int i3c_bus_setmrl(struct i3c_device_desc *desc, uint16_t mrl, uint8_t ibi_len);
2477
2490
2504int i3c_bus_setmrl_all(const struct device *dev, uint16_t mrl, uint8_t ibi_len, bool has_ibi_size);
2505
2517int i3c_bus_setmwl_all(const struct device *dev, uint16_t mwl);
2518
2519#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
2531
2543int i3c_bus_deftgts(const struct device *dev);
2544#endif /* CONFIG_I3C_TARGET */
2545
2556
2571int i3c_device_controller_handoff(struct i3c_device_desc *target, bool requested);
2572#endif /* CONFIG_I3C_CONTROLLER */
2573
2574#if defined(CONFIG_I3C_USE_IBI) || defined(__DOXYGEN__)
2575#if (defined(CONFIG_I3C_CONTROLLER) && defined(CONFIG_I3C_TARGET)) || defined(__DOXYGEN__)
2587void i3c_sec_handoffed(struct k_work *work);
2588#endif /* CONFIG_I3C_CONTROLLER && CONFIG_I3C_TARGET */
2589#endif /* CONFIG_I3C_USE_IBI */
2590
2591#if (defined(CONFIG_I3C_NUM_OF_DESC_MEM_SLABS) && CONFIG_I3C_NUM_OF_DESC_MEM_SLABS > 0) || \
2592 defined(__DOXYGEN__)
2593
2603
2612
2623
2624#else
2625
2626static inline struct i3c_device_desc *i3c_device_desc_alloc(void)
2627{
2628 return NULL;
2629}
2630
2631static inline void i3c_device_desc_free(struct i3c_device_desc *desc)
2632{
2633 ARG_UNUSED(desc);
2634}
2635
2636static inline bool i3c_device_desc_in_pool(struct i3c_device_desc *desc)
2637{
2638 ARG_UNUSED(desc);
2639 return false;
2640}
2641
2642#endif /* CONFIG_I3C_NUM_OF_DESC_MEM_SLABS > 0 */
2643
2644#if (defined(CONFIG_I3C_I2C_NUM_OF_DESC_MEM_SLABS) && CONFIG_I3C_I2C_NUM_OF_DESC_MEM_SLABS > 0) || \
2645 defined(__DOXYGEN__)
2646
2656
2665
2676
2677#else
2678
2679static inline struct i3c_i2c_device_desc *i3c_i2c_device_desc_alloc(void)
2680{
2681 return NULL;
2682}
2683
2684static inline void i3c_i2c_device_desc_free(struct i3c_i2c_device_desc *desc)
2685{
2686 ARG_UNUSED(desc);
2687}
2688
2689static inline bool i3c_i2c_device_desc_in_pool(struct i3c_i2c_device_desc *desc)
2690{
2691 ARG_UNUSED(desc);
2692 return false;
2693}
2694
2695#endif /* CONFIG_I3C_I2C_NUM_OF_DESC_MEM_SLABS > 0 */
2696
2697#if defined(CONFIG_I3C_RTIO) || defined(__DOXYGEN__)
2698
2700 const struct device *bus;
2701 const struct i3c_device_id dev_id;
2702};
2703
2714void i3c_iodev_submit_fallback(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe);
2715
2722static inline void i3c_iodev_submit(struct rtio_iodev_sqe *iodev_sqe)
2723{
2724 const struct i3c_iodev_data *data =
2725 (const struct i3c_iodev_data *)iodev_sqe->sqe.iodev->data;
2726 const struct i3c_driver_api *api = (const struct i3c_driver_api *)data->bus->api;
2727
2728 if (api->iodev_submit == NULL) {
2729 rtio_iodev_sqe_err(iodev_sqe, -ENOSYS);
2730 return;
2731 }
2732 api->iodev_submit(data->bus, iodev_sqe);
2733}
2734
2735extern const struct rtio_iodev_api i3c_iodev_api;
2736
2746#define I3C_DT_IODEV_DEFINE(name, node_id) \
2747 const struct i3c_iodev_data _i3c_iodev_data_##name = { \
2748 .bus = DEVICE_DT_GET(DT_BUS(node_id)), \
2749 .dev_id = I3C_DEVICE_ID_DT(node_id), \
2750 }; \
2751 RTIO_IODEV_DEFINE(name, &i3c_iodev_api, (void *)&_i3c_iodev_data_##name)
2752
2765 struct rtio_iodev *iodev,
2766 const struct i3c_msg *msgs,
2767 uint8_t num_msgs);
2768
2769#endif /* CONFIG_I3C_RTIO */
2770
2771#if defined(CONFIG_I3C_TARGET) || defined(__DOXYGEN__)
2772/*
2773 * This needs to be after declaration of struct i3c_driver_api,
2774 * or else compiler complains about undefined type inside
2775 * the static inline API wrappers.
2776 */
2778#endif /* CONFIG_I3C_TARGET */
2779
2780#if defined(CONFIG_I3C_CONTROLLER) || defined(__DOXYGEN__)
2781/*
2782 * Include High-Data-Rate (HDR) inline helper functions
2783 */
2785#endif /* CONFIG_I3C_CONTROLLER */
2786
2787#ifdef __cplusplus
2788}
2789#endif
2790
2794
2795#include <zephyr/syscalls/i3c.h>
2796
2797#endif /* ZEPHYR_INCLUDE_DRIVERS_I3C_H_ */
workaround assembler barfing for ST r
Definition asm-macro-32-bit-gnu.h:24
Main header file for I2C (Inter-Integrated Circuit) driver API.
System error numbers.
i3c_sdr_controller_error_types
I3C SDR Controller Error Types.
Definition error_types.h:24
static int i3c_ibi_disable(struct i3c_device_desc *target)
Disable IBI of a target device.
Definition i3c.h:1900
static int i3c_ibi_has_payload(struct i3c_device_desc *target)
Check if target's IBI has payload.
Definition i3c.h:1924
static int i3c_ibi_raise(const struct device *dev, struct i3c_ibi *request)
Raise an In-Band Interrupt (IBI).
Definition i3c.h:1848
static int i3c_device_is_controller_capable(struct i3c_device_desc *target)
Check if the target is controller capable.
Definition i3c.h:1958
static int i3c_device_is_ibi_capable(struct i3c_device_desc *target)
Check if device is IBI capable.
Definition i3c.h:1941
static int i3c_ibi_enable(struct i3c_device_desc *target)
Enable IBI of a target device.
Definition i3c.h:1876
int(* i3c_target_ibi_cb_t)(struct i3c_device_desc *target, struct i3c_ibi_payload *payload)
Function called when In-Band Interrupt received from target device.
Definition ibi.h:146
static int i3c_ibi_hj_response(const struct device *dev, bool ack)
ACK or NACK IBI HJ Requests.
Definition i3c.h:1823
int i3c_attach_i3c_device(struct i3c_device_desc *target)
Attach an I3C device.
#define I3C_BCR_IBI_REQUEST_CAPABLE
IBI Request Capable bit.
Definition i3c.h:103
#define I3C_BCR_DEVICE_ROLE_I3C_CONTROLLER_CAPABLE
Device Role - I3C Controller Capable.
Definition i3c.h:143
struct i3c_device_desc * i3c_dev_list_i3c_addr_find(const struct device *dev, uint8_t addr)
Find a I3C target device descriptor by dynamic address.
static struct i3c_device_desc * i3c_device_find(const struct device *dev, const struct i3c_device_id *id)
Find a registered I3C target device.
Definition i3c.h:1791
int i3c_bus_getpid(struct i3c_device_desc *desc)
Retrieve the Provisional ID (PID) of a device.
bool i3c_bus_has_sec_controller(const struct device *dev)
Check if the bus has a secondary controller.
int i3c_bus_rstdaa_all(const struct device *dev)
Reset all devices on the bus and clear their dynamic addresses.
struct i3c_i2c_device_desc * i3c_i2c_device_desc_alloc(void)
Allocate memory for a i3c i2c device descriptor.
void i3c_sec_handoffed(struct k_work *work)
Call back for when Controllership is Handoffed to itself.
void i3c_device_desc_free(struct i3c_device_desc *desc)
Free memory from a i3c device descriptor.
int i3c_bus_setmrl_all(const struct device *dev, uint16_t mrl, uint8_t ibi_len, bool has_ibi_size)
Set the Maximum Read Length (MRL) for all devices on the bus.
int i3c_bus_setdasa(struct i3c_device_desc *desc, uint8_t dynamic_addr)
Assign a dynamic address to a device using its static address.
static int i3c_configure(const struct device *dev, enum i3c_config_type type, void *config)
Configure the I3C hardware.
Definition i3c.h:1405
static int i3c_device_info_get(struct i3c_device_desc *target)
Get all information from device and update device descriptor.
Definition i3c.h:2328
int i3c_dev_list_daa_addr_helper(struct i3c_addr_slots *addr_slots, const struct i3c_dev_list *dev_list, uint64_t pid, bool must_match, bool assigned_okay, struct i3c_device_desc **target, uint8_t *addr)
Helper function to find a usable address during ENTDAA.
static void i3c_iodev_submit(struct rtio_iodev_sqe *iodev_sqe)
Submit request(s) to an I3C device with RTIO.
Definition i3c.h:2722
int i3c_device_adv_info_get(struct i3c_device_desc *target)
Get advanced information from device and update device descriptor.
int i3c_bus_getmrl(struct i3c_device_desc *desc)
Retrieve the Maximum Read Length (MRL) of a device.
int i3c_bus_deftgts(const struct device *dev)
Send the CCC DEFTGTS.
int i3c_bus_setnewda(struct i3c_device_desc *desc, uint8_t dynamic_addr)
Assign a new dynamic address to a device.
i3c_config_type
Type of configuration being passed to configure function.
Definition i3c.h:451
int i3c_attach_i2c_device(struct i3c_i2c_device_desc *target)
Attach an I2C device.
void i3c_i2c_device_desc_free(struct i3c_i2c_device_desc *desc)
Free memory from a i3c i2c device descriptor.
i3c_i2c_speed_type
I2C bus speed under I3C bus.
Definition i3c.h:274
int i3c_detach_i3c_device(struct i3c_device_desc *target)
Detach I3C Device.
int i3c_bus_setmrl(struct i3c_device_desc *desc, uint16_t mrl, uint8_t ibi_len)
Set the Maximum Read Length (MRL) for a device.
i3c_bus_mode
I3C bus mode.
Definition i3c.h:241
static int i3c_recover_bus(const struct device *dev)
Attempt bus recovery on the I3C bus.
Definition i3c.h:1548
static int i3c_configure_target(const struct device *dev, struct i3c_config_target *config)
Get the target device configuration for an I3C device.
Definition i3c.h:1455
int i3c_bus_setmwl(struct i3c_device_desc *desc, uint16_t mwl)
Set the Maximum Write Length (MWL) for a device.
static int i3c_config_get(const struct device *dev, enum i3c_config_type type, void *config)
Get configuration of the I3C hardware.
Definition i3c.h:1481
int i3c_bus_getacccr(struct i3c_device_desc *desc)
Retrieve the Active Controller's Dynamic Address (ACCCR).
int i3c_bus_getmwl(struct i3c_device_desc *desc)
Retrieve the Maximum Write Length (MWL) of a device.
int i3c_detach_i2c_device(struct i3c_i2c_device_desc *target)
Detach I2C Device.
static int i3c_config_get_target(const struct device *dev, struct i3c_config_target *config)
Get the target device configuration for an I3C device.
Definition i3c.h:1531
#define I3C_BCR_DEVICE_ROLE(bcr)
Device Role.
Definition i3c.h:155
void i3c_iodev_submit_fallback(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
Fallback submit implementation.
static int i3c_config_get_controller(const struct device *dev, struct i3c_config_controller *config)
Get the controller device configuration for an I3C device.
Definition i3c.h:1509
struct i3c_device_desc * i3c_dev_list_find(const struct i3c_dev_list *dev_list, const struct i3c_device_id *id)
Find a I3C target device descriptor by ID.
int i3c_bus_init(const struct device *dev, const struct i3c_dev_list *i3c_dev_list)
Generic helper function to perform bus initialization.
int i3c_do_ccc(const struct device *dev, struct i3c_ccc_payload *payload)
Send CCC to the bus.
int i3c_bus_getdcr(struct i3c_device_desc *desc)
Retrieve the Device Characteristics Register (DCR) of a device.
int i3c_device_basic_info_get(struct i3c_device_desc *target)
Get basic information from device and update device descriptor.
uint8_t i3c_odd_parity(uint8_t p)
Calculate odd parity.
struct rtio_sqe * i3c_rtio_copy(struct rtio *r, struct rtio_iodev *iodev, const struct i3c_msg *msgs, uint8_t num_msgs)
Copy the i3c_msgs into a set of RTIO requests.
int i3c_bus_setaasa(const struct device *dev)
Assign static addresses as dynamic addresses for all devices on the bus.
struct i3c_device_desc * i3c_device_desc_alloc(void)
Allocate memory for a i3c device descriptor.
static int i3c_do_daa(const struct device *dev)
Perform Dynamic Address Assignment on the I3C bus.
Definition i3c.h:1690
bool i3c_i2c_device_desc_in_pool(struct i3c_i2c_device_desc *desc)
Report if the i3c i2c device descriptor was from a mem slab.
int i3c_bus_getbcr(struct i3c_device_desc *desc)
Retrieve the Bus Characteristics Register (BCR) of a device.
const struct rtio_iodev_api i3c_iodev_api
int i3c_bus_setmwl_all(const struct device *dev, uint16_t mwl)
Set the Maximum Write Length (MWL) for all devices on the bus.
#define I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE
IBI Payload bit.
Definition i3c.h:112
int i3c_reattach_i3c_device(struct i3c_device_desc *target, uint8_t old_dyn_addr)
Reattach I3C device.
i3c_data_rate
I3C data rate.
Definition i3c.h:290
static int i3c_configure_controller(const struct device *dev, struct i3c_config_controller *config)
Get the controller device configuration for an I3C device.
Definition i3c.h:1433
struct i3c_device_desc * i3c_dev_list_i3c_static_addr_find(const struct device *dev, uint8_t addr)
Find a I3C target device descriptor by static address.
int i3c_device_controller_handoff(struct i3c_device_desc *target, bool requested)
Perform Controller Handoff.
bool i3c_device_desc_in_pool(struct i3c_device_desc *desc)
Report if the i3c device descriptor was from a mem slab.
struct i3c_i2c_device_desc * i3c_dev_list_i2c_addr_find(const struct device *dev, uint16_t addr)
Find a I2C target device descriptor by address.
@ I3C_CONFIG_TARGET
Definition i3c.h:453
@ I3C_CONFIG_CUSTOM
Definition i3c.h:454
@ I3C_CONFIG_CONTROLLER
Definition i3c.h:452
@ I3C_I2C_SPEED_INVALID
Definition i3c.h:282
@ I3C_I2C_SPEED_MAX
Definition i3c.h:281
@ I3C_I2C_SPEED_FMPLUS
I2C FM+ mode.
Definition i3c.h:279
@ I3C_I2C_SPEED_FM
I2C FM mode.
Definition i3c.h:276
@ I3C_BUS_MODE_INVALID
Definition i3c.h:266
@ I3C_BUS_MODE_PURE
Only I3C devices are on the bus.
Definition i3c.h:243
@ I3C_BUS_MODE_MIXED_FAST
Both I3C and legacy I2C devices are on the bus.
Definition i3c.h:249
@ I3C_BUS_MODE_MAX
Definition i3c.h:265
@ I3C_BUS_MODE_MIXED_LIMITED
Both I3C and legacy I2C devices are on the bus.
Definition i3c.h:256
@ I3C_BUS_MODE_MIXED_SLOW
Both I3C and legacy I2C devices are on the bus.
Definition i3c.h:263
@ I3C_DATA_RATE_MAX
Definition i3c.h:306
@ I3C_DATA_RATE_INVALID
Definition i3c.h:307
@ I3C_DATA_RATE_HDR_TSP
High Data Rate - Ternary Symbol for Pure Bus.
Definition i3c.h:301
@ I3C_DATA_RATE_HDR_DDR
High Data Rate - Double Data Rate messaging.
Definition i3c.h:295
@ I3C_DATA_RATE_SDR
Single Data Rate messaging.
Definition i3c.h:292
@ I3C_DATA_RATE_HDR_TSL
High Data Rate - Ternary Symbol Legacy-inclusive-Bus.
Definition i3c.h:298
@ I3C_DATA_RATE_HDR_BT
High Data Rate - Bulk Transport.
Definition i3c.h:304
int i3c_transfer(struct i3c_device_desc *target, struct i3c_msg *msgs, uint8_t num_msgs)
Perform data transfer from the controller to a I3C target device.
#define I3C_MSG_STOP
Send STOP after this message.
Definition i3c.h:331
static int i3c_write_read(struct i3c_device_desc *target, const void *write_buf, size_t num_write, void *read_buf, size_t num_read)
Write then read data from an I3C target device.
Definition i3c.h:2042
static int i3c_burst_read(struct i3c_device_desc *target, uint8_t start_addr, uint8_t *buf, uint32_t num_bytes)
Read multiple bytes from an internal address of an I3C target device.
Definition i3c.h:2080
static int i3c_reg_update_byte(struct i3c_device_desc *target, uint8_t reg_addr, uint8_t mask, uint8_t value)
Update internal register of an I3C target device.
Definition i3c.h:2197
void i3c_dump_msgs(const char *name, const struct i3c_msg *msgs, uint8_t num_msgs, struct i3c_device_desc *target)
Dump out an I3C message.
#define I3C_MSG_READ
Read message from I3C bus.
Definition i3c.h:324
#define I3C_MSG_WRITE
Write message to I3C bus.
Definition i3c.h:321
static int i3c_reg_read_byte(struct i3c_device_desc *target, uint8_t reg_addr, uint8_t *value)
Read internal register of an I3C target device.
Definition i3c.h:2146
static int i3c_write(struct i3c_device_desc *target, const uint8_t *buf, uint32_t num_bytes)
Write a set amount of data to an I3C target device.
Definition i3c.h:1984
static int i3c_read(struct i3c_device_desc *target, uint8_t *buf, uint32_t num_bytes)
Read a set amount of data from an I3C target device.
Definition i3c.h:2011
#define I3C_MSG_RESTART
RESTART I3C transaction for this message.
Definition i3c.h:342
static int i3c_burst_write(struct i3c_device_desc *target, uint8_t start_addr, const uint8_t *buf, uint32_t num_bytes)
Write multiple bytes to an internal address of an I3C target device.
Definition i3c.h:2110
static int i3c_reg_write_byte(struct i3c_device_desc *target, uint8_t reg_addr, uint8_t value)
Write internal register of an I3C target device.
Definition i3c.h:2171
static void rtio_iodev_sqe_err(struct rtio_iodev_sqe *iodev_sqe, int result)
Inform the executor of a submissions completion with error.
Definition rtio.h:1359
struct _slist sys_slist_t
Single-linked list structure.
Definition slist.h:49
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define ENOSYS
Function not implemented.
Definition errno.h:82
#define NULL
Definition iar_missing_defs.h:20
#define BUILD_ASSERT(EXPR, MSG...)
Definition llvm.h:51
int accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
Real-Time IO device API for moving bytes with low effort.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:510
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:516
Structure to keep track of addresses on I3C bus.
Definition addresses.h:58
Payload for DEFTGTS CCC (Define List of Targets).
Definition ccc.h:477
Payload structure for one CCC transaction.
Definition ccc.h:283
Configuration parameters for I3C hardware to act as controller.
Definition i3c.h:460
struct i3c_config_controller::@171175234007106124341357122051356217163277103172 scl_od_min
uint32_t i3c
SCL frequency (in Hz) for I3C transfers.
Definition i3c.h:469
uint8_t supported_hdr
Bit mask of supported HDR modes (0 - 7).
Definition i3c.h:497
bool is_secondary
True if the controller is to be the secondary controller of the bus.
Definition i3c.h:465
uint32_t i2c
SCL frequency (in Hz) for I2C transfers.
Definition i3c.h:472
uint32_t low_ns
Requested minimum SCL Open-Drain LOW period in nanoseconds.
Definition i3c.h:488
struct i3c_config_controller::@056135366137020063162136324011126070110331100007 scl
uint32_t high_ns
Requested minimum SCL Open Drain High period in Nanoseconds.
Definition i3c.h:483
Custom I3C configuration parameters.
Definition i3c.h:508
void * ptr
Pointer to configuration parameter.
Definition i3c.h:522
uint32_t id
ID of the configuration parameter.
Definition i3c.h:510
uintptr_t val
Value of configuration parameter.
Definition i3c.h:514
Configuration parameters for I3C hardware to act as target device.
Definition target_device.h:36
Structure for describing attached devices for a controller.
Definition i3c.h:1158
sys_slist_t i3c
Linked list of attached I3C devices.
Definition i3c.h:1171
struct i3c_dev_attached_list::@376142005326063102166306177206174071064206117170 devices
sys_slist_t i2c
Linked list of attached I2C devices.
Definition i3c.h:1176
struct i3c_addr_slots addr_slots
Address slots:
Definition i3c.h:1165
Structure for describing known devices for a controller.
Definition i3c.h:1188
struct i3c_i2c_device_desc *const i2c
Pointer to array of known I2C devices.
Definition i3c.h:1197
const uint8_t num_i3c
Number of I3C devices in array.
Definition i3c.h:1202
struct i3c_device_desc *const i3c
Pointer to array of known I3C devices.
Definition i3c.h:1192
const uint8_t num_i2c
Number of I2C devices in array.
Definition i3c.h:1207
Structure describing a I3C target device.
Definition i3c.h:924
uint8_t maxwr
Maximum Write Speed.
Definition i3c.h:1004
const uint8_t init_dynamic_addr
Initial dynamic address.
Definition i3c.h:959
uint8_t getcap1
I3C v1.1+ GETCAPS1 (I3C_CCC_GETCAPS1_*)
Definition i3c.h:1044
uint8_t static_addr
Static address for this target device.
Definition i3c.h:948
uint8_t getcap2
GETCAPS2 (I3C_CCC_GETCAPS2_*)
Definition i3c.h:1054
uint8_t crcaps2
CRCAPS2.
Definition i3c.h:1095
uint32_t max_read_turnaround
Maximum Read turnaround time in microseconds.
Definition i3c.h:1007
uint8_t getcap4
GETCAPS4.
Definition i3c.h:1073
uint64_t pid
Device Provisioned ID.
Definition i3c.h:934
uint8_t max_ibi
Maximum IBI Payload Size.
Definition i3c.h:1018
struct i3c_device_desc::@171122044300150030070232076155234262120067102161 getcaps
Describes advanced (Target) capabilities and features.
i3c_target_ibi_cb_t ibi_cb
In-Band Interrupt (IBI) callback.
Definition i3c.h:1110
uint16_t mwl
Maximum Write Length.
Definition i3c.h:1015
struct i3c_device_desc::@374166210137153225365322260210124156025250214226 data_speed
struct i3c_device_desc::@354012327114236120073125301213366107212276207024 crcaps
uint8_t crhdly1
Controller Handoff Delay Parameters.
Definition i3c.h:1022
uint8_t getcap3
GETCAPS3 (I3C_CCC_GETCAPS3_*)
Definition i3c.h:1067
uint8_t dynamic_addr
Dynamic Address for this target device used for communication.
Definition i3c.h:983
uint8_t crcaps1
CRCAPS1.
Definition i3c.h:1085
const uint8_t flags
Device Flags.
Definition i3c.h:968
sys_snode_t node
Definition i3c.h:925
const struct device * bus
I3C bus to which this target device is attached.
Definition i3c.h:928
struct i3c_device_desc::@025161371003043020356247061065002050371177151366 data_length
uint16_t mrl
Maximum Read Length.
Definition i3c.h:1012
uint8_t maxrd
Maximum Read Speed.
Definition i3c.h:1001
uint8_t gethdrcap
I3C v1.0 HDR Capabilities (I3C_CCC_GETCAPS1_*)
Definition i3c.h:1034
uint8_t bcr
Bus Characteristic Register (BCR)
Definition i3c.h:989
uint8_t dcr
Device Characteristic Register (DCR)
Definition i3c.h:997
const struct device * dev
Device driver instance of the I3C device.
Definition i3c.h:931
Structure used for matching I3C devices.
Definition i3c.h:890
uint64_t pid
Device Provisioned ID.
Definition i3c.h:892
This structure is common to all I3C drivers and is expected to be the first element in the object poi...
Definition i3c.h:1215
uint8_t primary_controller_da
I3C Primary Controller Dynamic Address.
Definition i3c.h:1221
struct i3c_dev_list dev_list
I3C/I2C device list struct.
Definition i3c.h:1218
This structure is common to all I3C drivers and is expected to be the first element in the driver's s...
Definition i3c.h:1236
struct i3c_config_controller ctrl_config
Controller Configuration.
Definition i3c.h:1238
struct i3c_ccc_deftgts * deftgts
Received DEFTGTS Pointer.
Definition i3c.h:1244
bool deftgts_refreshed
DEFTGTS refreshed.
Definition i3c.h:1247
struct i3c_dev_attached_list attached_dev
Attached I3C/I2C devices and addresses.
Definition i3c.h:1241
Structure describing a I2C device on I3C bus.
Definition i3c.h:1127
const struct device * bus
I3C bus to which this I2C device is attached.
Definition i3c.h:1131
uint8_t lvr
Legacy Virtual Register (LVR)
Definition i3c.h:1140
uint16_t addr
Static address for this I2C device.
Definition i3c.h:1134
sys_snode_t node
Definition i3c.h:1128
Struct for IBI request.
Definition ibi.h:58
Definition i3c.h:2699
const struct device * bus
Definition i3c.h:2700
const struct i3c_device_id dev_id
Definition i3c.h:2701
One I3C Message.
Definition i3c.h:407
uint8_t flags
Flags for this message.
Definition i3c.h:432
uint8_t hdr_mode
HDR mode (I3C_MSG_HDR_MODE*) for transfer if any I3C_MSG_HDR_* is set in flags.
Definition i3c.h:440
uint32_t num_xfer
Total number of bytes transferred.
Definition i3c.h:421
uint8_t * buf
Data buffer in bytes.
Definition i3c.h:409
uint8_t hdr_cmd_code
HDR command code field (7-bit) for HDR-DDR, HDR-TSP and HDR-TSL.
Definition i3c.h:443
uint32_t len
Length of buffer in bytes.
Definition i3c.h:412
enum i3c_sdr_controller_error_types err
SDR Error Type.
Definition i3c.h:429
Structure describing a device that supports the I3C target API.
Definition target_device.h:102
A structure used to submit work.
Definition kernel.h:4293
API that an RTIO IO device should implement.
Definition rtio.h:525
Compute the mempool block index for a given pointer.
Definition rtio.h:515
struct rtio_sqe sqe
Definition rtio.h:516
An IO device with a function table for submitting requests.
Definition rtio.h:540
void * data
Definition rtio.h:545
A submission queue event.
Definition rtio.h:296
const struct rtio_iodev * iodev
Device to operation on.
Definition rtio.h:305
An RTIO context containing what can be viewed as a pair of queues.
Definition rtio.h:419
Misc utilities.