Zephyr Project API 4.5.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
iodev.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2022 Intel Corporation
3 * SPDX-FileCopyrightText: Copyright (c) 2026 Infineon Technologies AG,
4 * SPDX-FileCopyrightText: or an affiliate of Infineon Technologies AG. All rights reserved.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
14
15#ifndef ZEPHYR_INCLUDE_RTIO_IODEV_H_
16#define ZEPHYR_INCLUDE_RTIO_IODEV_H_
17
18#include <zephyr/rtio/sqe.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28
30struct rtio;
31struct rtio_iodev;
32struct rtio_iodev_sqe;
34
47 void (*submit)(struct rtio_iodev_sqe *iodev_sqe);
48
77 void (*cancel)(const struct rtio_iodev *iodev, struct rtio *r, rtio_sqe_handle_t handle);
78};
79
83struct rtio_iodev {
85 const struct rtio_iodev_api *api;
86
88 void *data;
89};
90
91/* Do not try and reformat the macros */
92/* clang-format off */
93
101#define RTIO_IODEV_DEFINE(name, iodev_api, iodev_data) \
102 STRUCT_SECTION_ITERABLE(rtio_iodev, name) = { \
103 .api = (iodev_api), \
104 .data = (iodev_data), \
105 }
106
107/* clang-format on */
108
112
113#ifdef __cplusplus
114}
115#endif
116
117#endif /* ZEPHYR_INCLUDE_RTIO_IODEV_H_ */
workaround assembler barfing for ST r
Definition asm-macro-32-bit-gnu.h:27
uint32_t rtio_sqe_handle_t
Opaque identity for a submission queue entry.
Definition sqe.h:322
RTIO Submission Queue Events and Related Functions.
API that an RTIO IO device should implement.
Definition iodev.h:38
void(* cancel)(const struct rtio_iodev *iodev, struct rtio *r, rtio_sqe_handle_t handle)
Attempt to actively cancel a previously submitted entry.
Definition iodev.h:77
void(* submit)(struct rtio_iodev_sqe *iodev_sqe)
Submit to the iodev an entry to work on.
Definition iodev.h:47
IO device submission queue entry.
Definition sqe.h:459
An IO device with a function table for submitting requests.
Definition iodev.h:83
const struct rtio_iodev_api * api
Function pointer table.
Definition iodev.h:85
void * data
Data associated with this iodev.
Definition iodev.h:88
An RTIO context containing what can be viewed as a pair of queues.
Definition rtio.h:83