eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_rpmsg_lite_transport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2023 NXP
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #ifndef _EMBEDDED_RPC__RPMSG_LITE_TRANSPORT_H_
11 #define _EMBEDDED_RPC__RPMSG_LITE_TRANSPORT_H_
12 
13 #include "erpc_config_internal.h"
14 #include "erpc_crc16.hpp"
15 #include "erpc_message_buffer.hpp"
16 #include "erpc_rpmsg_lite_base.hpp"
17 #include "erpc_static_queue.hpp"
18 #include "erpc_transport.hpp"
19 
20 extern "C" {
21 #include "rpmsg_lite.h"
22 }
23 
30 // Definitions
33 
35 // Classes
37 
38 namespace erpc {
44 class RPMsgTransport : public Transport, public RPMsgBase
45 {
46 public:
52  RPMsgTransport(void);
53 
57  virtual ~RPMsgTransport(void);
58 
73  virtual erpc_status_t init(uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t length,
74  uint32_t rpmsg_link_id);
75 
92  virtual erpc_status_t init(uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t rpmsg_link_id,
93  void (*ready_cb)(void), char *nameservice_name);
94 
104  virtual erpc_status_t receive(MessageBuffer *message) override;
105 
114  virtual erpc_status_t send(MessageBuffer *message) override;
115 
123  virtual bool hasMessage(void) override;
124 
130  virtual void setCrc16(Crc16 *crcImpl) override;
131 
137  virtual Crc16 *getCrc16(void) override;
138 
139 protected:
153  static int32_t rpmsg_read_cb(void *payload, uint32_t payload_len, uint32_t src, void *priv);
154 
158  uint32_t m_dst_addr;
159  struct rpmsg_lite_endpoint *m_rpmsg_ept;
161 };
162 
163 } // namespace erpc
164 
167 #endif // _EMBEDDED_RPC__RPMSG_LITE_TRANSPORT_H_
Abstract interface for transport layer.
Definition: erpc_transport.hpp:36
static int32_t rpmsg_read_cb(void *payload, uint32_t payload_len, uint32_t src, void *priv)
RPMSG callback for receiving data.
Definition: erpc_rpmsg_lite_transport.cpp:30
virtual ~RPMsgTransport(void)
RPMsgTransport destructor.
Definition: erpc_rpmsg_lite_transport.cpp:44
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
struct rpmsg_lite_endpoint * m_rpmsg_ept
Definition: erpc_rpmsg_lite_transport.hpp:159
RPMsgTransport(void)
Constructor.
Definition: erpc_rpmsg_lite_transport.cpp:42
virtual Crc16 * getCrc16(void) override
This functions gets the CRC-16 object.
Definition: erpc_rpmsg_lite_transport.cpp:225
virtual erpc_status_t receive(MessageBuffer *message) override
Set message to first received message.
Definition: erpc_rpmsg_lite_transport.cpp:196
StaticQueue< MessageBuffer, 2U *ERPC_DEFAULT_BUFFERS_COUNT > m_messageQueue
Definition: erpc_rpmsg_lite_transport.hpp:156
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.hpp:37
Definition: erpc_arbitrated_client_manager.hpp:25
virtual erpc_status_t init(uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t length, uint32_t rpmsg_link_id)
Initialization of RPMsgTransport layer - as RPMsg master.
Definition: erpc_rpmsg_lite_transport.cpp:69
Transport that uses RPMsg zero copy API for interprocessor messaging.
Definition: erpc_rpmsg_lite_transport.hpp:44
uint32_t m_dst_addr
Definition: erpc_rpmsg_lite_transport.hpp:158
Class for compute crc16.
Definition: erpc_crc16.hpp:29
Transport that other RPMsg transports inherits.
Definition: erpc_rpmsg_lite_base.hpp:49
virtual void setCrc16(Crc16 *crcImpl) override
This functions sets the CRC-16 implementation.
Definition: erpc_rpmsg_lite_transport.cpp:219
Crc16 * m_crcImpl
CRC object.
Definition: erpc_rpmsg_lite_transport.hpp:160
virtual bool hasMessage(void) override
Function to check if is message in receive queue and wait for processing.
Definition: erpc_rpmsg_lite_transport.cpp:214
virtual erpc_status_t send(MessageBuffer *message) override
Function to send prepared message.
Definition: erpc_rpmsg_lite_transport.cpp:205
Template class which implements static queue as ring buffer.
Definition: erpc_static_queue.hpp:33