eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_uart_cmsis_transport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2020 NXP
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #ifndef _EMBEDDED_RPC__UART_TRANSPORT_H_
11 #define _EMBEDDED_RPC__UART_TRANSPORT_H_
12 
13 #include "erpc_config_internal.h"
14 
15 #include <cstdlib>
16 #if !ERPC_THREADS_IS(NONE)
17 #include "erpc_threading.h"
18 #endif
20 
21 extern "C" {
22 #include "Driver_USART.h"
23 }
24 
31 // Classes
34 
35 namespace erpc {
42 {
43 public:
49  explicit UartTransport(ARM_DRIVER_USART *uartDrv);
50 
54  virtual ~UartTransport(void);
55 
63  virtual erpc_status_t init(void);
64 
70  void rx_cb(void);
71 
77  void tx_cb(void);
78 
79 protected:
80  ARM_DRIVER_USART *m_uartDrv;
81 #if !ERPC_THREADS_IS(NONE)
84 #endif
85 private:
88 
98  virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size) override;
99 
108  virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size) override;
109 };
110 
111 } // namespace erpc
112 
115 #endif // _EMBEDDED_RPC__UART_TRANSPORT_H_
ARM_DRIVER_USART * m_uartDrv
Definition: erpc_uart_cmsis_transport.hpp:80
Base class for framed transport layers.
Definition: erpc_framed_transport.hpp:56
void tx_cb(void)
Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_SEND_COMPLETE event is asserted...
Definition: erpc_uart_cmsis_transport.cpp:44
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
Semaphore m_rxSemaphore
Definition: erpc_uart_cmsis_transport.hpp:82
Semaphore m_txSemaphore
Definition: erpc_uart_cmsis_transport.hpp:83
UartTransport(ARM_DRIVER_USART *uartDrv)
Constructor.
Definition: erpc_uart_cmsis_transport.cpp:29
virtual erpc_status_t underlyingReceive(MessageBuffer *message, uint32_t size, uint32_t offset)
Adds ability to framed transport to overwrite MessageBuffer when receiving data.
Definition: erpc_framed_transport.cpp:177
virtual ~UartTransport(void)
Destructor.
Definition: erpc_uart_cmsis_transport.cpp:39
Definition: erpc_arbitrated_client_manager.hpp:25
void rx_cb(void)
Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_RECEIVE_COMPLETE event is asserted...
Definition: erpc_uart_cmsis_transport.cpp:53
virtual erpc_status_t underlyingSend(MessageBuffer *message, uint32_t size, uint32_t offset)
Adds ability to framed transport to overwrite MessageBuffer when sending data.
Definition: erpc_framed_transport.cpp:170
virtual erpc_status_t init(void)
Initialize CMSIS UART peripheral configuration structure with values specified in UartTransport const...
Definition: erpc_uart_cmsis_transport.cpp:78
Very basic transport to send/receive messages via UART.
Definition: erpc_uart_cmsis_transport.hpp:41
Simple semaphore class.
Definition: erpc_threading.h:442