Skip to content

Commit de598ec

Browse files
committed
MCUXpresso: Update Kinetis DSPI SDK drivers
- Added dummy data setup API to allow users to configure the dummy data to be transferred. - Added new APIs for half-duplex transfer function. Users can send and receive data by one API in the polling/interrupt/EDMA way, and they can choose either to transmit first or to receive first. Additionally, the PCS pin can be configured as assert status in transmission (between transmit and receive) by setting the isPcsAssertInTransfer to true. - Fix for MISRA issues Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 033fffe commit de598ec

File tree

32 files changed

+16327
-8930
lines changed

32 files changed

+16327
-8930
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/drivers/fsl_dspi.c

Lines changed: 987 additions & 419 deletions
Large diffs are not rendered by default.

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/drivers/fsl_dspi.h

Lines changed: 143 additions & 101 deletions
Large diffs are not rendered by default.

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/drivers/fsl_dspi_edma.c

Lines changed: 640 additions & 331 deletions
Large diffs are not rendered by default.

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K66F/drivers/fsl_dspi_edma.h

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
11
/*
22
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2018 NXP
4+
* All rights reserved.
45
*
5-
* Redistribution and use in source and binary forms, with or without modification,
6-
* are permitted provided that the following conditions are met:
7-
*
8-
* o Redistributions of source code must retain the above copyright notice, this list
9-
* of conditions and the following disclaimer.
10-
*
11-
* o Redistributions in binary form must reproduce the above copyright notice, this
12-
* list of conditions and the following disclaimer in the documentation and/or
13-
* other materials provided with the distribution.
14-
*
15-
* o Neither the name of the copyright holder nor the names of its
16-
* contributors may be used to endorse or promote products derived from this
17-
* software without specific prior written permission.
18-
*
19-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23-
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26-
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6+
* SPDX-License-Identifier: BSD-3-Clause
297
*/
308
#ifndef _FSL_DSPI_EDMA_H_
319
#define _FSL_DSPI_EDMA_H_
@@ -41,14 +19,20 @@
4119
* Definitions
4220
**********************************************************************************************************************/
4321

22+
/*! @name Driver version */
23+
/*@{*/
24+
/*! @brief DSPI EDMA driver version 2.2.2. */
25+
#define FSL_DSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 2, 2))
26+
/*@}*/
27+
4428
/*!
45-
* @brief Forward declaration of the DSPI eDMA master handle typedefs.
46-
*/
29+
* @brief Forward declaration of the DSPI eDMA master handle typedefs.
30+
*/
4731
typedef struct _dspi_master_edma_handle dspi_master_edma_handle_t;
4832

4933
/*!
50-
* @brief Forward declaration of the DSPI eDMA slave handle typedefs.
51-
*/
34+
* @brief Forward declaration of the DSPI eDMA slave handle typedefs.
35+
*/
5236
typedef struct _dspi_slave_edma_handle dspi_slave_edma_handle_t;
5337

5438
/*!
@@ -186,6 +170,21 @@ void DSPI_MasterTransferCreateHandleEDMA(SPI_Type *base,
186170
*/
187171
status_t DSPI_MasterTransferEDMA(SPI_Type *base, dspi_master_edma_handle_t *handle, dspi_transfer_t *transfer);
188172

173+
/*!
174+
* @brief Transfers a block of data using a eDMA method.
175+
*
176+
* This function transfers data using eDNA, the transfer mechanism is half-duplex. This is a non-blocking function,
177+
* which returns right away. When all data is transferred, the callback function is called.
178+
*
179+
* @param base DSPI base pointer
180+
* @param handle A pointer to the dspi_master_edma_handle_t structure which stores the transfer state.
181+
* @param transfer A pointer to the dspi_half_duplex_transfer_t structure.
182+
* @return status of status_t.
183+
*/
184+
status_t DSPI_MasterHalfDuplexTransferEDMA(SPI_Type *base,
185+
dspi_master_edma_handle_t *handle,
186+
dspi_half_duplex_transfer_t *xfer);
187+
189188
/*!
190189
* @brief DSPI master aborts a transfer which is using eDMA.
191190
*

0 commit comments

Comments
 (0)