Zephyr Project API  3.4.0
A Scalable Open Source RTOS
i3c.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_I3C_H_
8#define ZEPHYR_INCLUDE_DRIVERS_I3C_H_
9
17#include <zephyr/types.h>
18#include <zephyr/device.h>
19
24#include <zephyr/drivers/i2c.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/*
31 * Bus Characteristic Register (BCR)
32 * - BCR[7:6]: Device Role
33 * - 0: I3C Target
34 * - 1: I3C Controller capable
35 * - 2: Reserved
36 * - 3: Reserved
37 * - BCR[5]: Advanced Capabilities
38 * - 0: Does not support optional advanced capabilities.
39 * - 1: Supports optional advanced capabilities which
40 * can be viewed via GETCAPS CCC.
41 * - BCR[4}: Virtual Target Support
42 * - 0: Is not a virtual target.
43 * - 1: Is a virtual target.
44 * - BCR[3]: Offline Capable
45 * - 0: Will always response to I3C commands.
46 * - 1: Will not always response to I3C commands.
47 * - BCR[2]: IBI Payload
48 * - 0: No data bytes following the accepted IBI.
49 * - 1: One data byte (MDB, Mandatory Data Byte) follows
50 * the accepted IBI. Additional data bytes may also
51 * follows.
52 * - BCR[1]: IBI Request Capable
53 * - 0: Not capable
54 * - 1: Capable
55 * - BCR[0]: Max Data Speed Limitation
56 * - 0: No Limitation
57 * - 1: Limitation obtained via GETMXDS CCC.
58 */
59#define I3C_BCR_MAX_DATA_SPEED_LIMIT BIT(0)
60#define I3C_BCR_IBI_REQUEST_CAPABLE BIT(1)
61#define I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE BIT(2)
62#define I3C_BCR_OFFLINE_CAPABLE BIT(3)
63#define I3C_BCR_VIRTUAL_TARGET BIT(4)
64#define I3C_BCR_ADV_CAPABILITIES BIT(5)
65
66#define I3C_BCR_DEVICE_ROLE_I3C_TARGET 0U
67#define I3C_BCR_DEVICE_ROLE_I3C_CONTROLLER_CAPABLE 1U
68
69#define I3C_BCR_DEVICE_ROLE_SHIFT 6U
70#define I3C_BCR_DEVICE_ROLE_MASK (0x03U << I3C_BCR_DEVICE_ROLE_SHIFT)
71
72#define I3C_BCR_DEVICE_ROLE(bcr) \
73 (((bcr) & I3C_BCR_DEVICE_ROLE_MASK) >> I3C_BCR_DEVICE_ROLE_SHIFT)
74
75/*
76 * Legacy Virtual Register (LVR)
77 * - LVR[7:5]: I2C device index:
78 * - 0: I2C device has a 50 ns spike filter where
79 * it is not affected by high frequency on SCL.
80 * - 1: I2C device does not have a 50 ns spike filter
81 * but can work with high frequency on SCL.
82 * - 2: I2C device does not have a 50 ns spike filter
83 * and cannot work with high frequency on SCL.
84 * - LVR[4]: I2C mode indicator:
85 * - 0: FM+ mode
86 * - 1: FM mode
87 * - LVR[3:0]: Reserved.
88 */
89#define I3C_DCR_I2C_FM_PLUS_MODE 0
90#define I3C_DCR_I2C_FM_MODE 1
91
92#define I3C_DCR_I2C_MODE_SHIFT 4
93#define I3C_DCR_I2C_MODE_MASK BIT(4)
94
95#define I3C_DCR_I2C_MODE(dcr) \
96 (((mode) & I3C_DCR_I2C_MODE_MASK) >> I3C_DCR_I2C_MODE_SHIFT)
97
98#define I3C_DCR_I2C_DEV_IDX_0 0
99#define I3C_DCR_I2C_DEV_IDX_1 1
100#define I3C_DCR_I2C_DEV_IDX_2 2
101
102#define I3C_DCR_I2C_DEV_IDX_SHIFT 5
103#define I3C_DCR_I2C_DEV_IDX_MASK (0x07U << I3C_DCR_I2C_DEV_IDX_SHIFT)
104
105#define I3C_DCR_I2C_DEV_IDX(dcr) \
106 (((dcr) & I3C_DCR_I2C_DEV_IDX_MASK) >> I3C_DCR_I2C_DEV_IDX_SHIFT)
107
114
120
127
134
137};
138
147
150
153};
154
163
166
169
172
175
178};
179
193
196
199
202
205
208
211};
212
229
232
235
238
241
244
247
250
253
256
259};
260
261/*
262 * I3C_MSG_* are I3C Message flags.
263 */
264
266#define I3C_MSG_WRITE (0U << 0U)
267
269#define I3C_MSG_READ BIT(0)
270
272#define I3C_MSG_RW_MASK BIT(0)
276#define I3C_MSG_STOP BIT(1)
277
287#define I3C_MSG_RESTART BIT(2)
288
290#define I3C_MSG_HDR BIT(3)
291
293#define I3C_MSG_NBCH BIT(4)
294
296#define I3C_MSG_HDR_MODE0 BIT(0)
297
299#define I3C_MSG_HDR_MODE1 BIT(1)
300
302#define I3C_MSG_HDR_MODE2 BIT(2)
303
305#define I3C_MSG_HDR_MODE3 BIT(3)
306
308#define I3C_MSG_HDR_MODE4 BIT(4)
309
311#define I3C_MSG_HDR_MODE5 BIT(5)
312
314#define I3C_MSG_HDR_MODE6 BIT(6)
315
317#define I3C_MSG_HDR_MODE7 BIT(7)
318
320#define I3C_MSG_HDR_DDR I3C_MSG_HDR_MODE0
321
323#define I3C_MSG_HDR_TSP I3C_MSG_HDR_MODE1
324
326#define I3C_MSG_HDR_TSL I3C_MSG_HDR_MODE2
327
329#define I3C_MSG_HDR_BT I3C_MSG_HDR_MODE3
330
345struct i3c_msg {
348
351
354
362};
363
371};
372
382
383 struct {
386
390
398};
399
411
412 union {
415
422 void *ptr;
423 };
424};
425
432struct i3c_device_desc;
433struct i3c_device_id;
435struct i3c_target_config;
436
437__subsystem struct i3c_driver_api {
445 struct i2c_driver_api i2c_api;
446
459 int (*configure)(const struct device *dev,
460 enum i3c_config_type type, void *config);
461
474 int (*config_get)(const struct device *dev,
475 enum i3c_config_type type, void *config);
476
488 int (*recover_bus)(const struct device *dev);
489
503 int (*attach_i3c_device)(const struct device *dev,
504 struct i3c_device_desc *target,
505 uint8_t addr);
506
520 int (*reattach_i3c_device)(const struct device *dev,
521 struct i3c_device_desc *target,
522 uint8_t old_dyn_addr);
523
536 int (*detach_i3c_device)(const struct device *dev,
537 struct i3c_device_desc *target);
538
551 int (*attach_i2c_device)(const struct device *dev,
553
566 int (*detach_i2c_device)(const struct device *dev,
568
580 int (*do_daa)(const struct device *dev);
581
594 int (*do_ccc)(const struct device *dev,
595 struct i3c_ccc_payload *payload);
596
609 int (*i3c_xfers)(const struct device *dev,
610 struct i3c_device_desc *target,
611 struct i3c_msg *msgs,
612 uint8_t num_msgs);
613
627 struct i3c_device_desc *(*i3c_device_find)(const struct device *dev,
628 const struct i3c_device_id *id);
629
642 int (*ibi_raise)(const struct device *dev,
643 struct i3c_ibi *request);
644
657 int (*ibi_enable)(const struct device *dev,
658 struct i3c_device_desc *target);
659
672 int (*ibi_disable)(const struct device *dev,
673 struct i3c_device_desc *target);
674
690 int (*target_register)(const struct device *dev,
691 struct i3c_target_config *cfg);
692
708 int (*target_unregister)(const struct device *dev,
709 struct i3c_target_config *cfg);
710
726 int (*target_tx_write)(const struct device *dev,
727 uint8_t *buf, uint16_t len);
728};
729
739 const uint64_t pid:48;
740};
741
750#define I3C_DEVICE_ID(pid) \
751 { \
752 .pid = pid \
753 }
754
775
777 const struct device * const bus;
778
780 const struct device * const dev;
781
783 const uint64_t pid:48;
784
798
809
824
825#if defined(CONFIG_I3C_USE_GROUP_ADDR) || defined(__DOXYGEN__)
834#endif /* CONFIG_I3C_USE_GROUP_ADDR */
835
866
874
875 struct {
878
881
885
886 struct {
889
892
896
899
900#if defined(CONFIG_I3C_USE_IBI) || defined(__DOXYGEN__)
905#endif /* CONFIG_I3C_USE_IBI */
906};
907
924
926 const struct device *bus;
927
930
946
949};
950
967
968 struct {
973
979};
980
993 struct i3c_device_desc * const i3c;
994
998 struct i3c_i2c_device_desc * const i2c;
999
1004
1009};
1010
1019};
1020
1028
1031};
1032
1045struct i3c_device_desc *i3c_dev_list_find(const struct i3c_dev_list *dev_list,
1046 const struct i3c_device_id *id);
1047
1061 uint8_t addr);
1062
1076 uint16_t addr);
1077
1092
1145 const struct i3c_dev_list *dev_list,
1146 uint64_t pid, bool must_match,
1147 bool assigned_okay,
1148 struct i3c_device_desc **target,
1149 uint8_t *addr);
1150
1164static inline int i3c_configure(const struct device *dev,
1165 enum i3c_config_type type, void *config)
1166{
1167 const struct i3c_driver_api *api =
1168 (const struct i3c_driver_api *)dev->api;
1169
1170 if (api->configure == NULL) {
1171 return -ENOSYS;
1172 }
1173
1174 return api->configure(dev, type, config);
1175}
1176
1197static inline int i3c_config_get(const struct device *dev,
1198 enum i3c_config_type type, void *config)
1199{
1200 const struct i3c_driver_api *api =
1201 (const struct i3c_driver_api *)dev->api;
1202
1203 if (api->config_get == NULL) {
1204 return -ENOSYS;
1205 }
1206
1207 return api->config_get(dev, type, config);
1208}
1209
1220static inline int i3c_recover_bus(const struct device *dev)
1221{
1222 const struct i3c_driver_api *api =
1223 (const struct i3c_driver_api *)dev->api;
1224
1225 if (api->recover_bus == NULL) {
1226 return -ENOSYS;
1227 }
1228
1229 return api->recover_bus(dev);
1230}
1231
1252
1278
1299
1319
1338
1362static inline int i3c_do_daa(const struct device *dev)
1363{
1364 const struct i3c_driver_api *api =
1365 (const struct i3c_driver_api *)dev->api;
1366
1367 if (api->do_daa == NULL) {
1368 return -ENOSYS;
1369 }
1370
1371 return api->do_daa(dev);
1372}
1373
1387__syscall int i3c_do_ccc(const struct device *dev,
1388 struct i3c_ccc_payload *payload);
1389
1390static inline int z_impl_i3c_do_ccc(const struct device *dev,
1391 struct i3c_ccc_payload *payload)
1392{
1393 const struct i3c_driver_api *api =
1394 (const struct i3c_driver_api *)dev->api;
1395
1396 if (api->do_ccc == NULL) {
1397 return -ENOSYS;
1398 }
1399
1400 return api->do_ccc(dev, payload);
1401}
1402
1430 struct i3c_msg *msgs, uint8_t num_msgs);
1431
1432static inline int z_impl_i3c_transfer(struct i3c_device_desc *target,
1433 struct i3c_msg *msgs, uint8_t num_msgs)
1434{
1435 const struct i3c_driver_api *api =
1436 (const struct i3c_driver_api *)target->bus->api;
1437
1438 return api->i3c_xfers(target->bus, target, msgs, num_msgs);
1439}
1440
1455static inline
1457 const struct i3c_device_id *id)
1458{
1459 const struct i3c_driver_api *api =
1460 (const struct i3c_driver_api *)dev->api;
1461
1462 if (api->i3c_device_find == NULL) {
1463 return NULL;
1464 }
1465
1466 return api->i3c_device_find(dev, id);
1467}
1468
1480static inline int i3c_ibi_raise(const struct device *dev,
1481 struct i3c_ibi *request)
1482{
1483 const struct i3c_driver_api *api =
1484 (const struct i3c_driver_api *)dev->api;
1485
1486 if (api->ibi_raise == NULL) {
1487 return -ENOSYS;
1488 }
1489
1490 return api->ibi_raise(dev, request);
1491}
1492
1507static inline int i3c_ibi_enable(struct i3c_device_desc *target)
1508{
1509 const struct i3c_driver_api *api =
1510 (const struct i3c_driver_api *)target->bus->api;
1511
1512 if (api->ibi_enable == NULL) {
1513 return -ENOSYS;
1514 }
1515
1516 return api->ibi_enable(target->bus, target);
1517}
1518
1531static inline int i3c_ibi_disable(struct i3c_device_desc *target)
1532{
1533 const struct i3c_driver_api *api =
1534 (const struct i3c_driver_api *)target->bus->api;
1535
1536 if (api->ibi_disable == NULL) {
1537 return -ENOSYS;
1538 }
1539
1540 return api->ibi_disable(target->bus, target);
1541}
1542
1555{
1558}
1559
1572{
1573 return (target->bcr & I3C_BCR_IBI_REQUEST_CAPABLE)
1575}
1576
1590static inline int i3c_write(struct i3c_device_desc *target,
1591 const uint8_t *buf, uint32_t num_bytes)
1592{
1593 struct i3c_msg msg;
1594
1595 msg.buf = (uint8_t *)buf;
1596 msg.len = num_bytes;
1597 msg.flags = I3C_MSG_WRITE | I3C_MSG_STOP;
1598
1599 return i3c_transfer(target, &msg, 1);
1600}
1601
1615static inline int i3c_read(struct i3c_device_desc *target,
1616 uint8_t *buf, uint32_t num_bytes)
1617{
1618 struct i3c_msg msg;
1619
1620 msg.buf = buf;
1621 msg.len = num_bytes;
1622 msg.flags = I3C_MSG_READ | I3C_MSG_STOP;
1623
1624 return i3c_transfer(target, &msg, 1);
1625}
1626
1644static inline int i3c_write_read(struct i3c_device_desc *target,
1645 const void *write_buf, size_t num_write,
1646 void *read_buf, size_t num_read)
1647{
1648 struct i3c_msg msg[2];
1649
1650 msg[0].buf = (uint8_t *)write_buf;
1651 msg[0].len = num_write;
1652 msg[0].flags = I3C_MSG_WRITE;
1653
1654 msg[1].buf = (uint8_t *)read_buf;
1655 msg[1].len = num_read;
1657
1658 return i3c_transfer(target, msg, 2);
1659}
1660
1678static inline int i3c_burst_read(struct i3c_device_desc *target,
1679 uint8_t start_addr,
1680 uint8_t *buf,
1681 uint32_t num_bytes)
1682{
1683 return i3c_write_read(target,
1684 &start_addr, sizeof(start_addr),
1685 buf, num_bytes);
1686}
1687
1708static inline int i3c_burst_write(struct i3c_device_desc *target,
1709 uint8_t start_addr,
1710 const uint8_t *buf,
1711 uint32_t num_bytes)
1712{
1713 struct i3c_msg msg[2];
1714
1715 msg[0].buf = &start_addr;
1716 msg[0].len = 1U;
1717 msg[0].flags = I3C_MSG_WRITE;
1718
1719 msg[1].buf = (uint8_t *)buf;
1720 msg[1].len = num_bytes;
1721 msg[1].flags = I3C_MSG_WRITE | I3C_MSG_STOP;
1722
1723 return i3c_transfer(target, msg, 2);
1724}
1725
1740static inline int i3c_reg_read_byte(struct i3c_device_desc *target,
1741 uint8_t reg_addr, uint8_t *value)
1742{
1743 return i3c_write_read(target,
1744 &reg_addr, sizeof(reg_addr),
1745 value, sizeof(*value));
1746}
1747
1766 uint8_t reg_addr, uint8_t value)
1767{
1768 uint8_t tx_buf[2] = {reg_addr, value};
1769
1770 return i3c_write(target, tx_buf, 2);
1771}
1772
1792 uint8_t reg_addr, uint8_t mask,
1793 uint8_t value)
1794{
1795 uint8_t old_value, new_value;
1796 int rc;
1797
1798 rc = i3c_reg_read_byte(target, reg_addr, &old_value);
1799 if (rc != 0) {
1800 return rc;
1801 }
1802
1803 new_value = (old_value & ~mask) | (value & mask);
1804 if (new_value == old_value) {
1805 return 0;
1806 }
1807
1808 return i3c_reg_write_byte(target, reg_addr, new_value);
1809}
1810
1835void i3c_dump_msgs(const char *name, const struct i3c_msg *msgs,
1836 uint8_t num_msgs, struct i3c_device_desc *target);
1837
1853int i3c_bus_init(const struct device *dev,
1854 const struct i3c_dev_list *i3c_dev_list);
1855
1876
1877/*
1878 * This needs to be after declaration of struct i3c_driver_api,
1879 * or else compiler complains about undefined type inside
1880 * the static inline API wrappers.
1881 */
1883
1884#ifdef __cplusplus
1885}
1886#endif
1887
1892#include <syscalls/i3c.h>
1893
1894#endif /* ZEPHYR_INCLUDE_DRIVERS_I3C_H_ */
Public APIs for the I2C drivers.
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:148
static int i3c_ibi_disable(struct i3c_device_desc *target)
Disable IBI of a target device.
Definition: i3c.h:1531
int i3c_attach_i3c_device(struct i3c_device_desc *target)
Attach an I3C device.
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_BCR_IBI_REQUEST_CAPABLE
Definition: i3c.h:60
#define I3C_MSG_STOP
Definition: i3c.h:276
static struct i3c_device_desc * i3c_device_find(const struct device *dev, const struct i3c_device_id *id)
Definition: i3c.h:1456
static int i3c_ibi_has_payload(struct i3c_device_desc *target)
Check if target's IBI has payload.
Definition: i3c.h:1554
i3c_sdr_target_error_codes
I3C SDR Target Error Codes.
Definition: i3c.h:223
static int i3c_configure(const struct device *dev, enum i3c_config_type type, void *config)
Configure the I3C hardware.
Definition: i3c.h:1164
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 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:1644
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:1678
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:1791
static int i3c_ibi_raise(const struct device *dev, struct i3c_ibi *request)
Raise an In-Band Interrupt (IBI).
Definition: i3c.h:1480
i3c_config_type
Type of configuration being passed to configure function.
Definition: i3c.h:367
int i3c_attach_i2c_device(struct i3c_i2c_device_desc *target)
Attach an I2C device.
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.
int i3c_determine_default_addr(struct i3c_device_desc *target, uint8_t *addr)
Helper function to find the default address an i3c device is attached with.
i3c_i2c_speed_type
I2C bus speed under I3C bus.
Definition: i3c.h:144
#define I3C_MSG_READ
Definition: i3c.h:269
static int i3c_device_is_ibi_capable(struct i3c_device_desc *target)
Check if device is IBI capable.
Definition: i3c.h:1571
int i3c_detach_i3c_device(struct i3c_device_desc *target)
Detach I3C Device.
#define I3C_MSG_WRITE
Definition: i3c.h:266
static int i3c_ibi_enable(struct i3c_device_desc *target)
Enable IBI of a target device.
Definition: i3c.h:1507
i3c_bus_mode
I3C bus mode.
Definition: i3c.h:111
static int i3c_recover_bus(const struct device *dev)
Attempt bus recovery on the I3C bus.
Definition: i3c.h:1220
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:1197
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:1740
int i3c_detach_i2c_device(struct i3c_i2c_device_desc *target)
Detach I2C Device.
struct i3c_i2c_device_desc * i3c_dev_list_i2c_addr_find(struct i3c_dev_attached_list *dev_list, uint16_t addr)
Find a I2C target device descriptor by address.
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.
i3c_sdr_controller_error_codes
I3C SDR Controller Error Codes.
Definition: i3c.h:190
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:1590
int i3c_do_ccc(const struct device *dev, struct i3c_ccc_payload *payload)
Send CCC to the bus.
struct i3c_device_desc * i3c_dev_list_i3c_addr_find(struct i3c_dev_attached_list *dev_list, uint8_t addr)
Find a I3C target device descriptor by dynamic address.
int i3c_device_basic_info_get(struct i3c_device_desc *target)
Get basic information from device and update device descriptor.
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:1615
static int i3c_do_daa(const struct device *dev)
Perform Dynamic Address Assignment on the I3C bus.
Definition: i3c.h:1362
#define I3C_MSG_RESTART
Definition: i3c.h:287
#define I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE
Definition: i3c.h:61
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:160
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:1708
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:1765
@ I3C_ERROR_TE_UNKNOWN
Definition: i3c.h:252
@ I3C_ERROR_TE6
Definition: i3c.h:246
@ I3C_ERROR_TE4
Definition: i3c.h:240
@ I3C_ERROR_TE3
Definition: i3c.h:237
@ I3C_ERROR_TE_NONE
Definition: i3c.h:255
@ I3C_ERROR_TE_MAX
Definition: i3c.h:257
@ I3C_ERROR_TE1
Definition: i3c.h:231
@ I3C_ERROR_TE5
Definition: i3c.h:243
@ I3C_ERROR_DBR
Definition: i3c.h:249
@ I3C_ERROR_TE2
Definition: i3c.h:234
@ I3C_ERROR_TE_INVALID
Definition: i3c.h:258
@ I3C_ERROR_TE0
Definition: i3c.h:228
@ I3C_CONFIG_TARGET
Definition: i3c.h:369
@ I3C_CONFIG_CUSTOM
Definition: i3c.h:370
@ I3C_CONFIG_CONTROLLER
Definition: i3c.h:368
@ I3C_I2C_SPEED_INVALID
Definition: i3c.h:152
@ I3C_I2C_SPEED_MAX
Definition: i3c.h:151
@ I3C_I2C_SPEED_FMPLUS
Definition: i3c.h:149
@ I3C_I2C_SPEED_FM
Definition: i3c.h:146
@ I3C_BUS_MODE_INVALID
Definition: i3c.h:136
@ I3C_BUS_MODE_PURE
Definition: i3c.h:113
@ I3C_BUS_MODE_MIXED_FAST
Definition: i3c.h:119
@ I3C_BUS_MODE_MAX
Definition: i3c.h:135
@ I3C_BUS_MODE_MIXED_LIMITED
Definition: i3c.h:126
@ I3C_BUS_MODE_MIXED_SLOW
Definition: i3c.h:133
@ I3C_ERROR_CE0
Definition: i3c.h:192
@ I3C_ERROR_CE2
Definition: i3c.h:198
@ I3C_ERROR_CE_INVALID
Definition: i3c.h:210
@ I3C_ERROR_CE_MAX
Definition: i3c.h:209
@ I3C_ERROR_CE_UNKNOWN
Definition: i3c.h:204
@ I3C_ERROR_CE3
Definition: i3c.h:201
@ I3C_ERROR_CE1
Definition: i3c.h:195
@ I3C_ERROR_CE_NONE
Definition: i3c.h:207
@ I3C_DATA_RATE_MAX
Definition: i3c.h:176
@ I3C_DATA_RATE_INVALID
Definition: i3c.h:177
@ I3C_DATA_RATE_HDR_TSP
Definition: i3c.h:171
@ I3C_DATA_RATE_HDR_DDR
Definition: i3c.h:165
@ I3C_DATA_RATE_SDR
Definition: i3c.h:162
@ I3C_DATA_RATE_HDR_TSL
Definition: i3c.h:168
@ I3C_DATA_RATE_HDR_BT
Definition: i3c.h:174
#define ENOSYS
Definition: errno.h:83
int target
Definition: main.c:68
struct _slist sys_slist_t
Definition: slist.h:40
struct _snode sys_snode_t
Definition: slist.h:33
__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:380
const void * api
Definition: device.h:386
const void * config
Definition: device.h:384
Structure to keep track of addresses on I3C bus.
Definition: addresses.h:41
Payload structure for one CCC transaction.
Definition: ccc.h:256
Configuration parameters for I3C hardware to act as controller.
Definition: i3c.h:376
uint32_t i3c
Definition: i3c.h:385
uint8_t supported_hdr
Definition: i3c.h:397
struct i3c_config_controller::@155 scl
bool is_secondary
Definition: i3c.h:381
uint32_t i2c
Definition: i3c.h:388
Custom I3C configuration parameters.
Definition: i3c.h:408
void * ptr
Definition: i3c.h:422
uint32_t id
Definition: i3c.h:410
uintptr_t val
Definition: i3c.h:414
Structure for describing attached devices for a controller.
Definition: i3c.h:959
sys_slist_t i3c
Definition: i3c.h:972
struct i3c_dev_attached_list::@160 devices
sys_slist_t i2c
Definition: i3c.h:977
struct i3c_addr_slots addr_slots
Definition: i3c.h:966
Structure for describing known devices for a controller.
Definition: i3c.h:989
struct i3c_i2c_device_desc *const i2c
Definition: i3c.h:998
const uint8_t num_i3c
Definition: i3c.h:1003
struct i3c_device_desc *const i3c
Definition: i3c.h:993
const uint8_t num_i2c
Definition: i3c.h:1008
Structure describing a I3C target device.
Definition: i3c.h:772
uint8_t maxwr
Definition: i3c.h:880
const uint8_t init_dynamic_addr
Definition: i3c.h:808
uint32_t max_read_turnaround
Definition: i3c.h:883
const uint8_t static_addr
Definition: i3c.h:797
uint8_t max_ibi
Definition: i3c.h:894
i3c_target_ibi_cb_t ibi_cb
Definition: i3c.h:904
uint8_t group_addr
Definition: i3c.h:833
uint16_t mwl
Definition: i3c.h:891
struct i3c_device_desc::@158 data_speed
uint8_t dynamic_addr
Definition: i3c.h:823
void * controller_priv
Definition: i3c.h:898
const struct device *const dev
Definition: i3c.h:780
sys_snode_t node
Definition: i3c.h:774
struct i3c_device_desc::@159 data_length
uint16_t mrl
Definition: i3c.h:888
const uint64_t pid
Definition: i3c.h:783
uint8_t maxrd
Definition: i3c.h:877
uint8_t bcr
Definition: i3c.h:865
uint8_t dcr
Definition: i3c.h:873
const struct device *const bus
Definition: i3c.h:777
Structure used for matching I3C devices.
Definition: i3c.h:737
const uint64_t pid
Definition: i3c.h:739
Definition: i3c.h:1016
struct i3c_dev_list dev_list
Definition: i3c.h:1018
Definition: i3c.h:1025
struct i3c_config_controller ctrl_config
Definition: i3c.h:1027
struct i3c_dev_attached_list attached_dev
Definition: i3c.h:1030
Structure describing a I2C device on I3C bus.
Definition: i3c.h:921
const struct device * bus
Definition: i3c.h:926
const uint16_t addr
Definition: i3c.h:929
const uint8_t lvr
Definition: i3c.h:945
void * controller_priv
Definition: i3c.h:948
sys_snode_t node
Definition: i3c.h:923
Struct for IBI request.
Definition: ibi.h:57
One I3C Message.
Definition: i3c.h:345
uint8_t flags
Definition: i3c.h:353
uint8_t hdr_mode
Definition: i3c.h:361
uint8_t * buf
Definition: i3c.h:347
uint32_t len
Definition: i3c.h:350
Structure describing a device that supports the I3C target API.
Definition: target_device.h:92
static void msg(uint64_t c64)
Definition: main.c:17