eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc::UartTransport Class Reference

Very basic transport to send/receive messages via UART. More...

#include <erpc_uart_cmsis_transport.hpp>

+ Inheritance diagram for erpc::UartTransport:
+ Collaboration diagram for erpc::UartTransport:

Public Member Functions

 UartTransport (ARM_DRIVER_USART *uartDrv)
 Constructor. More...
 
virtual ~UartTransport (void)
 Destructor.
 
virtual erpc_status_t init (void)
 Initialize CMSIS UART peripheral configuration structure with values specified in UartTransport constructor. More...
 
void rx_cb (void)
 Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_RECEIVE_COMPLETE event is asserted. More...
 
void tx_cb (void)
 Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_SEND_COMPLETE event is asserted. More...
 
 UartTransport (struct device *dev)
 Constructor. More...
 
virtual ~UartTransport (void)
 Destructor.
 
virtual erpc_status_t init (void)
 Initialize Zephyr UART peripheral configuration structure with values specified in UartTransport constructor. More...
 
void rx_cb (void)
 Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_RECEIVE_COMPLETE event is asserted. More...
 
void tx_cb (void)
 Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_SEND_COMPLETE event is asserted. More...
 
- Public Member Functions inherited from erpc::FramedTransport
 FramedTransport (void)
 Constructor.
 
virtual ~FramedTransport (void)
 FramedTransport destructor.
 
virtual uint8_t reserveHeaderSize (void) override
 Size of data placed in MessageBuffer before serializing eRPC data. More...
 
virtual erpc_status_t receive (MessageBuffer *message) override
 Receives an entire message. More...
 
virtual erpc_status_t send (MessageBuffer *message) override
 Function to send prepared message. More...
 
virtual void setCrc16 (Crc16 *crcImpl) override
 This functions sets the CRC-16 implementation. More...
 
virtual Crc16getCrc16 (void) override
 This functions gets the CRC-16 object. More...
 
- Public Member Functions inherited from erpc::Transport
 Transport (void)
 Constructor.
 
virtual ~Transport (void)
 Transport destructor.
 
virtual bool hasMessage (void)
 Poll for an incoming message. More...
 

Protected Attributes

ARM_DRIVER_USART * m_uartDrv
 
Semaphore m_rxSemaphore
 
Semaphore m_txSemaphore
 
struct device * m_dev
 
- Protected Attributes inherited from erpc::FramedTransport
Crc16m_crcImpl
 
Mutex m_sendLock
 Mutex protecting send.
 
Mutex m_receiveLock
 Mutex protecting receive.
 

Additional Inherited Members

- Protected Member Functions inherited from erpc::FramedTransport
virtual erpc_status_t underlyingSend (MessageBuffer *message, uint32_t size, uint32_t offset)
 Adds ability to framed transport to overwrite MessageBuffer when sending data. More...
 
virtual erpc_status_t underlyingReceive (MessageBuffer *message, uint32_t size, uint32_t offset)
 Adds ability to framed transport to overwrite MessageBuffer when receiving data. More...
 

Detailed Description

Very basic transport to send/receive messages via UART.

Transport to send/receive messages via UART.

Constructor & Destructor Documentation

UartTransport::UartTransport ( ARM_DRIVER_USART *  uartDrv)
explicit

Constructor.

Parameters
[in]uartDrvCmsis uart.
UartTransport::UartTransport ( struct device *  dev)

Constructor.

Parameters
[in]devZephyr uart device.

Member Function Documentation

erpc_status_t UartTransport::init ( void  )
virtual

Initialize CMSIS UART peripheral configuration structure with values specified in UartTransport constructor.

Return values
kErpcStatus_InitFailedWhen UART init function failed.
kErpcStatus_SuccessWhen UART init function was executed successfully.
void UartTransport::rx_cb ( void  )

Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_RECEIVE_COMPLETE event is asserted.

Unblocks the receive function.

void UartTransport::tx_cb ( void  )

Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_SEND_COMPLETE event is asserted.

Unblocks the send function.

virtual erpc_status_t erpc::UartTransport::init ( void  )
virtual

Initialize Zephyr UART peripheral configuration structure with values specified in UartTransport constructor.

Return values
kErpcStatus_InitFailedWhen UART init function failed.
kErpcStatus_SuccessWhen UART init function was executed successfully.
void erpc::UartTransport::rx_cb ( void  )

Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_RECEIVE_COMPLETE event is asserted.

Unblocks the receive function.

void erpc::UartTransport::tx_cb ( void  )

Function called from ARM_USART_SignalEvent when ARM_USART_EVENT_SEND_COMPLETE event is asserted.

Unblocks the send function.

Member Data Documentation

ARM_DRIVER_USART* erpc::UartTransport::m_uartDrv
protected

Access structure of the USART Driver

Semaphore erpc::UartTransport::m_rxSemaphore
protected

Semaphore used by RTOS to block task until the receiving is not complete

Semaphore erpc::UartTransport::m_txSemaphore
protected

Semaphore used by RTOS to block task until the sending is not complete

struct device* erpc::UartTransport::m_dev
protected

Access structure of the UART device


The documentation for this class was generated from the following files: