Zephyr API 3.6.99
Loading...
Searching...
No Matches
ibi.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_IBI_H_
8#define ZEPHYR_INCLUDE_DRIVERS_I3C_IBI_H_
9
17#include <stdint.h>
18
19#include <zephyr/device.h>
20#include <zephyr/kernel.h>
21#include <zephyr/sys/slist.h>
22
23#ifndef CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE
24#define CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE 0
25#endif
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31struct i3c_device_desc;
32
54
68
85
91
95 struct k_work work;
96
101
102 union {
106 const struct device *controller;
107
113 };
114
115 union {
119 struct i3c_ibi_payload payload;
120
126 };
127};
128
146typedef int (*i3c_target_ibi_cb_t)(struct i3c_device_desc *target,
147 struct i3c_ibi_payload *payload);
148
149
167int i3c_ibi_work_enqueue(struct i3c_ibi_work *ibi_work);
168
185 uint8_t *payload, size_t payload_len);
186
201
216int i3c_ibi_work_enqueue_cb(const struct device *dev,
217 k_work_handler_t work_cb);
218
219#ifdef __cplusplus
220}
221#endif
222
227#endif /* ZEPHYR_INCLUDE_DRIVERS_I3C_IBI_H_ */
int i3c_ibi_work_enqueue_cb(const struct device *dev, k_work_handler_t work_cb)
Queue a generic callback for future processing.
#define CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE
Definition ibi.h:24
int i3c_ibi_work_enqueue_target_irq(struct i3c_device_desc *target, uint8_t *payload, size_t payload_len)
Queue a target interrupt IBI for future processing.
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
int i3c_ibi_work_enqueue(struct i3c_ibi_work *ibi_work)
Queue an IBI work item for future processing.
int i3c_ibi_work_enqueue_hotjoin(const struct device *dev)
Queue a hot join IBI for future processing.
i3c_ibi_type
IBI Types.
Definition ibi.h:36
@ I3C_IBI_CONTROLLER_ROLE_REQUEST
Controller Role Request.
Definition ibi.h:41
@ I3C_IBI_TARGET_INTR
Target interrupt.
Definition ibi.h:38
@ I3C_IBI_WORKQUEUE_CB
Not an actual IBI type, but simply used by the IBI workq for generic callbacks.
Definition ibi.h:52
@ I3C_IBI_HOTJOIN
Hot Join Request.
Definition ibi.h:44
@ I3C_IBI_TYPE_MAX
Definition ibi.h:46
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
void(* k_work_handler_t)(struct k_work *work)
The signature for a work item handler function.
Definition kernel.h:3356
Public kernel APIs.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:403
Structure describing a I3C target device.
Definition i3c.h:915
Structure of payload buffer for IBI.
Definition ibi.h:74
uint8_t payload_len
Length of available data in the payload buffer.
Definition ibi.h:78
uint8_t payload[0]
Pointer to byte array as payload buffer.
Definition ibi.h:83
Node about a queued IBI.
Definition ibi.h:89
const struct device * controller
Use for.
Definition ibi.h:106
enum i3c_ibi_type type
IBI type.
Definition ibi.h:100
struct k_work work
k_work struct.
Definition ibi.h:95
sys_snode_t node
Definition ibi.h:90
k_work_handler_t work_cb
Generic workqueue callback when type is I3C_IBI_WORKQUEUE_CB.
Definition ibi.h:125
struct i3c_device_desc * target
Use for.
Definition ibi.h:112
Struct for IBI request.
Definition ibi.h:58
uint8_t * payload
Pointer to payload of IBI.
Definition ibi.h:63
enum i3c_ibi_type ibi_type
Type of IBI.
Definition ibi.h:60
uint8_t payload_len
Length in bytes of the IBI payload.
Definition ibi.h:66
A structure used to submit work.
Definition kernel.h:3957