Marco Zecchini / Mbed OS Example_RTOS
Committer:
marcozecchini
Date:
Sat Feb 23 12:13:36 2019 +0000
Revision:
0:9fca2b23d0ba
final commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marcozecchini 0:9fca2b23d0ba 1 /*
marcozecchini 0:9fca2b23d0ba 2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
marcozecchini 0:9fca2b23d0ba 3 * Copyright 2016-2017 NXP
marcozecchini 0:9fca2b23d0ba 4 *
marcozecchini 0:9fca2b23d0ba 5 * Redistribution and use in source and binary forms, with or without modification,
marcozecchini 0:9fca2b23d0ba 6 * are permitted provided that the following conditions are met:
marcozecchini 0:9fca2b23d0ba 7 *
marcozecchini 0:9fca2b23d0ba 8 * o Redistributions of source code must retain the above copyright notice, this list
marcozecchini 0:9fca2b23d0ba 9 * of conditions and the following disclaimer.
marcozecchini 0:9fca2b23d0ba 10 *
marcozecchini 0:9fca2b23d0ba 11 * o Redistributions in binary form must reproduce the above copyright notice, this
marcozecchini 0:9fca2b23d0ba 12 * list of conditions and the following disclaimer in the documentation and/or
marcozecchini 0:9fca2b23d0ba 13 * other materials provided with the distribution.
marcozecchini 0:9fca2b23d0ba 14 *
marcozecchini 0:9fca2b23d0ba 15 * o Neither the name of the copyright holder nor the names of its
marcozecchini 0:9fca2b23d0ba 16 * contributors may be used to endorse or promote products derived from this
marcozecchini 0:9fca2b23d0ba 17 * software without specific prior written permission.
marcozecchini 0:9fca2b23d0ba 18 *
marcozecchini 0:9fca2b23d0ba 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
marcozecchini 0:9fca2b23d0ba 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
marcozecchini 0:9fca2b23d0ba 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
marcozecchini 0:9fca2b23d0ba 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
marcozecchini 0:9fca2b23d0ba 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
marcozecchini 0:9fca2b23d0ba 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
marcozecchini 0:9fca2b23d0ba 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
marcozecchini 0:9fca2b23d0ba 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
marcozecchini 0:9fca2b23d0ba 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
marcozecchini 0:9fca2b23d0ba 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
marcozecchini 0:9fca2b23d0ba 29 */
marcozecchini 0:9fca2b23d0ba 30 #ifndef _FSL_DSPI_EDMA_H_
marcozecchini 0:9fca2b23d0ba 31 #define _FSL_DSPI_EDMA_H_
marcozecchini 0:9fca2b23d0ba 32
marcozecchini 0:9fca2b23d0ba 33 #include "fsl_dspi.h"
marcozecchini 0:9fca2b23d0ba 34 #include "fsl_edma.h"
marcozecchini 0:9fca2b23d0ba 35 /*!
marcozecchini 0:9fca2b23d0ba 36 * @addtogroup dspi_edma_driver
marcozecchini 0:9fca2b23d0ba 37 * @{
marcozecchini 0:9fca2b23d0ba 38 */
marcozecchini 0:9fca2b23d0ba 39
marcozecchini 0:9fca2b23d0ba 40 /***********************************************************************************************************************
marcozecchini 0:9fca2b23d0ba 41 * Definitions
marcozecchini 0:9fca2b23d0ba 42 **********************************************************************************************************************/
marcozecchini 0:9fca2b23d0ba 43
marcozecchini 0:9fca2b23d0ba 44 /*!
marcozecchini 0:9fca2b23d0ba 45 * @brief Forward declaration of the DSPI eDMA master handle typedefs.
marcozecchini 0:9fca2b23d0ba 46 */
marcozecchini 0:9fca2b23d0ba 47 typedef struct _dspi_master_edma_handle dspi_master_edma_handle_t;
marcozecchini 0:9fca2b23d0ba 48
marcozecchini 0:9fca2b23d0ba 49 /*!
marcozecchini 0:9fca2b23d0ba 50 * @brief Forward declaration of the DSPI eDMA slave handle typedefs.
marcozecchini 0:9fca2b23d0ba 51 */
marcozecchini 0:9fca2b23d0ba 52 typedef struct _dspi_slave_edma_handle dspi_slave_edma_handle_t;
marcozecchini 0:9fca2b23d0ba 53
marcozecchini 0:9fca2b23d0ba 54 /*!
marcozecchini 0:9fca2b23d0ba 55 * @brief Completion callback function pointer type.
marcozecchini 0:9fca2b23d0ba 56 *
marcozecchini 0:9fca2b23d0ba 57 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 58 * @param handle A pointer to the handle for the DSPI master.
marcozecchini 0:9fca2b23d0ba 59 * @param status Success or error code describing whether the transfer completed.
marcozecchini 0:9fca2b23d0ba 60 * @param userData An arbitrary pointer-dataSized value passed from the application.
marcozecchini 0:9fca2b23d0ba 61 */
marcozecchini 0:9fca2b23d0ba 62 typedef void (*dspi_master_edma_transfer_callback_t)(SPI_Type *base,
marcozecchini 0:9fca2b23d0ba 63 dspi_master_edma_handle_t *handle,
marcozecchini 0:9fca2b23d0ba 64 status_t status,
marcozecchini 0:9fca2b23d0ba 65 void *userData);
marcozecchini 0:9fca2b23d0ba 66 /*!
marcozecchini 0:9fca2b23d0ba 67 * @brief Completion callback function pointer type.
marcozecchini 0:9fca2b23d0ba 68 *
marcozecchini 0:9fca2b23d0ba 69 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 70 * @param handle A pointer to the handle for the DSPI slave.
marcozecchini 0:9fca2b23d0ba 71 * @param status Success or error code describing whether the transfer completed.
marcozecchini 0:9fca2b23d0ba 72 * @param userData An arbitrary pointer-dataSized value passed from the application.
marcozecchini 0:9fca2b23d0ba 73 */
marcozecchini 0:9fca2b23d0ba 74 typedef void (*dspi_slave_edma_transfer_callback_t)(SPI_Type *base,
marcozecchini 0:9fca2b23d0ba 75 dspi_slave_edma_handle_t *handle,
marcozecchini 0:9fca2b23d0ba 76 status_t status,
marcozecchini 0:9fca2b23d0ba 77 void *userData);
marcozecchini 0:9fca2b23d0ba 78
marcozecchini 0:9fca2b23d0ba 79 /*! @brief DSPI master eDMA transfer handle structure used for the transactional API. */
marcozecchini 0:9fca2b23d0ba 80 struct _dspi_master_edma_handle
marcozecchini 0:9fca2b23d0ba 81 {
marcozecchini 0:9fca2b23d0ba 82 uint32_t bitsPerFrame; /*!< The desired number of bits per frame. */
marcozecchini 0:9fca2b23d0ba 83 volatile uint32_t command; /*!< The desired data command. */
marcozecchini 0:9fca2b23d0ba 84 volatile uint32_t lastCommand; /*!< The desired last data command. */
marcozecchini 0:9fca2b23d0ba 85
marcozecchini 0:9fca2b23d0ba 86 uint8_t fifoSize; /*!< FIFO dataSize. */
marcozecchini 0:9fca2b23d0ba 87
marcozecchini 0:9fca2b23d0ba 88 volatile bool
marcozecchini 0:9fca2b23d0ba 89 isPcsActiveAfterTransfer; /*!< Indicates whether the PCS signal keeps active after the last frame transfer.*/
marcozecchini 0:9fca2b23d0ba 90
marcozecchini 0:9fca2b23d0ba 91 uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */
marcozecchini 0:9fca2b23d0ba 92 volatile uint8_t state; /*!< DSPI transfer state , _dspi_transfer_state.*/
marcozecchini 0:9fca2b23d0ba 93
marcozecchini 0:9fca2b23d0ba 94 uint8_t *volatile txData; /*!< Send buffer. */
marcozecchini 0:9fca2b23d0ba 95 uint8_t *volatile rxData; /*!< Receive buffer. */
marcozecchini 0:9fca2b23d0ba 96 volatile size_t remainingSendByteCount; /*!< A number of bytes remaining to send.*/
marcozecchini 0:9fca2b23d0ba 97 volatile size_t remainingReceiveByteCount; /*!< A number of bytes remaining to receive.*/
marcozecchini 0:9fca2b23d0ba 98 size_t totalByteCount; /*!< A number of transfer bytes*/
marcozecchini 0:9fca2b23d0ba 99
marcozecchini 0:9fca2b23d0ba 100 uint32_t rxBuffIfNull; /*!< Used if there is not rxData for DMA purpose.*/
marcozecchini 0:9fca2b23d0ba 101 uint32_t txBuffIfNull; /*!< Used if there is not txData for DMA purpose.*/
marcozecchini 0:9fca2b23d0ba 102
marcozecchini 0:9fca2b23d0ba 103 dspi_master_edma_transfer_callback_t callback; /*!< Completion callback. */
marcozecchini 0:9fca2b23d0ba 104 void *userData; /*!< Callback user data. */
marcozecchini 0:9fca2b23d0ba 105
marcozecchini 0:9fca2b23d0ba 106 edma_handle_t *edmaRxRegToRxDataHandle; /*!<edma_handle_t handle point used for RxReg to RxData buff*/
marcozecchini 0:9fca2b23d0ba 107 edma_handle_t *edmaTxDataToIntermediaryHandle; /*!<edma_handle_t handle point used for TxData to Intermediary*/
marcozecchini 0:9fca2b23d0ba 108 edma_handle_t *edmaIntermediaryToTxRegHandle; /*!<edma_handle_t handle point used for Intermediary to TxReg*/
marcozecchini 0:9fca2b23d0ba 109
marcozecchini 0:9fca2b23d0ba 110 edma_tcd_t dspiSoftwareTCD[2]; /*!<SoftwareTCD , internal used*/
marcozecchini 0:9fca2b23d0ba 111 };
marcozecchini 0:9fca2b23d0ba 112
marcozecchini 0:9fca2b23d0ba 113 /*! @brief DSPI slave eDMA transfer handle structure used for the transactional API.*/
marcozecchini 0:9fca2b23d0ba 114 struct _dspi_slave_edma_handle
marcozecchini 0:9fca2b23d0ba 115 {
marcozecchini 0:9fca2b23d0ba 116 uint32_t bitsPerFrame; /*!< The desired number of bits per frame. */
marcozecchini 0:9fca2b23d0ba 117
marcozecchini 0:9fca2b23d0ba 118 uint8_t *volatile txData; /*!< Send buffer. */
marcozecchini 0:9fca2b23d0ba 119 uint8_t *volatile rxData; /*!< Receive buffer. */
marcozecchini 0:9fca2b23d0ba 120 volatile size_t remainingSendByteCount; /*!< A number of bytes remaining to send.*/
marcozecchini 0:9fca2b23d0ba 121 volatile size_t remainingReceiveByteCount; /*!< A number of bytes remaining to receive.*/
marcozecchini 0:9fca2b23d0ba 122 size_t totalByteCount; /*!< A number of transfer bytes*/
marcozecchini 0:9fca2b23d0ba 123
marcozecchini 0:9fca2b23d0ba 124 uint32_t rxBuffIfNull; /*!< Used if there is not rxData for DMA purpose.*/
marcozecchini 0:9fca2b23d0ba 125 uint32_t txBuffIfNull; /*!< Used if there is not txData for DMA purpose.*/
marcozecchini 0:9fca2b23d0ba 126 uint32_t txLastData; /*!< Used if there is an extra byte when 16bits per frame for DMA purpose.*/
marcozecchini 0:9fca2b23d0ba 127
marcozecchini 0:9fca2b23d0ba 128 uint8_t nbytes; /*!< eDMA minor byte transfer count initially configured. */
marcozecchini 0:9fca2b23d0ba 129
marcozecchini 0:9fca2b23d0ba 130 volatile uint8_t state; /*!< DSPI transfer state.*/
marcozecchini 0:9fca2b23d0ba 131
marcozecchini 0:9fca2b23d0ba 132 dspi_slave_edma_transfer_callback_t callback; /*!< Completion callback. */
marcozecchini 0:9fca2b23d0ba 133 void *userData; /*!< Callback user data. */
marcozecchini 0:9fca2b23d0ba 134
marcozecchini 0:9fca2b23d0ba 135 edma_handle_t *edmaRxRegToRxDataHandle; /*!<edma_handle_t handle point used for RxReg to RxData buff*/
marcozecchini 0:9fca2b23d0ba 136 edma_handle_t *edmaTxDataToTxRegHandle; /*!<edma_handle_t handle point used for TxData to TxReg*/
marcozecchini 0:9fca2b23d0ba 137 };
marcozecchini 0:9fca2b23d0ba 138
marcozecchini 0:9fca2b23d0ba 139 /***********************************************************************************************************************
marcozecchini 0:9fca2b23d0ba 140 * API
marcozecchini 0:9fca2b23d0ba 141 **********************************************************************************************************************/
marcozecchini 0:9fca2b23d0ba 142 #if defined(__cplusplus)
marcozecchini 0:9fca2b23d0ba 143 extern "C" {
marcozecchini 0:9fca2b23d0ba 144 #endif /*_cplusplus*/
marcozecchini 0:9fca2b23d0ba 145
marcozecchini 0:9fca2b23d0ba 146 /*Transactional APIs*/
marcozecchini 0:9fca2b23d0ba 147
marcozecchini 0:9fca2b23d0ba 148 /*!
marcozecchini 0:9fca2b23d0ba 149 * @brief Initializes the DSPI master eDMA handle.
marcozecchini 0:9fca2b23d0ba 150 *
marcozecchini 0:9fca2b23d0ba 151 * This function initializes the DSPI eDMA handle which can be used for other DSPI transactional APIs. Usually, for a
marcozecchini 0:9fca2b23d0ba 152 * specified DSPI instance, call this API once to get the initialized handle.
marcozecchini 0:9fca2b23d0ba 153 *
marcozecchini 0:9fca2b23d0ba 154 * Note that DSPI eDMA has separated (RX and TX as two sources) or shared (RX and TX are the same source) DMA request
marcozecchini 0:9fca2b23d0ba 155 * source.
marcozecchini 0:9fca2b23d0ba 156 * (1) For the separated DMA request source, enable and set the RX DMAMUX source for edmaRxRegToRxDataHandle and
marcozecchini 0:9fca2b23d0ba 157 * TX DMAMUX source for edmaIntermediaryToTxRegHandle.
marcozecchini 0:9fca2b23d0ba 158 * (2) For the shared DMA request source, enable and set the RX/RX DMAMUX source for the edmaRxRegToRxDataHandle.
marcozecchini 0:9fca2b23d0ba 159 *
marcozecchini 0:9fca2b23d0ba 160 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 161 * @param handle DSPI handle pointer to dspi_master_edma_handle_t.
marcozecchini 0:9fca2b23d0ba 162 * @param callback DSPI callback.
marcozecchini 0:9fca2b23d0ba 163 * @param userData A callback function parameter.
marcozecchini 0:9fca2b23d0ba 164 * @param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t.
marcozecchini 0:9fca2b23d0ba 165 * @param edmaTxDataToIntermediaryHandle edmaTxDataToIntermediaryHandle pointer to edma_handle_t.
marcozecchini 0:9fca2b23d0ba 166 * @param edmaIntermediaryToTxRegHandle edmaIntermediaryToTxRegHandle pointer to edma_handle_t.
marcozecchini 0:9fca2b23d0ba 167 */
marcozecchini 0:9fca2b23d0ba 168 void DSPI_MasterTransferCreateHandleEDMA(SPI_Type *base,
marcozecchini 0:9fca2b23d0ba 169 dspi_master_edma_handle_t *handle,
marcozecchini 0:9fca2b23d0ba 170 dspi_master_edma_transfer_callback_t callback,
marcozecchini 0:9fca2b23d0ba 171 void *userData,
marcozecchini 0:9fca2b23d0ba 172 edma_handle_t *edmaRxRegToRxDataHandle,
marcozecchini 0:9fca2b23d0ba 173 edma_handle_t *edmaTxDataToIntermediaryHandle,
marcozecchini 0:9fca2b23d0ba 174 edma_handle_t *edmaIntermediaryToTxRegHandle);
marcozecchini 0:9fca2b23d0ba 175
marcozecchini 0:9fca2b23d0ba 176 /*!
marcozecchini 0:9fca2b23d0ba 177 * @brief DSPI master transfer data using eDMA.
marcozecchini 0:9fca2b23d0ba 178 *
marcozecchini 0:9fca2b23d0ba 179 * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data
marcozecchini 0:9fca2b23d0ba 180 * is transferred, the callback function is called.
marcozecchini 0:9fca2b23d0ba 181 *
marcozecchini 0:9fca2b23d0ba 182 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 183 * @param handle A pointer to the dspi_master_edma_handle_t structure which stores the transfer state.
marcozecchini 0:9fca2b23d0ba 184 * @param transfer A pointer to the dspi_transfer_t structure.
marcozecchini 0:9fca2b23d0ba 185 * @return status of status_t.
marcozecchini 0:9fca2b23d0ba 186 */
marcozecchini 0:9fca2b23d0ba 187 status_t DSPI_MasterTransferEDMA(SPI_Type *base, dspi_master_edma_handle_t *handle, dspi_transfer_t *transfer);
marcozecchini 0:9fca2b23d0ba 188
marcozecchini 0:9fca2b23d0ba 189 /*!
marcozecchini 0:9fca2b23d0ba 190 * @brief DSPI master aborts a transfer which is using eDMA.
marcozecchini 0:9fca2b23d0ba 191 *
marcozecchini 0:9fca2b23d0ba 192 * This function aborts a transfer which is using eDMA.
marcozecchini 0:9fca2b23d0ba 193 *
marcozecchini 0:9fca2b23d0ba 194 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 195 * @param handle A pointer to the dspi_master_edma_handle_t structure which stores the transfer state.
marcozecchini 0:9fca2b23d0ba 196 */
marcozecchini 0:9fca2b23d0ba 197 void DSPI_MasterTransferAbortEDMA(SPI_Type *base, dspi_master_edma_handle_t *handle);
marcozecchini 0:9fca2b23d0ba 198
marcozecchini 0:9fca2b23d0ba 199 /*!
marcozecchini 0:9fca2b23d0ba 200 * @brief Gets the master eDMA transfer count.
marcozecchini 0:9fca2b23d0ba 201 *
marcozecchini 0:9fca2b23d0ba 202 * This function gets the master eDMA transfer count.
marcozecchini 0:9fca2b23d0ba 203 *
marcozecchini 0:9fca2b23d0ba 204 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 205 * @param handle A pointer to the dspi_master_edma_handle_t structure which stores the transfer state.
marcozecchini 0:9fca2b23d0ba 206 * @param count A number of bytes transferred by the non-blocking transaction.
marcozecchini 0:9fca2b23d0ba 207 * @return status of status_t.
marcozecchini 0:9fca2b23d0ba 208 */
marcozecchini 0:9fca2b23d0ba 209 status_t DSPI_MasterTransferGetCountEDMA(SPI_Type *base, dspi_master_edma_handle_t *handle, size_t *count);
marcozecchini 0:9fca2b23d0ba 210
marcozecchini 0:9fca2b23d0ba 211 /*!
marcozecchini 0:9fca2b23d0ba 212 * @brief Initializes the DSPI slave eDMA handle.
marcozecchini 0:9fca2b23d0ba 213 *
marcozecchini 0:9fca2b23d0ba 214 * This function initializes the DSPI eDMA handle which can be used for other DSPI transactional APIs. Usually, for a
marcozecchini 0:9fca2b23d0ba 215 * specified DSPI instance, call this API once to get the initialized handle.
marcozecchini 0:9fca2b23d0ba 216 *
marcozecchini 0:9fca2b23d0ba 217 * Note that DSPI eDMA has separated (RN and TX in 2 sources) or shared (RX and TX are the same source) DMA request
marcozecchini 0:9fca2b23d0ba 218 * source.
marcozecchini 0:9fca2b23d0ba 219 * (1)For the separated DMA request source, enable and set the RX DMAMUX source for edmaRxRegToRxDataHandle and
marcozecchini 0:9fca2b23d0ba 220 * TX DMAMUX source for edmaTxDataToTxRegHandle.
marcozecchini 0:9fca2b23d0ba 221 * (2)For the shared DMA request source, enable and set the RX/RX DMAMUX source for the edmaRxRegToRxDataHandle.
marcozecchini 0:9fca2b23d0ba 222 *
marcozecchini 0:9fca2b23d0ba 223 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 224 * @param handle DSPI handle pointer to dspi_slave_edma_handle_t.
marcozecchini 0:9fca2b23d0ba 225 * @param callback DSPI callback.
marcozecchini 0:9fca2b23d0ba 226 * @param userData A callback function parameter.
marcozecchini 0:9fca2b23d0ba 227 * @param edmaRxRegToRxDataHandle edmaRxRegToRxDataHandle pointer to edma_handle_t.
marcozecchini 0:9fca2b23d0ba 228 * @param edmaTxDataToTxRegHandle edmaTxDataToTxRegHandle pointer to edma_handle_t.
marcozecchini 0:9fca2b23d0ba 229 */
marcozecchini 0:9fca2b23d0ba 230 void DSPI_SlaveTransferCreateHandleEDMA(SPI_Type *base,
marcozecchini 0:9fca2b23d0ba 231 dspi_slave_edma_handle_t *handle,
marcozecchini 0:9fca2b23d0ba 232 dspi_slave_edma_transfer_callback_t callback,
marcozecchini 0:9fca2b23d0ba 233 void *userData,
marcozecchini 0:9fca2b23d0ba 234 edma_handle_t *edmaRxRegToRxDataHandle,
marcozecchini 0:9fca2b23d0ba 235 edma_handle_t *edmaTxDataToTxRegHandle);
marcozecchini 0:9fca2b23d0ba 236
marcozecchini 0:9fca2b23d0ba 237 /*!
marcozecchini 0:9fca2b23d0ba 238 * @brief DSPI slave transfer data using eDMA.
marcozecchini 0:9fca2b23d0ba 239 *
marcozecchini 0:9fca2b23d0ba 240 * This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data
marcozecchini 0:9fca2b23d0ba 241 * is transferred, the callback function is called.
marcozecchini 0:9fca2b23d0ba 242 * Note that the slave eDMA transfer doesn't support transfer_size is 1 when the bitsPerFrame is greater
marcozecchini 0:9fca2b23d0ba 243 * than eight.
marcozecchini 0:9fca2b23d0ba 244
marcozecchini 0:9fca2b23d0ba 245 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 246 * @param handle A pointer to the dspi_slave_edma_handle_t structure which stores the transfer state.
marcozecchini 0:9fca2b23d0ba 247 * @param transfer A pointer to the dspi_transfer_t structure.
marcozecchini 0:9fca2b23d0ba 248 * @return status of status_t.
marcozecchini 0:9fca2b23d0ba 249 */
marcozecchini 0:9fca2b23d0ba 250 status_t DSPI_SlaveTransferEDMA(SPI_Type *base, dspi_slave_edma_handle_t *handle, dspi_transfer_t *transfer);
marcozecchini 0:9fca2b23d0ba 251
marcozecchini 0:9fca2b23d0ba 252 /*!
marcozecchini 0:9fca2b23d0ba 253 * @brief DSPI slave aborts a transfer which is using eDMA.
marcozecchini 0:9fca2b23d0ba 254 *
marcozecchini 0:9fca2b23d0ba 255 * This function aborts a transfer which is using eDMA.
marcozecchini 0:9fca2b23d0ba 256 *
marcozecchini 0:9fca2b23d0ba 257 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 258 * @param handle A pointer to the dspi_slave_edma_handle_t structure which stores the transfer state.
marcozecchini 0:9fca2b23d0ba 259 */
marcozecchini 0:9fca2b23d0ba 260 void DSPI_SlaveTransferAbortEDMA(SPI_Type *base, dspi_slave_edma_handle_t *handle);
marcozecchini 0:9fca2b23d0ba 261
marcozecchini 0:9fca2b23d0ba 262 /*!
marcozecchini 0:9fca2b23d0ba 263 * @brief Gets the slave eDMA transfer count.
marcozecchini 0:9fca2b23d0ba 264 *
marcozecchini 0:9fca2b23d0ba 265 * This function gets the slave eDMA transfer count.
marcozecchini 0:9fca2b23d0ba 266 *
marcozecchini 0:9fca2b23d0ba 267 * @param base DSPI peripheral base address.
marcozecchini 0:9fca2b23d0ba 268 * @param handle A pointer to the dspi_slave_edma_handle_t structure which stores the transfer state.
marcozecchini 0:9fca2b23d0ba 269 * @param count A number of bytes transferred so far by the non-blocking transaction.
marcozecchini 0:9fca2b23d0ba 270 * @return status of status_t.
marcozecchini 0:9fca2b23d0ba 271 */
marcozecchini 0:9fca2b23d0ba 272 status_t DSPI_SlaveTransferGetCountEDMA(SPI_Type *base, dspi_slave_edma_handle_t *handle, size_t *count);
marcozecchini 0:9fca2b23d0ba 273
marcozecchini 0:9fca2b23d0ba 274 #if defined(__cplusplus)
marcozecchini 0:9fca2b23d0ba 275 }
marcozecchini 0:9fca2b23d0ba 276 #endif /*_cplusplus*/
marcozecchini 0:9fca2b23d0ba 277 /*!
marcozecchini 0:9fca2b23d0ba 278 *@}
marcozecchini 0:9fca2b23d0ba 279 */
marcozecchini 0:9fca2b23d0ba 280
marcozecchini 0:9fca2b23d0ba 281 #endif /*_FSL_DSPI_EDMA_H_*/