Zephyr Project API 4.1.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
ipc_service.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_IPC_IPC_SERVICE_H_
8#define ZEPHYR_INCLUDE_IPC_IPC_SERVICE_H_
9
10#include <stdio.h>
11#include <zephyr/device.h>
12#include <zephyr/kernel.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
152 void (*bound)(void *priv);
153
167 void (*unbound)(void *priv);
168
181 void (*received)(const void *data, size_t len, void *priv);
182
188 void (*error)(const char *message, void *priv);
189};
190
196struct ipc_ept {
197
199 const struct device *instance;
200
202 void *token;
203};
204
207
209 const char *name;
210
212 int prio;
213
216
218 void *priv;
219};
220
235int ipc_service_open_instance(const struct device *instance);
236
254int ipc_service_close_instance(const struct device *instance);
255
276int ipc_service_register_endpoint(const struct device *instance,
277 struct ipc_ept *ept,
278 const struct ipc_ept_cfg *cfg);
279
297
316int ipc_service_send(struct ipc_ept *ept, const void *data, size_t len);
317
335
383int ipc_service_get_tx_buffer(struct ipc_ept *ept, void **data, uint32_t *size, k_timeout_t wait);
384
405int ipc_service_drop_tx_buffer(struct ipc_ept *ept, const void *data);
406
439int ipc_service_send_nocopy(struct ipc_ept *ept, const void *data, size_t len);
440
464int ipc_service_hold_rx_buffer(struct ipc_ept *ept, void *data);
465
490int ipc_service_release_rx_buffer(struct ipc_ept *ept, void *data);
491
496#ifdef __cplusplus
497}
498#endif
499
500#endif /* ZEPHYR_INCLUDE_IPC_IPC_SERVICE_H_ */
int ipc_service_deregister_endpoint(struct ipc_ept *ept)
Deregister an IPC endpoint from its instance.
int ipc_service_drop_tx_buffer(struct ipc_ept *ept, const void *data)
Drop and release a TX buffer.
int ipc_service_get_tx_buffer_size(struct ipc_ept *ept)
Get the TX buffer size.
int ipc_service_send_nocopy(struct ipc_ept *ept, const void *data, size_t len)
Send data in a TX buffer reserved by ipc_service_get_tx_buffer using the given IPC endpoint.
int ipc_service_close_instance(const struct device *instance)
Close an instance.
int ipc_service_get_tx_buffer(struct ipc_ept *ept, void **data, uint32_t *size, k_timeout_t wait)
Get an empty TX buffer to be sent using ipc_service_send_nocopy.
int ipc_service_register_endpoint(const struct device *instance, struct ipc_ept *ept, const struct ipc_ept_cfg *cfg)
Register IPC endpoint onto an instance.
int ipc_service_send(struct ipc_ept *ept, const void *data, size_t len)
Send data using given IPC endpoint.
int ipc_service_hold_rx_buffer(struct ipc_ept *ept, void *data)
Holds the RX buffer for usage outside the receive callback.
int ipc_service_release_rx_buffer(struct ipc_ept *ept, void *data)
Release the RX buffer for future reuse.
int ipc_service_open_instance(const struct device *instance)
Open an instance.
Public kernel APIs.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:453
Endpoint configuration structure.
Definition ipc_service.h:206
struct ipc_service_cb cb
Event callback structure.
Definition ipc_service.h:215
void * priv
Private user data.
Definition ipc_service.h:218
const char * name
Name of the endpoint.
Definition ipc_service.h:209
int prio
Endpoint priority.
Definition ipc_service.h:212
Endpoint instance.
Definition ipc_service.h:196
void * token
Backend-specific token used to identify an endpoint in an instance.
Definition ipc_service.h:202
const struct device * instance
Instance this endpoint belongs to.
Definition ipc_service.h:199
Event callback structure.
Definition ipc_service.h:145
void(* bound)(void *priv)
Bind was successful.
Definition ipc_service.h:152
void(* received)(const void *data, size_t len, void *priv)
New packet arrived.
Definition ipc_service.h:181
void(* unbound)(void *priv)
The endpoint unbound by the remote.
Definition ipc_service.h:167
void(* error)(const char *message, void *priv)
An error occurred.
Definition ipc_service.h:188
Kernel timeout type.
Definition sys_clock.h:65