Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
shell_rpmsg.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Basalte bv
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_SHELL_SHELL_RPMSG_H_
14#define ZEPHYR_INCLUDE_SHELL_SHELL_RPMSG_H_
15
16#include <zephyr/kernel.h>
17#include <zephyr/shell/shell.h>
18#include <openamp/rpmsg.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
25extern const struct shell_transport_api shell_rpmsg_transport_api;
26
28struct shell_rpmsg_rx {
30 void *data;
32 size_t len;
33};
34
36struct shell_rpmsg {
38 shell_transport_handler_t shell_handler;
39
41 void *shell_context;
42
44 bool ready;
45
47 bool blocking;
48
50 struct rpmsg_endpoint ept;
51
53 struct k_msgq rx_q;
54
56 struct shell_rpmsg_rx rx_buf[CONFIG_SHELL_RPMSG_MAX_RX];
57
59 struct shell_rpmsg_rx rx_cur;
60
62 size_t rx_consumed;
63};
65
72
78#define SHELL_RPMSG_DEFINE(_name) \
79 static struct shell_rpmsg _name##_shell_rpmsg; \
80 struct shell_transport _name = { \
81 .api = &shell_rpmsg_transport_api, \
82 .ctx = (struct shell_rpmsg *)&_name##_shell_rpmsg, \
83 }
84
91int shell_backend_rpmsg_init_transport(struct rpmsg_device *rpmsg_dev);
92
102
104
105#ifdef __cplusplus
106}
107#endif
108
109#endif /* ZEPHYR_INCLUDE_SHELL_SHELL_RPMSG_H_ */
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Shell transport event handler callback.
Definition shell.h:831
const struct shell * shell_backend_rpmsg_get_ptr(void)
This function provides pointer to shell RPMsg backend instance.
int shell_backend_rpmsg_init_transport(struct rpmsg_device *rpmsg_dev)
Initialize the Shell backend using the provided rpmsg_dev device.
Public kernel APIs.
Header file for the shell subsystem.
Unified shell transport interface.
Definition shell.h:863
Shell instance internals.
Definition shell.h:1128