Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
icmsg.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_IPC_ICMSG_H_
8#define ZEPHYR_INCLUDE_IPC_ICMSG_H_
9
10#include <stddef.h>
11#include <stdint.h>
12#include <zephyr/kernel.h>
13#include <zephyr/drivers/mbox.h>
15#include <zephyr/ipc/pbuf.h>
16#include <zephyr/sys/atomic.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
34
39
41 /* Tx/Rx buffers. */
42 struct pbuf *tx_pb;
43 struct pbuf *rx_pb;
44#ifdef CONFIG_IPC_SERVICE_ICMSG_SHMEM_ACCESS_SYNC
45 struct k_mutex tx_lock;
46#endif
47
48 /* Callbacks for an endpoint. */
49 const struct ipc_service_cb *cb;
50 void *ctx;
51
52 /* General */
53 const struct icmsg_config_t *cfg;
57};
58
83int icmsg_open(const struct icmsg_config_t *conf,
84 struct icmsg_data_t *dev_data,
85 const struct ipc_service_cb *cb, void *ctx);
86
101int icmsg_close(const struct icmsg_config_t *conf,
102 struct icmsg_data_t *dev_data);
103
122int icmsg_send(const struct icmsg_config_t *conf,
123 struct icmsg_data_t *dev_data,
124 const void *msg, size_t len);
125
130#ifdef __cplusplus
131}
132#endif
133
134#endif /* ZEPHYR_INCLUDE_IPC_ICMSG_H_ */
long atomic_t
Definition atomic_types.h:15
int icmsg_close(const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data)
Close an icmsg instance.
int icmsg_send(const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data, const void *msg, size_t len)
Send a message to the remote icmsg instance.
int icmsg_open(const struct icmsg_config_t *conf, struct icmsg_data_t *dev_data, const struct ipc_service_cb *cb, void *ctx)
Open an icmsg instance.
icmsg_state
Definition icmsg.h:29
@ ICMSG_STATE_BUSY
Definition icmsg.h:31
@ ICMSG_STATE_READY
Definition icmsg.h:32
@ ICMSG_STATE_OFF
Definition icmsg.h:30
Public kernel APIs.
Definition icmsg.h:35
struct mbox_dt_spec mbox_tx
Definition icmsg.h:36
struct mbox_dt_spec mbox_rx
Definition icmsg.h:37
Definition icmsg.h:40
const struct ipc_service_cb * cb
Definition icmsg.h:49
struct k_work_delayable notify_work
Definition icmsg.h:54
const struct icmsg_config_t * cfg
Definition icmsg.h:53
struct k_work mbox_work
Definition icmsg.h:55
struct pbuf * tx_pb
Definition icmsg.h:42
struct pbuf * rx_pb
Definition icmsg.h:43
void * ctx
Definition icmsg.h:50
atomic_t state
Definition icmsg.h:56
Event callback structure.
Definition ipc_service.h:145
Mutex Structure.
Definition kernel.h:2917
A structure used to submit work after a delay.
Definition kernel.h:3908
A structure used to submit work.
Definition kernel.h:3880
MBOX specification from DT.
Definition mbox.h:87
Scure packed buffer.
Definition pbuf.h:89
static void msg(uint64_t c64)
Definition main.c:17