eRPC API Reference  Rev. 1.7.0
NXP Semiconductors
erpc_dspi_slave_transport.h
Go to the documentation of this file.
1 /*
2  * The Clear BSD License
3  * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
4  * Copyright 2016 NXP
5  * All rights reserved.
6  *
7  *
8  * Redistribution and use in source and binary forms, with or without modification,
9  * are permitted (subject to the limitations in the disclaimer below) provided
10  * that the following conditions are met:
11  *
12  * o Redistributions of source code must retain the above copyright notice, this list
13  * of conditions and the following disclaimer.
14  *
15  * o Redistributions in binary form must reproduce the above copyright notice, this
16  * list of conditions and the following disclaimer in the documentation and/or
17  * other materials provided with the distribution.
18  *
19  * o Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from this
21  * software without specific prior written permission.
22  *
23  * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
28  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef _EMBEDDED_RPC__DSPI_SLAVE_TRANSPORT_H_
37 #define _EMBEDDED_RPC__DSPI_SLAVE_TRANSPORT_H_
38 
39 #include "erpc_framed_transport.h"
40 #include "fsl_dspi.h"
41 #include <stdlib.h>
42 
49 // Classes
52 
53 namespace erpc {
60 {
61 public:
69  DspiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
70 
74  virtual ~DspiSlaveTransport(void);
75 
81  virtual erpc_status_t init(void);
82 
83 protected:
84  SPI_Type *m_spiBaseAddr;
85  uint32_t m_baudRate;
86  uint32_t m_srcClock_Hz;
87  bool m_isInited;
89 private:
99  virtual erpc_status_t underlyingReceive(uint8_t *data, uint32_t size);
100 
110  virtual erpc_status_t underlyingSend(const uint8_t *data, uint32_t size);
111 };
112 
113 } // namespace erpc
114 
117 #endif // _EMBEDDED_RPC__DSPI_SLAVE_TRANSPORT_H_
DspiSlaveTransport(SPI_Type *spiBaseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
Constructor.
Definition: erpc_dspi_slave_transport.cpp:61
int32_t erpc_status_t
Type used for all status and error return values.
Definition: erpc_common.h:112
Base class for framed transport layers.
Definition: erpc_framed_transport.h:80
Very basic transport to send/receive messages via DSPI.
Definition: erpc_dspi_slave_transport.h:59
uint32_t m_srcClock_Hz
Definition: erpc_dspi_slave_transport.h:86
uint32_t m_baudRate
Definition: erpc_dspi_slave_transport.h:85
SPI_Type * m_spiBaseAddr
Definition: erpc_dspi_slave_transport.h:84
Definition: erpc_arbitrated_client_manager.h:51
virtual ~DspiSlaveTransport(void)
Destructor.
Definition: erpc_dspi_slave_transport.cpp:69
virtual erpc_status_t init(void)
Initialize DSPI peripheral configuration structure with values specified in DspiTransport constructor...
Definition: erpc_dspi_slave_transport.cpp:78
bool m_isInited
Definition: erpc_dspi_slave_transport.h:87