Zephyr Project API 3.7.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
166 void (*received)(const void *data, size_t len, void *priv);
167
173 void (*error)(const char *message, void *priv);
174};
175
181struct ipc_ept {
182
184 const struct device *instance;
185
187 void *token;
188};
189
192
194 const char *name;
195
197 int prio;
198
201
203 void *priv;
204};
205
220int ipc_service_open_instance(const struct device *instance);
221
239int ipc_service_close_instance(const struct device *instance);
240
261int ipc_service_register_endpoint(const struct device *instance,
262 struct ipc_ept *ept,
263 const struct ipc_ept_cfg *cfg);
264
282
301int ipc_service_send(struct ipc_ept *ept, const void *data, size_t len);
302
320
368int ipc_service_get_tx_buffer(struct ipc_ept *ept, void **data, uint32_t *size, k_timeout_t wait);
369
390int ipc_service_drop_tx_buffer(struct ipc_ept *ept, const void *data);
391
424int ipc_service_send_nocopy(struct ipc_ept *ept, const void *data, size_t len);
425
450
476
481#ifdef __cplusplus
482}
483#endif
484
485#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:403
Endpoint configuration structure.
Definition ipc_service.h:191
struct ipc_service_cb cb
Event callback structure.
Definition ipc_service.h:200
void * priv
Private user data.
Definition ipc_service.h:203
const char * name
Name of the endpoint.
Definition ipc_service.h:194
int prio
Endpoint priority.
Definition ipc_service.h:197
Endpoint instance.
Definition ipc_service.h:181
void * token
Backend-specific token used to identify an endpoint in an instance.
Definition ipc_service.h:187
const struct device * instance
Instance this endpoint belongs to.
Definition ipc_service.h:184
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:166
void(* error)(const char *message, void *priv)
An error occurred.
Definition ipc_service.h:173
Kernel timeout type.
Definition sys_clock.h:65
static fdata_t data[2]
Definition test_fifo_contexts.c:15