| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes | List of all members
erpc::SpiSlaveTransport Class Reference
Transport Layers » SPI Slave

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

`#include <erpc_spi_slave_transport.h>`

Inheritance diagram for erpc::SpiSlaveTransport:
[legend]
Collaboration diagram for erpc::SpiSlaveTransport:
[legend]

## Public Member Functions
| SpiSlaveTransport (SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
| Constructor. More...
virtual | ~SpiSlaveTransport (void)
| Destructor.
virtual erpc_status_t | init (void)
| Initialize SPI peripheral configuration structure with values specified in SpiTransport constructor. More...
void | transfer_cb (void)
| Function called from SPI_SlaveUserCallback when SPI transfer is completed. More...
Public Member Functions inherited from erpc::FramedTransport
| FramedTransport (void)
| Constructor.
virtual | ~FramedTransport (void)
| Codec destructor.
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...
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
SPI_Type * | m_spiBaseAddr
uint32_t | m_baudRate
uint32_t | m_srcClock_Hz
bool | m_isInited
Semaphore | m_txrxSemaphore
Protected Attributes inherited from erpc::FramedTransport
Crc16 * | m_crcImpl
Mutex | m_sendLock
| Mutex protecting send.
Mutex | m_receiveLock
| Mutex protecting receive.

## Additional Inherited Members

## Detailed Description

Very basic transport to send/receive messages via SPI.

## Constructor & Destructor Documentation

SpiSlaveTransport::SpiSlaveTransport | ( | SPI_Type * | spiBaseAddr,
|  | uint32_t | baudRate,
|  | uint32_t | srcClock_Hz
| ) |  |

Constructor.

Parameters

  [in] | spiBaseAddr | DSPI peripheral base address.
  [in] | baudRate | Baudrate.
  [in] | srcClock_Hz | Source clock.

## Member Function Documentation

erpc_status_t SpiSlaveTransport::init | ( | void |  | ) |
| virtual

Initialize SPI peripheral configuration structure with values specified in SpiTransport constructor.

Return values

  kErpcStatus_Success | Always returns success status.

void SpiSlaveTransport::transfer_cb | ( | void |  | ) |

Function called from SPI_SlaveUserCallback when SPI transfer is completed.

Unblocks the send/receive function.

## Member Data Documentation

SPI_Type* erpc::SpiSlaveTransport::m_spiBaseAddr
| protected

Base address of SPI peripheral used in this transport layer

uint32_t erpc::SpiSlaveTransport::m_baudRate
| protected

Baud rate of SPI peripheral used in this transport layer

uint32_t erpc::SpiSlaveTransport::m_srcClock_Hz
| protected

Source clock of SPI peripheral used in this transport layer

bool erpc::SpiSlaveTransport::m_isInited
| protected

the SPI peripheral init status flag

Semaphore erpc::SpiSlaveTransport::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:

- erpc_spi_slave_transport.h
- erpc_spi_slave_transport.cpp