| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_spi_master_transport.h
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
13 #include "erpc_framed_transport.h"
14
15 #include "fsl_spi.h"
16
17 #include <stdbool.h>
18 #include <stdlib.h>
19
26 // Classes
29
30 namespace erpc {
36 class SpiMasterTransport : public FramedTransport
37 {
38 public:
46 SpiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
47
51 virtual ~SpiMasterTransport(void);
52
58 virtual erpc_status_t init(void);
59
60 protected:
61 SPI_Type *m_spiBaseAddr;
62 uint32_t m_baudRate;
63 uint32_t m_srcClock_Hz;
65 private:
75 virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size);
76
86 virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size);
87 };
88
89 } // namespace erpc
90
93 #endif // _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_
erpc::SpiMasterTransport::m_srcClock_Hz
uint32_t m_srcClock_Hz
Definition: erpc_spi_master_transport.h:63
erpc::FramedTransport
Base class for framed transport layers.
Definition: erpc_framed_transport.h:56
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::SpiMasterTransport::SpiMasterTransport
SpiMasterTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
Constructor.
Definition: erpc_spi_master_transport.cpp:102
erpc::SpiMasterTransport::m_spiBaseAddr
SPI_Type * m_spiBaseAddr
Definition: erpc_spi_master_transport.h:61
erpc::SpiMasterTransport::~SpiMasterTransport
virtual ~SpiMasterTransport(void)
Destructor.
Definition: erpc_spi_master_transport.cpp:109
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc::SpiMasterTransport::init
virtual erpc_status_t init(void)
Initialize SPI peripheral configuration structure with values specified in SpiTransport constructor...
Definition: erpc_spi_master_transport.cpp:114
erpc::SpiMasterTransport
Very basic transport to send/receive messages via SPI.
Definition: erpc_spi_master_transport.h:36
erpc::SpiMasterTransport::m_baudRate
uint32_t m_baudRate
Definition: erpc_spi_master_transport.h:62