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_RPMSG_H_
14#define ZEPHYR_INCLUDE_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
25
29 void *data;
31 size_t len;
32};
33
38
41
43 bool ready;
44
47
49 struct rpmsg_endpoint ept;
50
52 struct k_msgq rx_q;
53
55 struct shell_rpmsg_rx rx_buf[CONFIG_SHELL_RPMSG_MAX_RX];
56
59
62};
63
64#define SHELL_RPMSG_DEFINE(_name) \
65 static struct shell_rpmsg _name##_shell_rpmsg; \
66 struct shell_transport _name = { \
67 .api = &shell_rpmsg_transport_api, \
68 .ctx = (struct shell_rpmsg *)&_name##_shell_rpmsg, \
69 }
70
77int shell_backend_rpmsg_init_transport(struct rpmsg_device *rpmsg_dev);
78
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif /* ZEPHYR_INCLUDE_SHELL_RPMSG_H_ */
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition shell.h:795
Public kernel APIs.
const struct shell * shell_backend_rpmsg_get_ptr(void)
This function provides pointer to shell RPMsg backend instance.
const struct shell_transport_api shell_rpmsg_transport_api
int shell_backend_rpmsg_init_transport(struct rpmsg_device *rpmsg_dev)
Initialize the Shell backend using the provided rpmsg_dev device.
Message Queue Structure.
Definition kernel.h:5169
RPMsg received message placeholder.
Definition shell_rpmsg.h:27
size_t len
The length of the data.
Definition shell_rpmsg.h:31
void * data
Pointer to the data held by RPMsg endpoint.
Definition shell_rpmsg.h:29
RPMsg-based shell transport.
Definition shell_rpmsg.h:35
struct shell_rpmsg_rx rx_cur
The current rx message.
Definition shell_rpmsg.h:58
size_t rx_consumed
The number of bytes consumed from rx_cur.
Definition shell_rpmsg.h:61
shell_transport_handler_t shell_handler
Handler function registered by shell.
Definition shell_rpmsg.h:37
struct shell_rpmsg_rx rx_buf[CONFIG_SHELL_RPMSG_MAX_RX]
Buffer for received messages.
Definition shell_rpmsg.h:55
struct k_msgq rx_q
Queue for received data.
Definition shell_rpmsg.h:52
bool blocking
Setting for blocking mode.
Definition shell_rpmsg.h:46
bool ready
Indicator if we are ready to read/write.
Definition shell_rpmsg.h:43
void * shell_context
Context registered by shell.
Definition shell_rpmsg.h:40
struct rpmsg_endpoint ept
RPMsg endpoint.
Definition shell_rpmsg.h:49
Unified shell transport interface.
Definition shell.h:818
Shell instance internals.
Definition shell.h:1063