forked from EmbeddedRPC/erpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
erpc_rpmsg_lite_base.hpp
83 lines (69 loc) · 2.49 KB
/
erpc_rpmsg_lite_base.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
* Copyright 2016-2021 NXP
* Copyright 2021 ACRIOS Systems s.r.o.
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _EMBEDDED_RPC__RPMSG_LITE_BASE_H_
#define _EMBEDDED_RPC__RPMSG_LITE_BASE_H_
#include "erpc_config_internal.h"
extern "C" {
#include "rpmsg_env_specific.h"
#include "rpmsg_lite.h"
}
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
#ifndef RL_USE_STATIC_API
#warning "RPMSG is not set to use static allocation"
#endif
#endif
/*!
* @addtogroup rpmsg_lite_transport
* @addtogroup rpmsg_lite_rtos_transport
* @{
* @file
*/
////////////////////////////////////////////////////////////////////////////////
// Definitions
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Classes
////////////////////////////////////////////////////////////////////////////////
namespace erpc {
/*!
* @brief Transport that other RPMsg transports inherits.
*
* @ingroup rpmsg_lite_transport
* @ingroup rpmsg_lite_rtos_transport
*/
class RPMsgBase
{
public:
RPMsgBase(void){};
virtual ~RPMsgBase(void) {}
/*!
* @brief This function returns pointer to instance of RPMSG lite
*
* @retval pointer to instance of RPMSG lite
*/
struct rpmsg_lite_instance *get_rpmsg_lite_instance(void) { return s_rpmsg; }
protected:
static struct rpmsg_lite_instance *s_rpmsg; /*!< Pointer to instance of RPMSG lite. */
static uint8_t s_initialized; /*!< Represent information if the rpmsg-lite was initialized. */
#if RL_USE_STATIC_API
struct rpmsg_lite_instance m_static_context; /*!< RPMsg-Lite preallocated context used in case of static api */
struct rpmsg_lite_ept_static_context
m_ept_context; /*!< RPMsg-Lite endpoint preallocated context used in case of static api */
#ifdef RL_ENV_QUEUE_STATIC_STORAGE_SIZE
rpmsg_static_queue_ctxt
m_queue_context; /*!< RPMsg-Lite queue preallocated context used in case of static api and an RTOS-based env. */
uint8_t m_queue_stack[RL_ENV_QUEUE_STATIC_STORAGE_SIZE]; /*!< RPMsg-Lite queue static storage used in case of static
api and an RTOS-based env. */
#endif /* RL_ENV_QUEUE_STATIC_STORAGE_SIZE */
#endif
};
} // namespace erpc
/*! @} */
#endif // _EMBEDDED_RPC__RPMSG_LITE_BASE_H_