Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
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 <zephyr/device.h>
18#include <zephyr/kernel.h>
19#include <zephyr/types.h>
20#include <zephyr/sys/util.h>
21
22#ifndef CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE
23#define CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE 0
24#endif
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30struct i3c_device_desc;
31
38
41
44
46
52};
53
57struct i3c_ibi {
60
63
66};
67
78
83};
84
94 sys_snode_t node;
100 struct k_work work;
101
106
107 union {
111 const struct device *controller;
112
118 };
119
120 union {
124 struct i3c_ibi_payload payload;
125
131 };
132};
133
151typedef int (*i3c_target_ibi_cb_t)(struct i3c_device_desc *target,
152 struct i3c_ibi_payload *payload);
153
154
172int i3c_ibi_work_enqueue(struct i3c_ibi_work *ibi_work);
173
190 uint8_t *payload, size_t payload_len);
191
206
221int i3c_ibi_work_enqueue_cb(const struct device *dev,
222 k_work_handler_t work_cb);
223
224#ifdef __cplusplus
225}
226#endif
227
232#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:23
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:151
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:35
@ I3C_IBI_CONTROLLER_ROLE_REQUEST
Controller Role Request.
Definition: ibi.h:40
@ I3C_IBI_TARGET_INTR
Target interrupt.
Definition: ibi.h:37
@ I3C_IBI_WORKQUEUE_CB
Not an actual IBI type, but simply used by the IBI workq for generic callbacks.
Definition: ibi.h:51
@ I3C_IBI_HOTJOIN
Hot Join Request.
Definition: ibi.h:43
@ I3C_IBI_TYPE_MAX
Definition: ibi.h:45
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:3276
Public kernel APIs.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
Structure describing a I3C target device.
Definition: i3c.h:913
Structure of payload buffer for IBI.
Definition: ibi.h:73
uint8_t payload_len
Length of available data in the payload buffer.
Definition: ibi.h:77
uint8_t payload[0]
Pointer to byte array as payload buffer.
Definition: ibi.h:82
Node about a queued IBI.
Definition: ibi.h:88
const struct device * controller
Use for.
Definition: ibi.h:111
enum i3c_ibi_type type
IBI type.
Definition: ibi.h:105
struct k_work work
k_work struct.
Definition: ibi.h:100
k_work_handler_t work_cb
Generic workqueue callback when type is I3C_IBI_WORKQUEUE_CB.
Definition: ibi.h:130
struct i3c_device_desc * target
Use for.
Definition: ibi.h:117
Struct for IBI request.
Definition: ibi.h:57
uint8_t * payload
Pointer to payload of IBI.
Definition: ibi.h:62
enum i3c_ibi_type ibi_type
Type of IBI.
Definition: ibi.h:59
uint8_t payload_len
Length in bytes of the IBI payload.
Definition: ibi.h:65
A structure used to submit work.
Definition: kernel.h:3875
Misc utilities.