Zephyr Project API  3.3.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
501 int (*do_daa)(const struct device *dev);
502
515 int (*do_ccc)(const struct device *dev,
516 struct i3c_ccc_payload *payload);
517
530 int (*i3c_xfers)(const struct device *dev,
531 struct i3c_device_desc *target,
532 struct i3c_msg *msgs,
533 uint8_t num_msgs);
534
548 struct i3c_device_desc *(*i3c_device_find)(const struct device *dev,
549 const struct i3c_device_id *id);
550
563 int (*ibi_raise)(const struct device *dev,
564 struct i3c_ibi *request);
565
578 int (*ibi_enable)(const struct device *dev,
579 struct i3c_device_desc *target);
580
593 int (*ibi_disable)(const struct device *dev,
594 struct i3c_device_desc *target);
595
611 int (*target_register)(const struct device *dev,
612 struct i3c_target_config *cfg);
613
629 int (*target_unregister)(const struct device *dev,
630 struct i3c_target_config *cfg);
631
647 int (*target_tx_write)(const struct device *dev,
648 uint8_t *buf, uint16_t len);
649};
650
660 const uint64_t pid:48;
661};
662
671#define I3C_DEVICE_ID(pid) \
672 { \
673 .pid = pid \
674 }
675
696
698 const struct device * const bus;
699
701 const struct device * const dev;
702
704 const uint64_t pid:48;
705
719
730
745
746#if defined(CONFIG_I3C_USE_GROUP_ADDR) || defined(__DOXYGEN__)
755#endif /* CONFIG_I3C_USE_GROUP_ADDR */
756
787
795
796 struct {
799
802
806
807 struct {
810
813
817
820
821#if defined(CONFIG_I3C_USE_IBI) || defined(__DOXYGEN__)
826#endif /* CONFIG_I3C_USE_IBI */
827};
828
845
847 const struct device *bus;
848
851
867
870};
871
884 struct i3c_device_desc * const i3c;
885
889 struct i3c_i2c_device_desc * const i2c;
890
895
900};
901
914struct i3c_device_desc *i3c_dev_list_find(const struct i3c_dev_list *dev_list,
915 const struct i3c_device_id *id);
916
930 uint8_t addr);
931
945 uint16_t addr);
946
999 const struct i3c_dev_list *dev_list,
1000 uint64_t pid, bool must_match,
1001 bool assigned_okay,
1002 struct i3c_device_desc **target,
1003 uint8_t *addr);
1004
1018static inline int i3c_configure(const struct device *dev,
1019 enum i3c_config_type type, void *config)
1020{
1021 const struct i3c_driver_api *api =
1022 (const struct i3c_driver_api *)dev->api;
1023
1024 if (api->configure == NULL) {
1025 return -ENOSYS;
1026 }
1027
1028 return api->configure(dev, type, config);
1029}
1030
1051static inline int i3c_config_get(const struct device *dev,
1052 enum i3c_config_type type, void *config)
1053{
1054 const struct i3c_driver_api *api =
1055 (const struct i3c_driver_api *)dev->api;
1056
1057 if (api->config_get == NULL) {
1058 return -ENOSYS;
1059 }
1060
1061 return api->config_get(dev, type, config);
1062}
1063
1074static inline int i3c_recover_bus(const struct device *dev)
1075{
1076 const struct i3c_driver_api *api =
1077 (const struct i3c_driver_api *)dev->api;
1078
1079 if (api->recover_bus == NULL) {
1080 return -ENOSYS;
1081 }
1082
1083 return api->recover_bus(dev);
1084}
1085
1109static inline int i3c_do_daa(const struct device *dev)
1110{
1111 const struct i3c_driver_api *api =
1112 (const struct i3c_driver_api *)dev->api;
1113
1114 if (api->do_daa == NULL) {
1115 return -ENOSYS;
1116 }
1117
1118 return api->do_daa(dev);
1119}
1120
1134__syscall int i3c_do_ccc(const struct device *dev,
1135 struct i3c_ccc_payload *payload);
1136
1137static inline int z_impl_i3c_do_ccc(const struct device *dev,
1138 struct i3c_ccc_payload *payload)
1139{
1140 const struct i3c_driver_api *api =
1141 (const struct i3c_driver_api *)dev->api;
1142
1143 if (api->do_ccc == NULL) {
1144 return -ENOSYS;
1145 }
1146
1147 return api->do_ccc(dev, payload);
1148}
1149
1177 struct i3c_msg *msgs, uint8_t num_msgs);
1178
1179static inline int z_impl_i3c_transfer(struct i3c_device_desc *target,
1180 struct i3c_msg *msgs, uint8_t num_msgs)
1181{
1182 const struct i3c_driver_api *api =
1183 (const struct i3c_driver_api *)target->bus->api;
1184
1185 return api->i3c_xfers(target->bus, target, msgs, num_msgs);
1186}
1187
1202static inline
1204 const struct i3c_device_id *id)
1205{
1206 const struct i3c_driver_api *api =
1207 (const struct i3c_driver_api *)dev->api;
1208
1209 if (api->i3c_device_find == NULL) {
1210 return NULL;
1211 }
1212
1213 return api->i3c_device_find(dev, id);
1214}
1215
1227static inline int i3c_ibi_raise(const struct device *dev,
1228 struct i3c_ibi *request)
1229{
1230 const struct i3c_driver_api *api =
1231 (const struct i3c_driver_api *)dev->api;
1232
1233 if (api->ibi_raise == NULL) {
1234 return -ENOSYS;
1235 }
1236
1237 return api->ibi_raise(dev, request);
1238}
1239
1254static inline int i3c_ibi_enable(struct i3c_device_desc *target)
1255{
1256 const struct i3c_driver_api *api =
1257 (const struct i3c_driver_api *)target->bus->api;
1258
1259 if (api->ibi_enable == NULL) {
1260 return -ENOSYS;
1261 }
1262
1263 return api->ibi_enable(target->bus, target);
1264}
1265
1278static inline int i3c_ibi_disable(struct i3c_device_desc *target)
1279{
1280 const struct i3c_driver_api *api =
1281 (const struct i3c_driver_api *)target->bus->api;
1282
1283 if (api->ibi_disable == NULL) {
1284 return -ENOSYS;
1285 }
1286
1287 return api->ibi_disable(target->bus, target);
1288}
1289
1302{
1305}
1306
1319{
1320 return (target->bcr & I3C_BCR_IBI_REQUEST_CAPABLE)
1322}
1323
1337static inline int i3c_write(struct i3c_device_desc *target,
1338 const uint8_t *buf, uint32_t num_bytes)
1339{
1340 struct i3c_msg msg;
1341
1342 msg.buf = (uint8_t *)buf;
1343 msg.len = num_bytes;
1344 msg.flags = I3C_MSG_WRITE | I3C_MSG_STOP;
1345
1346 return i3c_transfer(target, &msg, 1);
1347}
1348
1362static inline int i3c_read(struct i3c_device_desc *target,
1363 uint8_t *buf, uint32_t num_bytes)
1364{
1365 struct i3c_msg msg;
1366
1367 msg.buf = buf;
1368 msg.len = num_bytes;
1369 msg.flags = I3C_MSG_READ | I3C_MSG_STOP;
1370
1371 return i3c_transfer(target, &msg, 1);
1372}
1373
1391static inline int i3c_write_read(struct i3c_device_desc *target,
1392 const void *write_buf, size_t num_write,
1393 void *read_buf, size_t num_read)
1394{
1395 struct i3c_msg msg[2];
1396
1397 msg[0].buf = (uint8_t *)write_buf;
1398 msg[0].len = num_write;
1399 msg[0].flags = I3C_MSG_WRITE;
1400
1401 msg[1].buf = (uint8_t *)read_buf;
1402 msg[1].len = num_read;
1404
1405 return i3c_transfer(target, msg, 2);
1406}
1407
1425static inline int i3c_burst_read(struct i3c_device_desc *target,
1426 uint8_t start_addr,
1427 uint8_t *buf,
1428 uint32_t num_bytes)
1429{
1430 return i3c_write_read(target,
1431 &start_addr, sizeof(start_addr),
1432 buf, num_bytes);
1433}
1434
1455static inline int i3c_burst_write(struct i3c_device_desc *target,
1456 uint8_t start_addr,
1457 const uint8_t *buf,
1458 uint32_t num_bytes)
1459{
1460 struct i3c_msg msg[2];
1461
1462 msg[0].buf = &start_addr;
1463 msg[0].len = 1U;
1464 msg[0].flags = I3C_MSG_WRITE;
1465
1466 msg[1].buf = (uint8_t *)buf;
1467 msg[1].len = num_bytes;
1468 msg[1].flags = I3C_MSG_WRITE | I3C_MSG_STOP;
1469
1470 return i3c_transfer(target, msg, 2);
1471}
1472
1487static inline int i3c_reg_read_byte(struct i3c_device_desc *target,
1488 uint8_t reg_addr, uint8_t *value)
1489{
1490 return i3c_write_read(target,
1491 &reg_addr, sizeof(reg_addr),
1492 value, sizeof(*value));
1493}
1494
1513 uint8_t reg_addr, uint8_t value)
1514{
1515 uint8_t tx_buf[2] = {reg_addr, value};
1516
1517 return i3c_write(target, tx_buf, 2);
1518}
1519
1539 uint8_t reg_addr, uint8_t mask,
1540 uint8_t value)
1541{
1542 uint8_t old_value, new_value;
1543 int rc;
1544
1545 rc = i3c_reg_read_byte(target, reg_addr, &old_value);
1546 if (rc != 0) {
1547 return rc;
1548 }
1549
1550 new_value = (old_value & ~mask) | (value & mask);
1551 if (new_value == old_value) {
1552 return 0;
1553 }
1554
1555 return i3c_reg_write_byte(target, reg_addr, new_value);
1556}
1557
1582void i3c_dump_msgs(const char *name, const struct i3c_msg *msgs,
1583 uint8_t num_msgs, struct i3c_device_desc *target);
1584
1600int i3c_bus_init(const struct device *dev,
1601 const struct i3c_dev_list *i3c_dev_list);
1602
1623
1624/*
1625 * This needs to be after declaration of struct i3c_driver_api,
1626 * or else compiler complains about undefined type inside
1627 * the static inline API wrappers.
1628 */
1630
1631#ifdef __cplusplus
1632}
1633#endif
1634
1639#include <syscalls/i3c.h>
1640
1641#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:1278
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:1203
static int i3c_ibi_has_payload(struct i3c_device_desc *target)
Check if target's IBI has payload.
Definition: i3c.h:1301
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:1018
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:1391
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:1425
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:1538
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:1227
i3c_config_type
Type of configuration being passed to configure function.
Definition: i3c.h:367
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:1318
#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:1254
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:1074
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:1051
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:1487
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:1337
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:1362
static int i3c_do_daa(const struct device *dev)
Perform Dynamic Address Assignment on the I3C bus.
Definition: i3c.h:1109
#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:1455
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:1512
@ 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 _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:378
const void * api
Definition: device.h:384
const void * config
Definition: device.h:382
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
struct i3c_config_controller::@121 scl
uint32_t i3c
Definition: i3c.h:385
uint8_t supported_hdr
Definition: i3c.h:397
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:880
struct i3c_i2c_device_desc *const i2c
Definition: i3c.h:889
const uint8_t num_i3c
Definition: i3c.h:894
struct i3c_device_desc *const i3c
Definition: i3c.h:884
const uint8_t num_i2c
Definition: i3c.h:899
Structure describing a I3C target device.
Definition: i3c.h:693
uint8_t maxwr
Definition: i3c.h:801
const uint8_t init_dynamic_addr
Definition: i3c.h:729
uint32_t max_read_turnaround
Definition: i3c.h:804
const uint8_t static_addr
Definition: i3c.h:718
uint8_t max_ibi
Definition: i3c.h:815
i3c_target_ibi_cb_t ibi_cb
Definition: i3c.h:825
uint8_t group_addr
Definition: i3c.h:754
uint16_t mwl
Definition: i3c.h:812
uint8_t dynamic_addr
Definition: i3c.h:744
void * controller_priv
Definition: i3c.h:819
struct i3c_device_desc::@124 data_speed
const struct device *const dev
Definition: i3c.h:701
sys_snode_t node
Definition: i3c.h:695
struct i3c_device_desc::@125 data_length
uint16_t mrl
Definition: i3c.h:809
const uint64_t pid
Definition: i3c.h:704
uint8_t maxrd
Definition: i3c.h:798
uint8_t bcr
Definition: i3c.h:786
uint8_t dcr
Definition: i3c.h:794
const struct device *const bus
Definition: i3c.h:698
Structure used for matching I3C devices.
Definition: i3c.h:658
const uint64_t pid
Definition: i3c.h:660
Structure describing a I2C device on I3C bus.
Definition: i3c.h:842
const struct device * bus
Definition: i3c.h:847
const uint16_t addr
Definition: i3c.h:850
const uint8_t lvr
Definition: i3c.h:866
void * controller_priv
Definition: i3c.h:869
sys_snode_t node
Definition: i3c.h:844
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