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