eRPC API Reference  Rev. 1.12.0
NXP Semiconductors
erpc_spi_master_transport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3  * Copyright 2016 NXP
4  * All rights reserved.
5  *
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  */
9 
10 #ifndef _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_
11 #define _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_
12 
14 
15 #include <cstdbool>
16 #include <cstdlib>
17 
18 extern "C" {
19 #include "fsl_spi.h"
20 }
21 
28 // Classes
31 
32 namespace erpc {
39 {
40 public:
48  SpiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
49 
53  virtual ~SpiMasterTransport(void);
54 
60  virtual erpc_status_t init(void);
61 
62 protected:
63  SPI_Type *m_spiBaseAddr;
64  uint32_t m_baudRate;
65  uint32_t m_srcClock_Hz;
67 private:
70 
80  virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size) override;
81 
91  virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size) override;
92 };
93 
94 } // namespace erpc
95 
98 #endif // _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_
uint32_t m_srcClock_Hz
Definition: erpc_spi_master_transport.hpp:65
Base class for framed transport layers.
Definition: erpc_framed_transport.hpp:56
enum _erpc_status erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:85
SpiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
Constructor.
Definition: erpc_spi_master_transport.cpp:104
SPI_Type * m_spiBaseAddr
Definition: erpc_spi_master_transport.hpp:63
virtual erpc_status_t underlyingReceive(MessageBuffer *message, uint32_t size, uint32_t offset)
Adds ability to framed transport to overwrite MessageBuffer when receiving data.
Definition: erpc_framed_transport.cpp:177
virtual ~SpiMasterTransport(void)
Destructor.
Definition: erpc_spi_master_transport.cpp:109
Definition: erpc_arbitrated_client_manager.hpp:25
virtual erpc_status_t init(void)
Initialize SPI peripheral configuration structure with values specified in SpiTransport constructor...
Definition: erpc_spi_master_transport.cpp:114
Very basic transport to send/receive messages via SPI.
Definition: erpc_spi_master_transport.hpp:38
virtual erpc_status_t underlyingSend(MessageBuffer *message, uint32_t size, uint32_t offset)
Adds ability to framed transport to overwrite MessageBuffer when sending data.
Definition: erpc_framed_transport.cpp:170
uint32_t m_baudRate
Definition: erpc_spi_master_transport.hpp:64