no-OS
no_os_i3c.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef _NO_OS_I3C_H_
41 #define _NO_OS_I3C_H_
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 
47 #include <stdint.h>
48 #include "no_os_util.h"
49 
50 /******************************************************************************/
51 /********************** Macros and Constants Definitions **********************/
52 /******************************************************************************/
53 
54 #define NO_OS_I3C_MAX_BUS_NUMBER 3
55 #define NO_OS_I3C_MAX_DEV_NUMBER 15
56 /* I²C/I3C address are 7-bit (not considering extended 10-bit I²C) */
57 #define NO_OS_I3C_I2C_MAX_ADDR 0x7F
58 #define NO_OS_I3C_MAX_ADDR NO_OS_I3C_I2C_MAX_ADDR
59 #define NO_OS_I3C_BCAST_ADDR 0x7E
60 /* 2-bit flags packed in addrslots */
61 #define NO_OS_I3C_ADDR_FLAG_SIZE 2
62 #define NO_OS_I3C_ADDR_PER_SLOT ((unsigned int)(sizeof(unsigned int)*8 / NO_OS_I3C_ADDR_FLAG_SIZE))
63 #define NO_OS_I3C_ADDR_GET_SLOT(x) ((x) / NO_OS_I3C_ADDR_PER_SLOT)
64 #define NO_OS_I3C_ADDR_GET_POS(x) (((x) % NO_OS_I3C_ADDR_PER_SLOT) * NO_OS_I3C_ADDR_FLAG_SIZE)
65 #define NO_OS_I3C_ADDRSLOTS_SIZE \
66  (NO_OS_I3C_I2C_MAX_ADDR / NO_OS_I3C_ADDR_PER_SLOT) + !!(NO_OS_I3C_I2C_MAX_ADDR % NO_OS_I3C_ADDR_PER_SLOT)
67 
68 /* I3C CCC (Common Command Codes) related definitions */
69 #define NO_OS_I3C_CCC_BCAST 0
70 #define NO_OS_I3C_CCC_DIRECT NO_OS_BIT(7)
71 
72 #define NO_OS_I3C_CCC_ID(id, type) ((id) | (type))
73 
74 #define NO_OS_I3C_CCC_ADDR(x) ((x) & 0xFF)
75 #define NO_OS_I3C_CCC_GET_LEN(x) (((x) >> 8) & 0x0000FF)
76 #define NO_OS_I3C_CCC_SET_LEN(x) (((x) << 8) & 0x00FF00)
77 #define NO_OS_I3C_CCC_GET_DEF(x) (((x) >> 17) & NO_OS_BIT(0))
78 #define NO_OS_I3C_CCC_SET_DEF NO_OS_BIT(17)
79 #define NO_OS_I3C_CCC_GET_RNW(x) (((x) >> 16) & NO_OS_BIT(0))
80 #define NO_OS_I3C_CCC_SET_RNW(x) (((x) << 16) & NO_OS_BIT(16))
81 
86 #define NO_OS_I3C_CCC_ENEC_DIRECT 0x80 | NO_OS_I3C_CCC_SET_LEN(1)
87 #define NO_OS_I3C_CCC_DISEC_DIRECT 0x81 | NO_OS_I3C_CCC_SET_LEN(1)
88 #define NO_OS_I3C_CCC_ENEC_BCAST 0x00 | NO_OS_I3C_CCC_SET_DEF
89 #define NO_OS_I3C_CCC_DISEC_BCAST 0x01 | NO_OS_I3C_CCC_SET_DEF
90 #define NO_OS_I3C_CCC_ENTAS(as, type) NO_OS_I3C_CCC_ID((0x2 + (as)), (type))
91 #define NO_OS_I3C_CCC_RSTDAA(type) NO_OS_I3C_CCC_ID(0x6, (type))
92 #define NO_OS_I3C_CCC_SETMWL(type) NO_OS_I3C_CCC_ID(0x9, (type)) | NO_OS_I3C_CCC_SET_LEN(2)
93 #define NO_OS_I3C_CCC_SETMRL(type) NO_OS_I3C_CCC_ID(0xa, (type)) | NO_OS_I3C_CCC_SET_LEN(2)
94 #define NO_OS_I3C_CCC_SETXTIME_BCAST 0x28 | NO_OS_I3C_CCC_SET_DEF
95 #define NO_OS_I3C_CCC_SETXTIME_DIRECT 0x98 | NO_OS_I3C_CCC_SET_DEF
96 #define NO_OS_I3C_CCC_RSTACT_BCAST 0x2a | NO_OS_I3C_CCC_SET_DEF
97 #define NO_OS_I3C_CCC_RSTACT_DIRECT 0x9a | NO_OS_I3C_CCC_SET_DEF
98 #define NO_OS_I3C_CCC_RSTACT_I3C_ONLY 0x1
99 #define NO_OS_I3C_CCC_RSTACT_WHOLE_TARGET 0x2
100 
101 /* Broadcast-only commands */
102 #define NO_OS_I3C_CCC_ENTDAA NO_OS_I3C_CCC_ID(0x7, NO_OS_I3C_CCC_BCAST)
103 #define NO_OS_I3C_CCC_DEFSLVS NO_OS_I3C_CCC_ID(0x8, NO_OS_I3C_CCC_BCAST)
104 #define NO_OS_I3C_CCC_ENTTM NO_OS_I3C_CCC_ID(0xb, NO_OS_I3C_CCC_BCAST)
105 #define NO_OS_I3C_CCC_ENTHDR(x) NO_OS_I3C_CCC_ID((0x20 + (x)), NO_OS_I3C_CCC_BCAST)
106 #define NO_OS_I3C_CCC_SETAASA NO_OS_I3C_CCC_ID(0x29, NO_OS_I3C_CCC_BCAST)
107 
108 /* Unicast-only commands */
109 #define NO_OS_I3C_CCC_SETDASA NO_OS_I3C_CCC_ID(0x7, NO_OS_I3C_CCC_DIRECT)
110 #define NO_OS_I3C_CCC_SETNEWDA NO_OS_I3C_CCC_ID(0x8, NO_OS_I3C_CCC_DIRECT)
111 #define NO_OS_I3C_CCC_GETMWL NO_OS_I3C_CCC_ID(0xb, NO_OS_I3C_CCC_DIRECT)
112 #define NO_OS_I3C_CCC_GETMRL NO_OS_I3C_CCC_ID(0xc, NO_OS_I3C_CCC_DIRECT)
113 #define NO_OS_I3C_CCC_GETPID (NO_OS_I3C_CCC_ID(0xd, NO_OS_I3C_CCC_DIRECT) | NO_OS_I3C_CCC_SET_LEN(6) | NO_OS_I3C_CCC_SET_RNW(1))
114 #define NO_OS_I3C_CCC_GETBCR (NO_OS_I3C_CCC_ID(0xe, NO_OS_I3C_CCC_DIRECT) | NO_OS_I3C_CCC_SET_LEN(1) | NO_OS_I3C_CCC_SET_RNW(1))
115 #define NO_OS_I3C_CCC_GETDCR (NO_OS_I3C_CCC_ID(0xf, NO_OS_I3C_CCC_DIRECT) | NO_OS_I3C_CCC_SET_LEN(1) | NO_OS_I3C_CCC_SET_RNW(1))
116 #define NO_OS_I3C_CCC_GETSTATUS (NO_OS_I3C_CCC_ID(0x10, NO_OS_I3C_CCC_DIRECT) | NO_OS_I3C_CCC_SET_LEN(2) | NO_OS_I3C_CCC_SET_RNW(1))
117 #define NO_OS_I3C_CCC_GETACCMST NO_OS_I3C_CCC_ID(0x11, NO_OS_I3C_CCC_DIRECT)
118 #define NO_OS_I3C_CCC_SETBRGTGT NO_OS_I3C_CCC_ID(0x13, NO_OS_I3C_CCC_DIRECT)
119 #define NO_OS_I3C_CCC_GETMXDS NO_OS_I3C_CCC_ID(0x14, NO_OS_I3C_CCC_DIRECT)
120 #define NO_OS_I3C_CCC_GETHDRCAP NO_OS_I3C_CCC_ID(0x15, NO_OS_I3C_CCC_DIRECT)
121 #define NO_OS_I3C_CCC_GETXTIME NO_OS_I3C_CCC_ID(0x19, NO_OS_I3C_CCC_DIRECT)
122 
123 #define NO_OS_I3C_CCC_EVENT_SIR NO_OS_BIT(0)
124 #define NO_OS_I3C_CCC_EVENT_MR NO_OS_BIT(1)
125 #define NO_OS_I3C_CCC_EVENT_HJ NO_OS_BIT(3)
126 
129 #define NO_OS_I3C_IRQ_IBI 0x1
130 #define NO_OS_I3C_IRQ_HJ 0x2
131 #define NO_OS_I3C_IRQ_CR 0x4
132 
135 #define NO_OS_I3C_BCR_IBI_REQUEST_CAPABLE(bcr) !!((bcr) & (1 << 1))
136 #define NO_OS_I3C_BCR_IBI_PAYLOAD(bcr) !!((bcr) & (1 << 2))
137 #define NO_OS_I3C_BCR_DEVICE_ROLE(bcr) (((bcr) && NO_OS_GENMASK(7,6)) >> 6)
138 
159 };
160 
166  uint32_t ibi_cr_addr;
168  uint32_t ibi_payload_len;
170  uint32_t ibi_payload;
171 };
172 
181  uint8_t addr;
182  uint64_t pid;
183 };
184 
185 /******************************************************************************/
186 /*************************** Types Declarations *******************************/
187 /******************************************************************************/
188 
195 
202  void* mutex;
204  uint8_t device_id;
208  uint8_t num_devs;
222  uint8_t irq_events;
226  bool async_irq;
230  void *extra;
231 };
232 
239  const uint32_t device_id;
243  const uint8_t num_devs;
245  const struct no_os_i3c_init_param **devs;
247  void *extra;
248 };
249 
265  uint64_t pid;
267  uint8_t addr;
269  bool is_static;
271  bool is_i3c;
272 };
273 
280  uint64_t pid;
282  uint8_t addr;
284  bool is_i3c;
288  bool is_static;
290  void *extra;
292  void (*event_callback)(struct no_os_i3c_desc*, uint32_t, uint32_t);
297 };
298 
307  const struct no_os_i3c_bus_init_param *);
309  int (*i3c_ops_init)(struct no_os_i3c_desc *,
310  const struct no_os_i3c_init_param *);
314  int (*i3c_ops_send_ccc)(struct no_os_i3c_bus_desc *, uint8_t, uint8_t,
315  bool, bool, uint8_t *, uint8_t);
317  int (*i3c_ops_write)(struct no_os_i3c_desc *, uint8_t *, uint8_t);
319  int (*i3c_ops_read)(struct no_os_i3c_desc *, uint8_t *, uint8_t);
321  int (*i3c_ops_write_and_read)(struct no_os_i3c_desc *, uint8_t *, uint8_t,
322  uint8_t *, uint8_t);
326  int (*i3c_ops_remove)(struct no_os_i3c_desc *);
331  uint8_t, bool);
334  uint8_t);
335 };
336 
337 /******************************************************************************/
338 /************************ Functions Declarations ******************************/
339 /******************************************************************************/
340 /* Initialize the I3C device. */
341 int no_os_i3c_init(struct no_os_i3c_desc **desc,
342  const struct no_os_i3c_init_param *param);
343 
344 /* Initialize the I3C bus. */
345 int no_os_i3c_init_bus(struct no_os_i3c_bus_desc **desc,
346  const struct no_os_i3c_bus_init_param *param);
347 
348 /* Free the resources allocated by no_os_i3c_init. */
349 int no_os_i3c_remove(struct no_os_i3c_desc *desc);
350 
351 /* Free the resources allocated by no_os_i3c_init_bus + no_os_i3c_init. */
352 int no_os_i3c_remove_bus(struct no_os_i3c_bus_desc *desc);
353 
354 /* Do I3C DAA to assign the dynamic addresses. */
355 int no_os_i3c_do_daa(struct no_os_i3c_bus_desc *desc, bool rstdaa);
356 
357 /* Send CCC on the bus (direct or broadcast). */
358 int no_os_i3c_send_ccc(struct no_os_i3c_bus_desc *desc,
359  uint8_t addr, uint32_t ccc, uint8_t *data);
360 
361 /* Send CCC to a device device. */
363  uint32_t ccc, uint8_t *data);
364 
365 /* Write data to a device device. */
366 int no_os_i3c_write(struct no_os_i3c_desc *desc,
367  uint8_t *data,
368  uint8_t size);
369 
370 /* Read data from a device device. */
371 int no_os_i3c_read(struct no_os_i3c_desc *desc,
372  uint8_t *data,
373  uint8_t size);
374 
375 /* Write and read data from a device device. */
377  uint8_t *tx_data,
378  uint8_t tx_data_len,
379  uint8_t *rx_data,
380  uint8_t rx_data_len);
381 
382 /* Configure enabled interrupt. */
383 int no_os_i3c_conf_irq(struct no_os_i3c_bus_desc *desc,
384  uint8_t irq, bool en);
385 
386 /* Wait I3C interrupt. */
387 int no_os_i3c_wait_irq(struct no_os_i3c_bus_desc* desc,
388  uint8_t irq);
389 
390 /* Non-blocking I3C interrupt. */
391 int no_os_i3c_call_irq(struct no_os_i3c_bus_desc* desc);
392 
393 /* Enable I3C non-blocking interrupts. */
394 int no_os_i3c_async_irq(struct no_os_i3c_bus_desc *desc, bool en);
395 
396 /* Get a free address. */
397 uint8_t no_os_i3c_addr_get_free(struct no_os_i3c_bus_desc *desc,
398  uint8_t start_addr);
399 
400 /* Set status of an address. */
402  uint8_t addr, enum no_os_i3c_slot_status status);
403 
404 /* Attach event callback. */
405 void no_os_i3c_attach_callback(struct no_os_i3c_desc *desc,
406  void (*callback)(struct no_os_i3c_desc*, uint32_t, uint32_t));
407 
408 /* Detach event callback. */
409 void no_os_i3c_detach_callback(struct no_os_i3c_desc *desc);
410 
411 #endif // _NO_OS_I3C_H_
no_os_i3c_bus_desc::platform_ops
const struct no_os_i3c_platform_ops * platform_ops
Definition: no_os_i3c.h:228
no_os_i3c_ccc_info::ibi_payload
uint32_t ibi_payload
Definition: no_os_i3c.h:170
no_os_i3c_init_param::pid
uint64_t pid
Definition: no_os_i3c.h:265
no_os_i3c_wait_irq
int no_os_i3c_wait_irq(struct no_os_i3c_bus_desc *desc, uint8_t irq)
Wait I3C interrupt. Set async_irq on call to false to ensure single entry point.
Definition: no_os_i3c.c:526
no_os_i3c_slot_status
no_os_i3c_slot_status
On an I3C bus, addresses are assigned dynamically, and we need to know which addresses are free to us...
Definition: no_os_i3c.h:148
NO_OS_I3C_ADDR_SLOT_I2C_DEV
@ NO_OS_I3C_ADDR_SLOT_I2C_DEV
Definition: no_os_i3c.h:154
no_os_i3c_bus_desc::irq_events
uint8_t irq_events
Definition: no_os_i3c.h:222
no_os_i3c_platform_ops::i3c_ops_read
int(* i3c_ops_read)(struct no_os_i3c_desc *, uint8_t *, uint8_t)
Definition: no_os_i3c.h:319
no_os_i3c_platform_ops::i3c_ops_conf_irq
int(* i3c_ops_conf_irq)(struct no_os_i3c_bus_desc *, uint8_t, bool)
Definition: no_os_i3c.h:330
no_os_i3c_desc::event_callback
void(* event_callback)(struct no_os_i3c_desc *, uint32_t, uint32_t)
Definition: no_os_i3c.h:292
no_os_i3c_bus_desc::ccc_info
struct no_os_i3c_ccc_info ccc_info
Definition: no_os_i3c.h:224
no_os_i3c_desc::bus
struct no_os_i3c_bus_desc * bus
Definition: no_os_i3c.h:296
no_os_i3c_desc
Structure holding I3C device descriptor.
Definition: no_os_i3c.h:278
no_os_i3c_addr_set_status
void no_os_i3c_addr_set_status(struct no_os_i3c_bus_desc *desc, uint8_t addr, enum no_os_i3c_slot_status status)
Set status of an address.
Definition: no_os_i3c.c:600
no_os_i3c_bus_init_param::devs
const struct no_os_i3c_init_param ** devs
Definition: no_os_i3c.h:245
no_os_i3c_bus_desc
Structure holding I3C bus descriptor.
Definition: no_os_i3c.h:200
no_os_i3c_desc::extra
void * extra
Definition: no_os_i3c.h:290
no_os_i3c_platform_ops::i3c_ops_remove_bus
int(* i3c_ops_remove_bus)(struct no_os_i3c_bus_desc *)
Definition: no_os_i3c.h:324
no_os_i3c_do_daa
int no_os_i3c_do_daa(struct no_os_i3c_bus_desc *desc, bool rstdaa)
Do DAA to assign the dynamic addresses.
Definition: no_os_i3c.c:335
bool
bool
Definition: common.h:48
no_os_i3c_bus_desc::extra
void * extra
Definition: no_os_i3c.h:230
no_os_i3c_ccc_info::ibi_payload_len
uint32_t ibi_payload_len
Definition: no_os_i3c.h:168
no_os_i3c_init_param::is_static
bool is_static
Definition: no_os_i3c.h:269
NO_OS_I3C_ADDR_SLOT_STATUS_MASK
@ NO_OS_I3C_ADDR_SLOT_STATUS_MASK
Definition: no_os_i3c.h:158
no_os_i3c_desc::is_attached
bool is_attached
Definition: no_os_i3c.h:286
no_os_i3c_platform_ops::i3c_ops_send_ccc
int(* i3c_ops_send_ccc)(struct no_os_i3c_bus_desc *, uint8_t, uint8_t, bool, bool, uint8_t *, uint8_t)
Definition: no_os_i3c.h:314
no_os_i3c_bus_init_param::platform_ops
const struct no_os_i3c_platform_ops * platform_ops
Definition: no_os_i3c.h:241
NO_OS_I3C_ADDR_SLOT_RSVD
@ NO_OS_I3C_ADDR_SLOT_RSVD
Definition: no_os_i3c.h:152
no_os_i3c_platform_ops::i3c_ops_get_ccc_info
int(* i3c_ops_get_ccc_info)(struct no_os_i3c_bus_desc *, uint8_t)
Definition: no_os_i3c.h:333
NO_OS_I3C_ADDRSLOTS_SIZE
#define NO_OS_I3C_ADDRSLOTS_SIZE
Definition: no_os_i3c.h:65
no_os_i3c_bus_init_param
Structure holding the parameters for I3C initialization.
Definition: no_os_i3c.h:237
no_os_i3c_bus_init_param::device_id
const uint32_t device_id
Definition: no_os_i3c.h:239
no_os_i3c_platform_ops::i3c_ops_write
int(* i3c_ops_write)(struct no_os_i3c_desc *, uint8_t *, uint8_t)
Definition: no_os_i3c.h:317
no_os_i3c_write_and_read
int no_os_i3c_write_and_read(struct no_os_i3c_desc *desc, uint8_t *tx_data, uint8_t tx_data_len, uint8_t *rx_data, uint8_t rx_data_len)
Read and write the device.
Definition: no_os_i3c.c:463
no_os_i3c_init_bus
int no_os_i3c_init_bus(struct no_os_i3c_bus_desc **desc, const struct no_os_i3c_bus_init_param *param)
Initialize the I3C bus.
Definition: no_os_i3c.c:161
no_os_i3c_bus_desc::async_irq
bool async_irq
Definition: no_os_i3c.h:226
no_os_i3c_platform_ops::i3c_ops_do_daa
int(* i3c_ops_do_daa)(struct no_os_i3c_bus_desc *, bool)
Definition: no_os_i3c.h:312
NO_OS_I3C_ADDR_SLOT_FREE
@ NO_OS_I3C_ADDR_SLOT_FREE
Definition: no_os_i3c.h:150
no_os_i3c_init
int no_os_i3c_init(struct no_os_i3c_desc **desc, const struct no_os_i3c_init_param *param)
Initialize the I3C device. If the bus of the I3C device is not initialized, it will call to init it.
Definition: no_os_i3c.c:66
no_os_i3c_detach_callback
void no_os_i3c_detach_callback(struct no_os_i3c_desc *desc)
Detach event callback.
Definition: no_os_i3c.c:695
no_os_i3c_init_param::addr
uint8_t addr
Definition: no_os_i3c.h:267
no_os_i3c_remove
int no_os_i3c_remove(struct no_os_i3c_desc *desc)
Free the resources allocated by no_os_i3c_init().
Definition: no_os_i3c.c:270
no_os_i3c_bus_desc::mutex
void * mutex
Definition: no_os_i3c.h:202
no_os_i3c_bus_desc::devs
struct no_os_i3c_desc * devs[NO_OS_I3C_MAX_DEV_NUMBER]
Definition: no_os_i3c.h:220
no_os_i3c_bus_desc::daa_candidates
struct no_os_i3c_daa_lut daa_candidates[NO_OS_I3C_MAX_DEV_NUMBER]
Definition: no_os_i3c.h:216
no_os_i3c_bus_desc::num_devs
uint8_t num_devs
Definition: no_os_i3c.h:208
no_os_i3c_send_direct_ccc
int no_os_i3c_send_direct_ccc(struct no_os_i3c_desc *desc, uint32_t ccc, uint8_t *data)
Send CCC to device device.
Definition: no_os_i3c.c:388
no_os_i3c_bus_desc::addrslots
unsigned int addrslots[NO_OS_I3C_ADDRSLOTS_SIZE]
Definition: no_os_i3c.h:214
no_os_i3c_async_irq
int no_os_i3c_async_irq(struct no_os_i3c_bus_desc *desc, bool en)
Enable I3C non-blocking interrupts.
Definition: no_os_i3c.c:510
no_os_i3c_bus_init_param::num_devs
const uint8_t num_devs
Definition: no_os_i3c.h:243
no_os_i3c_daa_lut::addr
uint8_t addr
Definition: no_os_i3c.h:181
no_os_i3c_desc::addr
uint8_t addr
Definition: no_os_i3c.h:282
no_os_i3c_platform_ops::i3c_ops_init
int(* i3c_ops_init)(struct no_os_i3c_desc *, const struct no_os_i3c_init_param *)
Definition: no_os_i3c.h:309
no_os_i3c_addr_get_free
uint8_t no_os_i3c_addr_get_free(struct no_os_i3c_bus_desc *desc, uint8_t start_addr)
Get a free address.
Definition: no_os_i3c.c:579
no_os_i3c_conf_irq
int no_os_i3c_conf_irq(struct no_os_i3c_bus_desc *desc, uint8_t irq, bool en)
Configure I3C interrupts.
Definition: no_os_i3c.c:492
no_os_i3c_platform_ops::i3c_ops_write_and_read
int(* i3c_ops_write_and_read)(struct no_os_i3c_desc *, uint8_t *, uint8_t, uint8_t *, uint8_t)
Definition: no_os_i3c.h:321
no_os_i3c_init_param::is_i3c
bool is_i3c
Definition: no_os_i3c.h:271
no_os_i3c_bus_desc::device_id
uint8_t device_id
Definition: no_os_i3c.h:204
no_os_i3c_send_ccc
int no_os_i3c_send_ccc(struct no_os_i3c_bus_desc *desc, uint8_t addr, uint32_t ccc, uint8_t *data)
Send CCC, either to a device device or broadcast to all.
Definition: no_os_i3c.c:354
no_os_i3c_init_param
Structure holding the parameters for I3C initialization. Works like a device tree,...
Definition: no_os_i3c.h:261
no_os_i3c_ccc_info::ibi_cr_addr
uint32_t ibi_cr_addr
Definition: no_os_i3c.h:166
no_os_i3c_daa_lut
Stores the PID + DA information to look-up during the DAA. Should be used only for device initializat...
Definition: no_os_i3c.h:179
no_os_i3c_desc::pid
uint64_t pid
Definition: no_os_i3c.h:280
no_os_i3c_desc::is_static
bool is_static
Definition: no_os_i3c.h:288
no_os_i3c_init_param::bus
struct no_os_i3c_bus_init_param * bus
Definition: no_os_i3c.h:263
no_os_i3c_desc::platform_ops
const struct no_os_i3c_platform_ops * platform_ops
Definition: no_os_i3c.h:294
no_os_i3c_ccc_info
Definition: no_os_i3c.h:164
no_os_i3c_write
int no_os_i3c_write(struct no_os_i3c_desc *desc, uint8_t *data, uint8_t size)
Write data to device device.
Definition: no_os_i3c.c:407
no_os_i3c_daa_lut::pid
uint64_t pid
Definition: no_os_i3c.h:182
no_os_i3c_daa_lut::is_attached
bool is_attached
Definition: no_os_i3c.h:180
no_os_i3c_desc::is_i3c
bool is_i3c
Definition: no_os_i3c.h:284
no_os_util.h
Header file of utility functions.
no_os_i3c_bus_desc::daa_unknown
struct no_os_i3c_daa_lut daa_unknown[NO_OS_I3C_MAX_DEV_NUMBER]
Definition: no_os_i3c.h:218
no_os_i3c_call_irq
int no_os_i3c_call_irq(struct no_os_i3c_bus_desc *desc)
Non-blocking I3C interrupt. Since a payload is always retrieved with it, also update the no_os_i3c_cc...
Definition: no_os_i3c.c:543
no_os_i3c_platform_ops::i3c_ops_is_dev_ready
int(* i3c_ops_is_dev_ready)(struct no_os_i3c_desc *)
Definition: no_os_i3c.h:328
no_os_i3c_platform_ops::i3c_ops_remove
int(* i3c_ops_remove)(struct no_os_i3c_desc *)
Definition: no_os_i3c.h:326
no_os_i3c_read
int no_os_i3c_read(struct no_os_i3c_desc *desc, uint8_t *data, uint8_t size)
Read data from device device.
Definition: no_os_i3c.c:434
NO_OS_I3C_ADDR_SLOT_I3C_DEV
@ NO_OS_I3C_ADDR_SLOT_I3C_DEV
Definition: no_os_i3c.h:156
no_os_i3c_platform_ops
Structure holding I3C function pointers that point to the platform specific function.
Definition: no_os_i3c.h:304
no_os_i3c_platform_ops::i3c_ops_init_bus
int(* i3c_ops_init_bus)(struct no_os_i3c_bus_desc *, const struct no_os_i3c_bus_init_param *)
Definition: no_os_i3c.h:306
no_os_i3c_remove_bus
int no_os_i3c_remove_bus(struct no_os_i3c_bus_desc *desc)
Free the resources allocated by no_os_i3c_init_bus. Must remove all devices first,...
Definition: no_os_i3c.c:302
no_os_i3c_bus_desc::num_devs_unknown
uint8_t num_devs_unknown
Definition: no_os_i3c.h:206
NO_OS_I3C_MAX_DEV_NUMBER
#define NO_OS_I3C_MAX_DEV_NUMBER
Definition: no_os_i3c.h:55
no_os_i3c_attach_callback
void no_os_i3c_attach_callback(struct no_os_i3c_desc *desc, void(*callback)(struct no_os_i3c_desc *, uint32_t, uint32_t))
Attach event callback.
Definition: no_os_i3c.c:685
no_os_i3c_bus_init_param::extra
void * extra
Definition: no_os_i3c.h:247