eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_uart_zephyr_transport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2023 NXP
3  *
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef _EMBEDDED_RPC_ZEPHYR_UART_TRANSPORT_H_
9 #define _EMBEDDED_RPC_ZEPHYR_UART_TRANSPORT_H_
10 
11 #include "erpc_config_internal.h"
12 #if !ERPC_THREADS_IS(NONE)
13 #include "erpc_threading.h"
14 #endif
16 
17 extern "C" {
18 #include <stdlib.h>
19 #include <zephyr/drivers/uart.h>
20 }
21 
28 // Classes
31 
32 namespace erpc {
38 class UartTransport : public FramedTransport
39 {
40 public:
46  UartTransport(struct device *dev);
47 
51  virtual ~UartTransport(void);
52 
60  virtual erpc_status_t init(void);
61 
67  void rx_cb(void);
68 
74  void tx_cb(void);
75 
76 protected:
77  struct device *m_dev;
78 #if !ERPC_THREADS_IS(NONE)
81 #endif
82 private:
92  virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size);
93 
102  virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size);
103 };
104 
105 } // namespace erpc
106 
109 #endif // _EMBEDDED_RPC_ZEPHYR_UART_TRANSPORT_H_
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 ~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
struct device * m_dev
Definition: erpc_uart_zephyr_transport.hpp:77
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
Simple semaphore class.
Definition: erpc_threading.h:442