| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_uart_cmsis_transport.h
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 #if !ERPC_THREADS_IS(NONE)
15 #include "erpc_threading.h"
16 #endif
17 #include "erpc_framed_transport.h"
18
19 #include "Driver_USART.h"
20
21 #include <stdlib.h>
22
29 // Classes
32
33 namespace erpc {
39 class UartTransport : public FramedTransport
40 {
41 public:
47 UartTransport(ARM_DRIVER_USART *uartDrv);
48
52 virtual ~UartTransport(void);
53
61 virtual erpc_status_t init(void);
62
68 void rx_cb(void);
69
75 void tx_cb(void);
76
77 protected:
78 ARM_DRIVER_USART *m_uartDrv;
79 #if !ERPC_THREADS_IS(NONE)
80 Semaphore m_rxSemaphore;
81 Semaphore m_txSemaphore;
82 #endif
83 private:
93 virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size);
94
103 virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size);
104 };
105
106 } // namespace erpc
107
110 #endif // _EMBEDDED_RPC__UART_TRANSPORT_H_
erpc::UartTransport::m_uartDrv
ARM_DRIVER_USART * m_uartDrv
Definition: erpc_uart_cmsis_transport.h:78
erpc::FramedTransport
Base class for framed transport layers.
Definition: erpc_framed_transport.h:56
erpc::UartTransport::tx_cb
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
erpc_status_t
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:87
erpc_framed_transport.h
erpc::UartTransport::m_rxSemaphore
Semaphore m_rxSemaphore
Definition: erpc_uart_cmsis_transport.h:80
erpc::UartTransport::m_txSemaphore
Semaphore m_txSemaphore
Definition: erpc_uart_cmsis_transport.h:81
erpc::UartTransport::UartTransport
UartTransport(ARM_DRIVER_USART *uartDrv)
Constructor.
Definition: erpc_uart_cmsis_transport.cpp:29
erpc::UartTransport::~UartTransport
virtual ~UartTransport(void)
Destructor.
Definition: erpc_uart_cmsis_transport.cpp:39
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc_threading.h
erpc::UartTransport::rx_cb
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
erpc::UartTransport::init
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
erpc::UartTransport
Very basic transport to send/receive messages via UART.
Definition: erpc_uart_cmsis_transport.h:39
erpc::Semaphore
Simple semaphore class.
Definition: erpc_threading.h:411