Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
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
21
extern
"C"
{
22
#endif
23
25
extern
const
struct
shell_transport_api
shell_rpmsg_transport_api;
26
28
struct
shell_rpmsg_rx {
30
void
*data;
32
size_t
len;
33
};
34
36
struct
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
91
int
shell_backend_rpmsg_init_transport
(
struct
rpmsg_device *rpmsg_dev);
92
101
const
struct
shell
*
shell_backend_rpmsg_get_ptr
(
void
);
102
104
105
#ifdef __cplusplus
106
}
107
#endif
108
109
#endif
/* ZEPHYR_INCLUDE_SHELL_SHELL_RPMSG_H_ */
shell_transport_handler_t
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Shell transport event handler callback.
Definition
shell.h:831
shell_backend_rpmsg_get_ptr
const struct shell * shell_backend_rpmsg_get_ptr(void)
This function provides pointer to shell RPMsg backend instance.
shell_backend_rpmsg_init_transport
int shell_backend_rpmsg_init_transport(struct rpmsg_device *rpmsg_dev)
Initialize the Shell backend using the provided rpmsg_dev device.
kernel.h
Public kernel APIs.
shell.h
Header file for the shell subsystem.
shell_transport_api
Unified shell transport interface.
Definition
shell.h:863
shell
Shell instance internals.
Definition
shell.h:1129
zephyr
shell
shell_rpmsg.h
Generated on
for Zephyr API by
1.17.0