Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pipelink.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Trackunit Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <zephyr/modem/pipe.h>
8#include <zephyr/devicetree.h>
9#include <zephyr/sys/util.h>
10
11#ifndef ZEPHYR_MODEM_PIPELINK_
12#define ZEPHYR_MODEM_PIPELINK_
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
26
34
36
38struct modem_pipelink;
39
41
48typedef void (*modem_pipelink_callback)(struct modem_pipelink *link,
49 enum modem_pipelink_event event,
50 void *user_data);
51
53
55struct modem_pipelink {
56 struct modem_pipe *pipe;
58 void *user_data;
59 bool connected;
60 struct k_spinlock spinlock;
61};
62
64
71void modem_pipelink_attach(struct modem_pipelink *link,
73 void *user_data);
74
81bool modem_pipelink_is_connected(struct modem_pipelink *link);
82
89struct modem_pipe *modem_pipelink_get_pipe(struct modem_pipelink *link);
90
95void modem_pipelink_release(struct modem_pipelink *link);
96
98
100void modem_pipelink_init(struct modem_pipelink *link, struct modem_pipe *pipe);
101
103void modem_pipelink_notify_connected(struct modem_pipelink *link);
104
106void modem_pipelink_notify_disconnected(struct modem_pipelink *link);
107
109
111
117#define MODEM_PIPELINK_DT_SYM(node_id, name) \
118 _CONCAT_4(__modem_pipelink_, DT_DEP_ORD(node_id), _, name)
119
121
127#define MODEM_PIPELINK_DT_DECLARE(node_id, name) \
128 extern struct modem_pipelink MODEM_PIPELINK_DT_SYM(node_id, name)
129
135#define MODEM_PIPELINK_DT_DEFINE(node_id, name) \
136 struct modem_pipelink MODEM_PIPELINK_DT_SYM(node_id, name)
137
143#define MODEM_PIPELINK_DT_GET(node_id, name) \
144 (&MODEM_PIPELINK_DT_SYM(node_id, name))
145
152
153#define MODEM_PIPELINK_DT_INST_DECLARE(inst, name) \
154 MODEM_PIPELINK_DT_DECLARE(DT_DRV_INST(inst), name)
155
156#define MODEM_PIPELINK_DT_INST_DEFINE(inst, name) \
157 MODEM_PIPELINK_DT_DEFINE(DT_DRV_INST(inst), name)
158
159#define MODEM_PIPELINK_DT_INST_GET(inst, name) \
160 MODEM_PIPELINK_DT_GET(DT_DRV_INST(inst), name)
161
163
165
166#ifdef __cplusplus
167}
168#endif
169
170#endif /* ZEPHYR_MODEM_PIPELINK_ */
Devicetree main header.
Kernel Spin Lock.
Definition spinlock.h:45
Misc utilities.