eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_rpmsg_lite_rtos_transport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2022 NXP
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #ifndef _EMBEDDED_RPC__RPMSG_LITE_RTOS_TRANSPORT_H_
11 #define _EMBEDDED_RPC__RPMSG_LITE_RTOS_TRANSPORT_H_
12 
13 #include "erpc_crc16.hpp"
14 #include "erpc_message_buffer.hpp"
15 #include "erpc_rpmsg_lite_base.hpp"
16 #include "erpc_transport.hpp"
17 
18 extern "C" {
19 #include "rpmsg_lite.h"
20 #include "rpmsg_queue.h"
21 }
22 
29 // Definitions
32 
34 // Classes
36 
37 namespace erpc {
43 class RPMsgRTOSTransport : public Transport, public RPMsgBase
44 {
45 public:
51  RPMsgRTOSTransport(void);
52 
56  virtual ~RPMsgRTOSTransport(void);
57 
70  virtual erpc_status_t init(uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t length,
71  uint32_t rpmsg_link_id);
72 
87  virtual erpc_status_t init(uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t rpmsg_link_id,
88  void (*ready_cb)(void), char *nameservice_name);
89 
100  virtual erpc_status_t receive(MessageBuffer *message) override;
101 
110  virtual erpc_status_t send(MessageBuffer *message) override;
111 
119  virtual bool hasMessage(void) override;
120 
126  virtual void setCrc16(Crc16 *crcImpl) override;
127 
133  virtual Crc16 *getCrc16(void) override;
134 
135 protected:
136  /* Remote device */
137  struct remote_device *m_rdev;
138  struct rpmsg_channel *m_app_rp_chnl;
139  uint32_t m_dst_addr;
140  rpmsg_queue_handle m_rpmsg_queue;
141  struct rpmsg_lite_endpoint *m_rpmsg_ept;
143 };
144 
145 } // namespace erpc
146 
149 #endif // _EMBEDDED_RPC__RPMSG_LITE_RTOS_TRANSPORT_H_
Abstract interface for transport layer.
Definition: erpc_transport.hpp:36
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
Crc16 * m_crcImpl
CRC object.
Definition: erpc_rpmsg_lite_rtos_transport.hpp:142
Transport that uses RPMsg zero copy RTOS API for interprocessor messaging.
Definition: erpc_rpmsg_lite_rtos_transport.hpp:43
virtual erpc_status_t init(uint32_t src_addr, uint32_t dst_addr, void *base_address, uint32_t length, uint32_t rpmsg_link_id)
This function call RPMsg rtos init function - as RPMsg master.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:70
uint32_t m_dst_addr
Definition: erpc_rpmsg_lite_rtos_transport.hpp:139
virtual Crc16 * getCrc16(void) override
This functions gets the CRC-16 object.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:288
virtual erpc_status_t send(MessageBuffer *message) override
Function to send prepared message.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:253
virtual void setCrc16(Crc16 *crcImpl) override
This functions sets the CRC-16 implementation.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:282
Represents a memory buffer containing a message.
Definition: erpc_message_buffer.hpp:37
Definition: erpc_arbitrated_client_manager.hpp:25
RPMsgRTOSTransport(void)
Constructor.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:31
Class for compute crc16.
Definition: erpc_crc16.hpp:29
Transport that other RPMsg transports inherits.
Definition: erpc_rpmsg_lite_base.hpp:49
rpmsg_queue_handle m_rpmsg_queue
Definition: erpc_rpmsg_lite_rtos_transport.hpp:140
virtual ~RPMsgRTOSTransport(void)
RPMsgRTOSTransport destructor.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:37
virtual bool hasMessage(void) override
Function to check if is message in receive queue and wait for processing.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:277
struct rpmsg_lite_endpoint * m_rpmsg_ept
Definition: erpc_rpmsg_lite_rtos_transport.hpp:141
struct remote_device * m_rdev
Definition: erpc_rpmsg_lite_rtos_transport.hpp:137
struct rpmsg_channel * m_app_rp_chnl
Definition: erpc_rpmsg_lite_rtos_transport.hpp:138
virtual erpc_status_t receive(MessageBuffer *message) override
Store incoming message to message buffer.
Definition: erpc_rpmsg_lite_rtos_transport.cpp:239