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

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

#include <erpc_lpi2c_slave_transport.hpp>

+ Inheritance diagram for erpc::LPI2cSlaveTransport:
+ Collaboration diagram for erpc::LPI2cSlaveTransport:

Public Member Functions

 LPI2cSlaveTransport (LPI2C_Type *lpi2cBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
 Constructor. More...
 
virtual ~LPI2cSlaveTransport (void)
 Destructor.
 
virtual erpc_status_t init (void)
 Initialize LPI2C peripheral configuration structure with values specified in LPI2cTransport constructor. More...
 
void transfer_cb (void)
 Function called from LPI2C_SlaveUserCallback when LPI2C transfer is completed. 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

LPI2C_Type * m_lpi2cBaseAddr
 
uint32_t m_baudRate
 
uint32_t m_srcClock_Hz
 
bool m_isInited
 
Semaphore m_txrxSemaphore
 
- 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 LPI2C.

Constructor & Destructor Documentation

LPI2cSlaveTransport::LPI2cSlaveTransport ( LPI2C_Type *  lpi2cBaseAddr,
uint32_t  baudRate,
uint32_t  srcClock_Hz 
)

Constructor.

Parameters
[in]lpi2cBaseAddrLPI2C peripheral base address.
[in]baudRateBaudrate.
[in]srcClock_HzSource clock.

Member Function Documentation

erpc_status_t LPI2cSlaveTransport::init ( void  )
virtual

Initialize LPI2C peripheral configuration structure with values specified in LPI2cTransport constructor.

Return values
kErpcStatus_SuccessAlways returns success status.
void LPI2cSlaveTransport::transfer_cb ( void  )

Function called from LPI2C_SlaveUserCallback when LPI2C transfer is completed.

Unblocks the send/receive function.

Member Data Documentation

LPI2C_Type* erpc::LPI2cSlaveTransport::m_lpi2cBaseAddr
protected

Base address of LPI2C peripheral used in this transport layer

uint32_t erpc::LPI2cSlaveTransport::m_baudRate
protected

Baud rate of LPI2C peripheral used in this transport layer

uint32_t erpc::LPI2cSlaveTransport::m_srcClock_Hz
protected

Source clock of LPI2C peripheral used in this transport layer

bool erpc::LPI2cSlaveTransport::m_isInited
protected

the LPI2C peripheral init status flag

Semaphore erpc::LPI2cSlaveTransport::m_txrxSemaphore
protected

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


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