Zephyr Project API  3.2.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_HDR_MODE0 BIT(0)
294
296#define I3C_MSG_HDR_MODE1 BIT(1)
297
299#define I3C_MSG_HDR_MODE2 BIT(2)
300
302#define I3C_MSG_HDR_MODE3 BIT(3)
303
305#define I3C_MSG_HDR_MODE4 BIT(4)
306
308#define I3C_MSG_HDR_MODE5 BIT(5)
309
311#define I3C_MSG_HDR_MODE6 BIT(6)
312
314#define I3C_MSG_HDR_MODE7 BIT(7)
315
317#define I3C_MSG_HDR_DDR I3C_MSG_HDR_MODE0
318
320#define I3C_MSG_HDR_TSP I3C_MSG_HDR_MODE1
321
323#define I3C_MSG_HDR_TSL I3C_MSG_HDR_MODE2
324
326#define I3C_MSG_HDR_BT I3C_MSG_HDR_MODE3
327
342struct i3c_msg {
345
348
351
359};
360
368};
369
379
380 struct {
383
387
395};
396
408
409 union {
412
419 void *ptr;
420 };
421};
422
429struct i3c_device_desc;
430struct i3c_device_id;
432struct i3c_target_config;
433
434__subsystem struct i3c_driver_api {
442 struct i2c_driver_api i2c_api;
443
456 int (*configure)(const struct device *dev,
457 enum i3c_config_type type, void *config);
458
471 int (*config_get)(const struct device *dev,
472 enum i3c_config_type type, void *config);
473
485 int (*recover_bus)(const struct device *dev);
486
498 int (*do_daa)(const struct device *dev);
499
512 int (*do_ccc)(const struct device *dev,
513 struct i3c_ccc_payload *payload);
514
527 int (*i3c_xfers)(const struct device *dev,
528 struct i3c_device_desc *target,
529 struct i3c_msg *msgs,
530 uint8_t num_msgs);
531
545 struct i3c_device_desc *(*i3c_device_find)(const struct device *dev,
546 const struct i3c_device_id *id);
547
560 int (*ibi_raise)(const struct device *dev,
561 struct i3c_ibi *request);
562
575 int (*ibi_enable)(const struct device *dev,
576 struct i3c_device_desc *target);
577
590 int (*ibi_disable)(const struct device *dev,
591 struct i3c_device_desc *target);
592
608 int (*target_register)(const struct device *dev,
609 struct i3c_target_config *cfg);
610
626 int (*target_unregister)(const struct device *dev,
627 struct i3c_target_config *cfg);
628};
629
639 const uint64_t pid:48;
640};
641
650#define I3C_DEVICE_ID(pid) \
651 { \
652 .pid = pid \
653 }
654
675
677 const struct device * const bus;
678
680 const struct device * const dev;
681
683 const uint64_t pid:48;
684
698
709
724
725#if defined(CONFIG_I3C_USE_GROUP_ADDR) || defined(__DOXYGEN__)
734#endif /* CONFIG_I3C_USE_GROUP_ADDR */
735
766
774
775 struct {
778
781
785
786 struct {
789
792
796
799
800#if defined(CONFIG_I3C_USE_IBI) || defined(__DOXYGEN__)
805#endif /* CONFIG_I3C_USE_IBI */
806};
807
824
826 const struct device *bus;
827
830
846
849};
850
863 struct i3c_device_desc * const i3c;
864
868 struct i3c_i2c_device_desc * const i2c;
869
874
879};
880
893struct i3c_device_desc *i3c_dev_list_find(const struct i3c_dev_list *dev_list,
894 const struct i3c_device_id *id);
895
909 uint8_t addr);
910
924 uint16_t addr);
925
978 const struct i3c_dev_list *dev_list,
979 uint64_t pid, bool must_match,
980 bool assigned_okay,
981 struct i3c_device_desc **target,
982 uint8_t *addr);
983
997static inline int i3c_configure(const struct device *dev,
998 enum i3c_config_type type, void *config)
999{
1000 const struct i3c_driver_api *api =
1001 (const struct i3c_driver_api *)dev->api;
1002
1003 if (api->configure == NULL) {
1004 return -ENOSYS;
1005 }
1006
1007 return api->configure(dev, type, config);
1008}
1009
1030static inline int i3c_config_get(const struct device *dev,
1031 enum i3c_config_type type, void *config)
1032{
1033 const struct i3c_driver_api *api =
1034 (const struct i3c_driver_api *)dev->api;
1035
1036 if (api->config_get == NULL) {
1037 return -ENOSYS;
1038 }
1039
1040 return api->config_get(dev, type, config);
1041}
1042
1053static inline int i3c_recover_bus(const struct device *dev)
1054{
1055 const struct i3c_driver_api *api =
1056 (const struct i3c_driver_api *)dev->api;
1057
1058 if (api->recover_bus == NULL) {
1059 return -ENOSYS;
1060 }
1061
1062 return api->recover_bus(dev);
1063}
1064
1088static inline int i3c_do_daa(const struct device *dev)
1089{
1090 const struct i3c_driver_api *api =
1091 (const struct i3c_driver_api *)dev->api;
1092
1093 if (api->do_daa == NULL) {
1094 return -ENOSYS;
1095 }
1096
1097 return api->do_daa(dev);
1098}
1099
1113__syscall int i3c_do_ccc(const struct device *dev,
1114 struct i3c_ccc_payload *payload);
1115
1116static inline int z_impl_i3c_do_ccc(const struct device *dev,
1117 struct i3c_ccc_payload *payload)
1118{
1119 const struct i3c_driver_api *api =
1120 (const struct i3c_driver_api *)dev->api;
1121
1122 if (api->do_ccc == NULL) {
1123 return -ENOSYS;
1124 }
1125
1126 return api->do_ccc(dev, payload);
1127}
1128
1156 struct i3c_msg *msgs, uint8_t num_msgs);
1157
1158static inline int z_impl_i3c_transfer(struct i3c_device_desc *target,
1159 struct i3c_msg *msgs, uint8_t num_msgs)
1160{
1161 const struct i3c_driver_api *api =
1162 (const struct i3c_driver_api *)target->bus->api;
1163
1164 return api->i3c_xfers(target->bus, target, msgs, num_msgs);
1165}
1166
1181static inline
1183 const struct i3c_device_id *id)
1184{
1185 const struct i3c_driver_api *api =
1186 (const struct i3c_driver_api *)dev->api;
1187
1188 if (api->i3c_device_find == NULL) {
1189 return NULL;
1190 }
1191
1192 return api->i3c_device_find(dev, id);
1193}
1194
1206static inline int i3c_ibi_raise(const struct device *dev,
1207 struct i3c_ibi *request)
1208{
1209 const struct i3c_driver_api *api =
1210 (const struct i3c_driver_api *)dev->api;
1211
1212 if (api->ibi_raise == NULL) {
1213 return -ENOSYS;
1214 }
1215
1216 return api->ibi_raise(dev, request);
1217}
1218
1233static inline int i3c_ibi_enable(struct i3c_device_desc *target)
1234{
1235 const struct i3c_driver_api *api =
1236 (const struct i3c_driver_api *)target->bus->api;
1237
1238 if (api->ibi_enable == NULL) {
1239 return -ENOSYS;
1240 }
1241
1242 return api->ibi_enable(target->bus, target);
1243}
1244
1257static inline int i3c_ibi_disable(struct i3c_device_desc *target)
1258{
1259 const struct i3c_driver_api *api =
1260 (const struct i3c_driver_api *)target->bus->api;
1261
1262 if (api->ibi_disable == NULL) {
1263 return -ENOSYS;
1264 }
1265
1266 return api->ibi_disable(target->bus, target);
1267}
1268
1281{
1284}
1285
1298{
1299 return (target->bcr & I3C_BCR_IBI_REQUEST_CAPABLE)
1301}
1302
1316static inline int i3c_write(struct i3c_device_desc *target,
1317 const uint8_t *buf, uint32_t num_bytes)
1318{
1319 struct i3c_msg msg;
1320
1321 msg.buf = (uint8_t *)buf;
1322 msg.len = num_bytes;
1323 msg.flags = I3C_MSG_WRITE | I3C_MSG_STOP;
1324
1325 return i3c_transfer(target, &msg, 1);
1326}
1327
1341static inline int i3c_read(struct i3c_device_desc *target,
1342 uint8_t *buf, uint32_t num_bytes)
1343{
1344 struct i3c_msg msg;
1345
1346 msg.buf = buf;
1347 msg.len = num_bytes;
1348 msg.flags = I3C_MSG_READ | I3C_MSG_STOP;
1349
1350 return i3c_transfer(target, &msg, 1);
1351}
1352
1370static inline int i3c_write_read(struct i3c_device_desc *target,
1371 const void *write_buf, size_t num_write,
1372 void *read_buf, size_t num_read)
1373{
1374 struct i3c_msg msg[2];
1375
1376 msg[0].buf = (uint8_t *)write_buf;
1377 msg[0].len = num_write;
1378 msg[0].flags = I3C_MSG_WRITE;
1379
1380 msg[1].buf = (uint8_t *)read_buf;
1381 msg[1].len = num_read;
1383
1384 return i3c_transfer(target, msg, 2);
1385}
1386
1404static inline int i3c_burst_read(struct i3c_device_desc *target,
1405 uint8_t start_addr,
1406 uint8_t *buf,
1407 uint32_t num_bytes)
1408{
1409 return i3c_write_read(target,
1410 &start_addr, sizeof(start_addr),
1411 buf, num_bytes);
1412}
1413
1434static inline int i3c_burst_write(struct i3c_device_desc *target,
1435 uint8_t start_addr,
1436 const uint8_t *buf,
1437 uint32_t num_bytes)
1438{
1439 struct i3c_msg msg[2];
1440
1441 msg[0].buf = &start_addr;
1442 msg[0].len = 1U;
1443 msg[0].flags = I3C_MSG_WRITE;
1444
1445 msg[1].buf = (uint8_t *)buf;
1446 msg[1].len = num_bytes;
1447 msg[1].flags = I3C_MSG_WRITE | I3C_MSG_STOP;
1448
1449 return i3c_transfer(target, msg, 2);
1450}
1451
1466static inline int i3c_reg_read_byte(struct i3c_device_desc *target,
1467 uint8_t reg_addr, uint8_t *value)
1468{
1469 return i3c_write_read(target,
1470 &reg_addr, sizeof(reg_addr),
1471 value, sizeof(*value));
1472}
1473
1492 uint8_t reg_addr, uint8_t value)
1493{
1494 uint8_t tx_buf[2] = {reg_addr, value};
1495
1496 return i3c_write(target, tx_buf, 2);
1497}
1498
1518 uint8_t reg_addr, uint8_t mask,
1519 uint8_t value)
1520{
1521 uint8_t old_value, new_value;
1522 int rc;
1523
1524 rc = i3c_reg_read_byte(target, reg_addr, &old_value);
1525 if (rc != 0) {
1526 return rc;
1527 }
1528
1529 new_value = (old_value & ~mask) | (value & mask);
1530 if (new_value == old_value) {
1531 return 0;
1532 }
1533
1534 return i3c_reg_write_byte(target, reg_addr, new_value);
1535}
1536
1561void i3c_dump_msgs(const char *name, const struct i3c_msg *msgs,
1562 uint8_t num_msgs, struct i3c_device_desc *target);
1563
1579int i3c_bus_init(const struct device *dev,
1580 const struct i3c_dev_list *i3c_dev_list);
1581
1602
1603/*
1604 * This needs to be after declaration of struct i3c_driver_api,
1605 * or else compiler complains about undefined type inside
1606 * the static inline API wrappers.
1607 */
1609
1610#ifdef __cplusplus
1611}
1612#endif
1613
1618#include <syscalls/i3c.h>
1619
1620#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:1257
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:1182
static int i3c_ibi_has_payload(struct i3c_device_desc *target)
Check if target's IBI has payload.
Definition: i3c.h:1280
i3c_sdr_target_error_codes
I3C SDR Target Error Codes.
Definition: i3c.h:223
struct i3c_i2c_device_desc * i3c_dev_list_i2c_addr_find(const struct i3c_dev_list *dev_list, uint16_t addr)
Find a I2C target device descriptor by address.
static int i3c_configure(const struct device *dev, enum i3c_config_type type, void *config)
Configure the I3C hardware.
Definition: i3c.h:997
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:1370
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:1404
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:1517
struct i3c_device_desc * i3c_dev_list_i3c_addr_find(const struct i3c_dev_list *dev_list, uint8_t addr)
Find a I3C target device descriptor by dynamic address.
static int i3c_ibi_raise(const struct device *dev, struct i3c_ibi *request)
Raise an In-Band Interrupt (IBI).
Definition: i3c.h:1206
i3c_config_type
Type of configuration being passed to configure function.
Definition: i3c.h:364
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.
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:1297
#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:1233
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:1053
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:1030
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:1466
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:1316
int i3c_do_ccc(const struct device *dev, struct i3c_ccc_payload *payload)
Send CCC to the bus.
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:1341
static int i3c_do_daa(const struct device *dev)
Perform Dynamic Address Assignment on the I3C bus.
Definition: i3c.h:1088
#define I3C_MSG_RESTART
Definition: i3c.h:287
#define I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE
Definition: i3c.h:61
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:1434
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:1491
@ 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:366
@ I3C_CONFIG_CUSTOM
Definition: i3c.h:367
@ I3C_CONFIG_CONTROLLER
Definition: i3c.h:365
@ 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 _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:435
const void * api
Definition: device.h:441
const void * config
Definition: device.h:439
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:373
bool is_primary
Definition: i3c.h:378
uint32_t i3c
Definition: i3c.h:382
uint8_t supported_hdr
Definition: i3c.h:394
uint32_t i2c
Definition: i3c.h:385
struct i3c_config_controller::@119 scl
Custom I3C configuration parameters.
Definition: i3c.h:405
void * ptr
Definition: i3c.h:419
uint32_t id
Definition: i3c.h:407
uintptr_t val
Definition: i3c.h:411
Structure for describing attached devices for a controller.
Definition: i3c.h:859
struct i3c_i2c_device_desc *const i2c
Definition: i3c.h:868
const uint8_t num_i3c
Definition: i3c.h:873
struct i3c_device_desc *const i3c
Definition: i3c.h:863
const uint8_t num_i2c
Definition: i3c.h:878
Structure describing a I3C target device.
Definition: i3c.h:672
uint8_t maxwr
Definition: i3c.h:780
const uint8_t init_dynamic_addr
Definition: i3c.h:708
uint32_t max_read_turnaround
Definition: i3c.h:783
const uint8_t static_addr
Definition: i3c.h:697
uint8_t max_ibi
Definition: i3c.h:794
i3c_target_ibi_cb_t ibi_cb
Definition: i3c.h:804
uint8_t group_addr
Definition: i3c.h:733
uint16_t mwl
Definition: i3c.h:791
struct i3c_device_desc::@123 data_length
uint8_t dynamic_addr
Definition: i3c.h:723
void * controller_priv
Definition: i3c.h:798
const struct device *const dev
Definition: i3c.h:680
sys_snode_t node
Definition: i3c.h:674
uint16_t mrl
Definition: i3c.h:788
const uint64_t pid
Definition: i3c.h:683
uint8_t maxrd
Definition: i3c.h:777
uint8_t bcr
Definition: i3c.h:765
uint8_t dcr
Definition: i3c.h:773
struct i3c_device_desc::@122 data_speed
const struct device *const bus
Definition: i3c.h:677
Structure used for matching I3C devices.
Definition: i3c.h:637
const uint64_t pid
Definition: i3c.h:639
Structure describing a I2C device on I3C bus.
Definition: i3c.h:821
const struct device * bus
Definition: i3c.h:826
const uint16_t addr
Definition: i3c.h:829
const uint8_t lvr
Definition: i3c.h:845
void * controller_priv
Definition: i3c.h:848
sys_snode_t node
Definition: i3c.h:823
Struct for IBI request.
Definition: ibi.h:57
One I3C Message.
Definition: i3c.h:342
uint8_t flags
Definition: i3c.h:350
uint8_t hdr_mode
Definition: i3c.h:358
uint8_t * buf
Definition: i3c.h:344
uint32_t len
Definition: i3c.h:347
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