| eRPC API Reference Rev. 1.8.1 NXP Semiconductors

- Main Page
- API Reference
- Classes
- Files

- File List
- File Members

erpc_dspi_slave_transport.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3 * Copyright 2016-2021 NXP
4 * All rights reserved.
5 *
6 *
7 * SPDX-License-Identifier: BSD-3-Clause
8 */
9
10 #ifndef _EMBEDDED_RPC__DSPI_SLAVE_TRANSPORT_H_
11 #define _EMBEDDED_RPC__DSPI_SLAVE_TRANSPORT_H_
12
13 #include "erpc_config_internal.h"
14 #if ERPC_THREADS
15 #include "erpc_threading.h"
16 #endif
17 #include "erpc_framed_transport.h"
18
19 #include "fsl_dspi.h"
20
21 #include <stdlib.h>
22
29 // Classes
32
33 namespace erpc {
39 class DspiSlaveTransport : public FramedTransport
40 {
41 public:
49 DspiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
50
54 virtual ~DspiSlaveTransport(void);
55
61 virtual erpc_status_t init(void);
62
68 void transfer_cb(void);
69
70 protected:
71 SPI_Type *m_spiBaseAddr;
72 uint32_t m_baudRate;
73 uint32_t m_srcClock_Hz;
74 bool m_isInited;
75 #if ERPC_THREADS
76 Semaphore m_txrxSemaphore;
77 #endif
78
79 private:
89 virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size);
90
100 virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size);
101 };
102
103 } // namespace erpc
104
107 #endif // _EMBEDDED_RPC__DSPI_SLAVE_TRANSPORT_H_
erpc::DspiSlaveTransport::DspiSlaveTransport
DspiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
Constructor.
Definition: erpc_dspi_slave_transport.cpp:95
erpc::DspiSlaveTransport::transfer_cb
void transfer_cb(void)
Function called from DSPI_SlaveUserCallback when SPI transfer is completed.
Definition: erpc_dspi_slave_transport.cpp:74
erpc::FramedTransport
Base class for framed transport layers.
Definition: erpc_framed_transport.h:56
erpc::DspiSlaveTransport
Very basic transport to send/receive messages via DSPI.
Definition: erpc_dspi_slave_transport.h:39
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::DspiSlaveTransport::m_srcClock_Hz
uint32_t m_srcClock_Hz
Definition: erpc_dspi_slave_transport.h:73
erpc::DspiSlaveTransport::m_baudRate
uint32_t m_baudRate
Definition: erpc_dspi_slave_transport.h:72
erpc::DspiSlaveTransport::m_spiBaseAddr
SPI_Type * m_spiBaseAddr
Definition: erpc_dspi_slave_transport.h:71
erpc
Definition: erpc_arbitrated_client_manager.h:25
erpc_threading.h
erpc::DspiSlaveTransport::m_txrxSemaphore
Semaphore m_txrxSemaphore
Definition: erpc_dspi_slave_transport.h:76
erpc::DspiSlaveTransport::~DspiSlaveTransport
virtual ~DspiSlaveTransport(void)
Destructor.
Definition: erpc_dspi_slave_transport.cpp:107
erpc::DspiSlaveTransport::init
virtual erpc_status_t init(void)
Initialize DSPI peripheral configuration structure with values specified in DspiTransport constructor...
Definition: erpc_dspi_slave_transport.cpp:119
erpc::Semaphore
Simple semaphore class.
Definition: erpc_threading.h:411
erpc::DspiSlaveTransport::m_isInited
bool m_isInited
Definition: erpc_dspi_slave_transport.h:74