Zephyr API Documentation 4.0.0-rc2
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
7#ifndef ZEPHYR_INCLUDE_SHELL_RPMSG_H_
8#define ZEPHYR_INCLUDE_SHELL_RPMSG_H_
9
10#include <zephyr/kernel.h>
11#include <zephyr/shell/shell.h>
12#include <openamp/rpmsg.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19
23 void *data;
25 size_t len;
26};
27
32
35
37 bool ready;
38
41
43 struct rpmsg_endpoint ept;
44
46 struct k_msgq rx_q;
47
49 struct shell_rpmsg_rx rx_buf[CONFIG_SHELL_RPMSG_MAX_RX];
50
53
56};
57
58#define SHELL_RPMSG_DEFINE(_name) \
59 static struct shell_rpmsg _name##_shell_rpmsg; \
60 struct shell_transport _name = { \
61 .api = &shell_rpmsg_transport_api, \
62 .ctx = (struct shell_rpmsg *)&_name##_shell_rpmsg, \
63 }
64
71int shell_backend_rpmsg_init_transport(struct rpmsg_device *rpmsg_dev);
72
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif /* ZEPHYR_INCLUDE_SHELL_RPMSG_H_ */
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition shell.h:624
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:4503
RPMsg received message placeholder.
Definition shell_rpmsg.h:21
size_t len
The length of the data.
Definition shell_rpmsg.h:25
void * data
Pointer to the data held by RPMsg endpoint.
Definition shell_rpmsg.h:23
RPMsg-based shell transport.
Definition shell_rpmsg.h:29
struct shell_rpmsg_rx rx_cur
The current rx message.
Definition shell_rpmsg.h:52
size_t rx_consumed
The number of bytes consumed from rx_cur.
Definition shell_rpmsg.h:55
shell_transport_handler_t shell_handler
Handler function registered by shell.
Definition shell_rpmsg.h:31
struct shell_rpmsg_rx rx_buf[CONFIG_SHELL_RPMSG_MAX_RX]
Buffer for received messages.
Definition shell_rpmsg.h:49
struct k_msgq rx_q
Queue for received data.
Definition shell_rpmsg.h:46
bool blocking
Setting for blocking mode.
Definition shell_rpmsg.h:40
bool ready
Indicator if we are ready to read/write.
Definition shell_rpmsg.h:37
void * shell_context
Context registered by shell.
Definition shell_rpmsg.h:34
struct rpmsg_endpoint ept
RPMsg endpoint.
Definition shell_rpmsg.h:43
Unified shell transport interface.
Definition shell.h:646
Shell instance internals.
Definition shell.h:890