STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
IO operation functions

Data transfers functions. More...

Collaboration diagram for IO operation functions:

Functions

HAL_StatusTypeDef HAL_SPI_Transmit (SPI_HandleTypeDef *hspi, const uint8_t *pData, uint16_t Size, uint32_t Timeout)
 Transmit an amount of data in blocking mode.
 
HAL_StatusTypeDef HAL_SPI_Receive (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 Receive an amount of data in blocking mode.
 
HAL_StatusTypeDef HAL_SPI_TransmitReceive (SPI_HandleTypeDef *hspi, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
 Transmit and Receive an amount of data in blocking mode.
 
HAL_StatusTypeDef HAL_SPI_Transmit_IT (SPI_HandleTypeDef *hspi, const uint8_t *pData, uint16_t Size)
 Transmit an amount of data in non-blocking mode with Interrupt.
 
HAL_StatusTypeDef HAL_SPI_Receive_IT (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
 Receive an amount of data in non-blocking mode with Interrupt.
 
HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT (SPI_HandleTypeDef *hspi, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
 Transmit and Receive an amount of data in non-blocking mode with Interrupt.
 
HAL_StatusTypeDef HAL_SPI_Transmit_DMA (SPI_HandleTypeDef *hspi, const uint8_t *pData, uint16_t Size)
 Transmit an amount of data in non-blocking mode with DMA.
 
HAL_StatusTypeDef HAL_SPI_Receive_DMA (SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
 Receive an amount of data in non-blocking mode with DMA.
 
HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA (SPI_HandleTypeDef *hspi, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
 Transmit and Receive an amount of data in non-blocking mode with DMA.
 
HAL_StatusTypeDef HAL_SPI_DMAPause (SPI_HandleTypeDef *hspi)
 Pause the DMA Transfer.
 
HAL_StatusTypeDef HAL_SPI_DMAResume (SPI_HandleTypeDef *hspi)
 Resume the DMA Transfer.
 
HAL_StatusTypeDef HAL_SPI_DMAStop (SPI_HandleTypeDef *hspi)
 Stop the DMA Transfer.
 
HAL_StatusTypeDef HAL_SPI_Abort (SPI_HandleTypeDef *hspi)
 Abort ongoing transfer (blocking mode).
 
HAL_StatusTypeDef HAL_SPI_Abort_IT (SPI_HandleTypeDef *hspi)
 Abort ongoing transfer (Interrupt mode).
 
void HAL_SPI_IRQHandler (SPI_HandleTypeDef *hspi)
 Handle SPI interrupt request.
 
void HAL_SPI_TxCpltCallback (SPI_HandleTypeDef *hspi)
 Tx Transfer completed callback.
 
void HAL_SPI_RxCpltCallback (SPI_HandleTypeDef *hspi)
 Rx Transfer completed callback.
 
void HAL_SPI_TxRxCpltCallback (SPI_HandleTypeDef *hspi)
 Tx and Rx Transfer completed callback.
 
void HAL_SPI_TxHalfCpltCallback (SPI_HandleTypeDef *hspi)
 Tx Half Transfer completed callback.
 
void HAL_SPI_RxHalfCpltCallback (SPI_HandleTypeDef *hspi)
 Rx Half Transfer completed callback.
 
void HAL_SPI_TxRxHalfCpltCallback (SPI_HandleTypeDef *hspi)
 Tx and Rx Half Transfer callback.
 
void HAL_SPI_ErrorCallback (SPI_HandleTypeDef *hspi)
 SPI error callback.
 
void HAL_SPI_AbortCpltCallback (SPI_HandleTypeDef *hspi)
 SPI Abort Complete callback.
 

Detailed Description

Data transfers functions.

  ==============================================================================
                      ##### IO operation functions #####
 ===============================================================================
 [..]
    This subsection provides a set of functions allowing to manage the SPI
    data transfers.

    [..] The SPI supports master and slave mode :

    (#) There are two modes of transfer:
       (++) Blocking mode: The communication is performed in polling mode.
            The HAL status of all data processing is returned by the same function
            after finishing transfer.
       (++) No-Blocking mode: The communication is performed using Interrupts
            or DMA, These APIs return the HAL status.
            The end of the data processing will be indicated through the
            dedicated SPI IRQ when using Interrupt mode or the DMA IRQ when
            using DMA mode.
            The HAL_SPI_TxCpltCallback(), HAL_SPI_RxCpltCallback() and HAL_SPI_TxRxCpltCallback() user callbacks
            will be executed respectively at the end of the transmit or Receive process
            The HAL_SPI_ErrorCallback()user callback will be executed when a communication error is detected

    (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA)
        exist for 1Line (simplex) and 2Lines (full duplex) modes.

Function Documentation

◆ HAL_SPI_Transmit()

◆ HAL_SPI_Receive()

HAL_StatusTypeDef HAL_SPI_Receive ( SPI_HandleTypeDef * hspi,
uint8_t * pData,
uint16_t Size,
uint32_t Timeout )

◆ HAL_SPI_TransmitReceive()

HAL_StatusTypeDef HAL_SPI_TransmitReceive ( SPI_HandleTypeDef * hspi,
const uint8_t * pTxData,
uint8_t * pRxData,
uint16_t Size,
uint32_t Timeout )

#include <stm32f4xx_hal_spi.h>

Transmit and Receive an amount of data in blocking mode.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
pTxDatapointer to transmission data buffer
pRxDatapointer to reception data buffer
Sizeamount of data to be sent and received
TimeoutTimeout duration
Return values
HALstatus

Definition at line 1135 of file stm32f4xx_hal_spi.c.

References __HAL_LOCK, __HAL_SPI_CLEAR_CRCERRFLAG, __HAL_SPI_CLEAR_OVRFLAG, __HAL_SPI_ENABLE, __HAL_SPI_GET_FLAG, __HAL_UNLOCK, assert_param, SPI_InitTypeDef::CRCCalculation, SPI_InitTypeDef::DataSize, SPI_InitTypeDef::Direction, __SPI_HandleTypeDef::ErrorCode, HAL_BUSY, HAL_ERROR, HAL_GetTick(), HAL_MAX_DELAY, HAL_OK, HAL_SPI_ERROR_CRC, HAL_SPI_ERROR_FLAG, HAL_SPI_ERROR_NONE, HAL_SPI_STATE_BUSY_RX, HAL_SPI_STATE_BUSY_TX_RX, HAL_SPI_STATE_READY, HAL_TIMEOUT, __SPI_HandleTypeDef::Init, __SPI_HandleTypeDef::Instance, IS_SPI_DIRECTION_2LINES, SPI_InitTypeDef::Mode, __SPI_HandleTypeDef::pRxBuffPtr, __SPI_HandleTypeDef::pTxBuffPtr, __SPI_HandleTypeDef::RxISR, __SPI_HandleTypeDef::RxXferCount, __SPI_HandleTypeDef::RxXferSize, SPI_CRCCALCULATION_ENABLE, SPI_DATASIZE_16BIT, SPI_DIRECTION_2LINES, SPI_EndRxTxTransaction(), SPI_FLAG_CRCERR, SPI_FLAG_RXNE, SPI_FLAG_TXE, SPI_MODE_MASTER, SPI_MODE_SLAVE, SPI_RESET_CRC, SPI_WaitFlagStateUntilTimeout(), __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxISR, __SPI_HandleTypeDef::TxXferCount, __SPI_HandleTypeDef::TxXferSize, and UNUSED.

Referenced by HAL_SPI_Receive().

◆ HAL_SPI_Transmit_IT()

◆ HAL_SPI_Receive_IT()

◆ HAL_SPI_TransmitReceive_IT()

HAL_StatusTypeDef HAL_SPI_TransmitReceive_IT ( SPI_HandleTypeDef * hspi,
const uint8_t * pTxData,
uint8_t * pRxData,
uint16_t Size )

◆ HAL_SPI_Transmit_DMA()

HAL_StatusTypeDef HAL_SPI_Transmit_DMA ( SPI_HandleTypeDef * hspi,
const uint8_t * pData,
uint16_t Size )

◆ HAL_SPI_Receive_DMA()

HAL_StatusTypeDef HAL_SPI_Receive_DMA ( SPI_HandleTypeDef * hspi,
uint8_t * pData,
uint16_t Size )

#include <stm32f4xx_hal_spi.h>

Receive an amount of data in non-blocking mode with DMA.

Note
In case of MASTER mode and SPI_DIRECTION_2LINES direction, hdmatx shall be defined.
Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
pDatapointer to data buffer
Note
When the CRC feature is enabled the pData Length must be Size + 1.
Parameters
Sizeamount of data to be sent
Return values
HALstatus

Definition at line 1748 of file stm32f4xx_hal_spi.c.

References __HAL_LOCK, __HAL_SPI_DISABLE, __HAL_SPI_ENABLE, __HAL_SPI_ENABLE_IT, __HAL_UNLOCK, assert_param, SPI_InitTypeDef::CRCCalculation, SPI_InitTypeDef::Direction, __SPI_HandleTypeDef::ErrorCode, HAL_BUSY, HAL_DMA_Start_IT(), HAL_ERROR, HAL_OK, HAL_SPI_ERROR_DMA, HAL_SPI_ERROR_NONE, HAL_SPI_STATE_BUSY_RX, HAL_SPI_STATE_READY, HAL_SPI_TransmitReceive_DMA(), __SPI_HandleTypeDef::hdmarx, __SPI_HandleTypeDef::hdmatx, __SPI_HandleTypeDef::Init, __SPI_HandleTypeDef::Instance, IS_SPI_DMA_HANDLE, SPI_InitTypeDef::Mode, __SPI_HandleTypeDef::pRxBuffPtr, __SPI_HandleTypeDef::RxISR, __SPI_HandleTypeDef::RxXferCount, __SPI_HandleTypeDef::RxXferSize, SPI_1LINE_RX, SPI_CRCCALCULATION_ENABLE, SPI_DIRECTION_1LINE, SPI_DIRECTION_2LINES, SPI_DMAError(), SPI_DMAHalfReceiveCplt(), SPI_DMAReceiveCplt(), SPI_IT_ERR, SPI_MODE_MASTER, SPI_RESET_CRC, __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxISR, __SPI_HandleTypeDef::TxXferCount, __SPI_HandleTypeDef::TxXferSize, __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, and __DMA_HandleTypeDef::XferHalfCpltCallback.

◆ HAL_SPI_TransmitReceive_DMA()

HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA ( SPI_HandleTypeDef * hspi,
const uint8_t * pTxData,
uint8_t * pRxData,
uint16_t Size )

#include <stm32f4xx_hal_spi.h>

Transmit and Receive an amount of data in non-blocking mode with DMA.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
pTxDatapointer to transmission data buffer
pRxDatapointer to reception data buffer
Note
When the CRC feature is enabled the pRxData Length must be Size + 1
Parameters
Sizeamount of data to be sent
Return values
HALstatus

Definition at line 1858 of file stm32f4xx_hal_spi.c.

References __HAL_LOCK, __HAL_SPI_ENABLE, __HAL_SPI_ENABLE_IT, __HAL_UNLOCK, assert_param, SPI_InitTypeDef::CRCCalculation, SPI_InitTypeDef::Direction, __SPI_HandleTypeDef::ErrorCode, HAL_BUSY, HAL_DMA_Start_IT(), HAL_ERROR, HAL_OK, HAL_SPI_ERROR_DMA, HAL_SPI_ERROR_NONE, HAL_SPI_STATE_BUSY_RX, HAL_SPI_STATE_BUSY_TX_RX, HAL_SPI_STATE_READY, __SPI_HandleTypeDef::hdmarx, __SPI_HandleTypeDef::hdmatx, __SPI_HandleTypeDef::Init, __SPI_HandleTypeDef::Instance, IS_SPI_DIRECTION_2LINES, IS_SPI_DMA_HANDLE, SPI_InitTypeDef::Mode, __SPI_HandleTypeDef::pRxBuffPtr, __SPI_HandleTypeDef::pTxBuffPtr, __SPI_HandleTypeDef::RxISR, __SPI_HandleTypeDef::RxXferCount, __SPI_HandleTypeDef::RxXferSize, SPI_CRCCALCULATION_ENABLE, SPI_DIRECTION_2LINES, SPI_DMAError(), SPI_DMAHalfReceiveCplt(), SPI_DMAHalfTransmitReceiveCplt(), SPI_DMAReceiveCplt(), SPI_DMATransmitReceiveCplt(), SPI_IT_ERR, SPI_MODE_MASTER, SPI_RESET_CRC, __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxISR, __SPI_HandleTypeDef::TxXferCount, __SPI_HandleTypeDef::TxXferSize, __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, and __DMA_HandleTypeDef::XferHalfCpltCallback.

Referenced by HAL_SPI_Receive_DMA().

◆ HAL_SPI_DMAPause()

HAL_StatusTypeDef HAL_SPI_DMAPause ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Pause the DMA Transfer.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI module.
Return values
HALstatus

Definition at line 2306 of file stm32f4xx_hal_spi.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, and __SPI_HandleTypeDef::Instance.

◆ HAL_SPI_DMAResume()

HAL_StatusTypeDef HAL_SPI_DMAResume ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Resume the DMA Transfer.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI module.
Return values
HALstatus

Definition at line 2326 of file stm32f4xx_hal_spi.c.

References __HAL_LOCK, __HAL_UNLOCK, HAL_OK, and __SPI_HandleTypeDef::Instance.

◆ HAL_SPI_DMAStop()

HAL_StatusTypeDef HAL_SPI_DMAStop ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Stop the DMA Transfer.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for the specified SPI module.
Return values
HALstatus

Definition at line 2346 of file stm32f4xx_hal_spi.c.

References __SPI_HandleTypeDef::ErrorCode, HAL_DMA_Abort(), HAL_ERROR, HAL_OK, HAL_SPI_ERROR_DMA, HAL_SPI_STATE_READY, __SPI_HandleTypeDef::hdmarx, __SPI_HandleTypeDef::hdmatx, __SPI_HandleTypeDef::Instance, and __SPI_HandleTypeDef::State.

◆ HAL_SPI_Abort()

HAL_StatusTypeDef HAL_SPI_Abort ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Abort ongoing transfer (blocking mode).

Parameters
hspiSPI handle.
Note
This procedure could be used for aborting any ongoing transfer (Tx and Rx), started in Interrupt or DMA mode. This procedure performs following operations :
  • Disable SPI Interrupts (depending of transfer direction)
  • Disable the DMA transfer in the peripheral register (if enabled)
  • Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode)
  • Set handle State to READY
This procedure is executed in blocking mode : when exiting function, Abort is considered as completed.
Return values
HALstatus

Definition at line 2000 of file stm32f4xx_hal_spi.c.

References __HAL_SPI_CLEAR_FREFLAG, __HAL_SPI_CLEAR_OVRFLAG, __HAL_SPI_DISABLE, __SPI_HandleTypeDef::ErrorCode, HAL_DMA_Abort(), HAL_ERROR, HAL_IS_BIT_SET, HAL_OK, HAL_SPI_ERROR_ABORT, HAL_SPI_ERROR_NONE, HAL_SPI_STATE_ABORT, HAL_SPI_STATE_READY, __SPI_HandleTypeDef::hdmarx, __SPI_HandleTypeDef::hdmatx, __SPI_HandleTypeDef::Instance, __SPI_HandleTypeDef::RxISR, __SPI_HandleTypeDef::RxXferCount, SPI_AbortRx_ISR(), SPI_AbortTx_ISR(), SPI_DEFAULT_TIMEOUT, SPI_FLAG_TXE, __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxISR, __SPI_HandleTypeDef::TxXferCount, and __DMA_HandleTypeDef::XferAbortCallback.

◆ HAL_SPI_Abort_IT()

HAL_StatusTypeDef HAL_SPI_Abort_IT ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Abort ongoing transfer (Interrupt mode).

Parameters
hspiSPI handle.
Note
This procedure could be used for aborting any ongoing transfer (Tx and Rx), started in Interrupt or DMA mode. This procedure performs following operations :
  • Disable SPI Interrupts (depending of transfer direction)
  • Disable the DMA transfer in the peripheral register (if enabled)
  • Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode)
  • Set handle State to READY
  • At abort completion, call user abort complete callback
This procedure is executed in Interrupt mode, meaning that abort procedure could be considered as completed only when user abort complete callback is executed (not when exiting function).
Return values
HALstatus

Definition at line 2145 of file stm32f4xx_hal_spi.c.

References __HAL_SPI_CLEAR_FREFLAG, __HAL_SPI_CLEAR_OVRFLAG, __SPI_HandleTypeDef::ErrorCode, HAL_DMA_Abort_IT(), HAL_ERROR, HAL_IS_BIT_SET, HAL_OK, HAL_SPI_AbortCpltCallback(), HAL_SPI_ERROR_ABORT, HAL_SPI_ERROR_NONE, HAL_SPI_STATE_ABORT, HAL_SPI_STATE_READY, __SPI_HandleTypeDef::hdmarx, __SPI_HandleTypeDef::hdmatx, __SPI_HandleTypeDef::Instance, __SPI_HandleTypeDef::RxISR, __SPI_HandleTypeDef::RxXferCount, SPI_AbortRx_ISR(), SPI_AbortTx_ISR(), SPI_DEFAULT_TIMEOUT, SPI_DMARxAbortCallback(), SPI_DMATxAbortCallback(), __SPI_HandleTypeDef::State, __SPI_HandleTypeDef::TxISR, __SPI_HandleTypeDef::TxXferCount, and __DMA_HandleTypeDef::XferAbortCallback.

◆ HAL_SPI_IRQHandler()

◆ HAL_SPI_TxCpltCallback()

__weak void HAL_SPI_TxCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Tx Transfer completed callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2493 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), SPI_CloseTx_ISR(), and SPI_DMATransmitCplt().

◆ HAL_SPI_RxCpltCallback()

__weak void HAL_SPI_RxCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Rx Transfer completed callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2509 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), SPI_CloseRx_ISR(), SPI_CloseRxTx_ISR(), and SPI_DMAReceiveCplt().

◆ HAL_SPI_TxRxCpltCallback()

__weak void HAL_SPI_TxRxCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Tx and Rx Transfer completed callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2525 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), SPI_CloseRxTx_ISR(), and SPI_DMATransmitReceiveCplt().

◆ HAL_SPI_TxHalfCpltCallback()

__weak void HAL_SPI_TxHalfCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Tx Half Transfer completed callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2541 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), and SPI_DMAHalfTransmitCplt().

◆ HAL_SPI_RxHalfCpltCallback()

__weak void HAL_SPI_RxHalfCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Rx Half Transfer completed callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2557 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), and SPI_DMAHalfReceiveCplt().

◆ HAL_SPI_TxRxHalfCpltCallback()

__weak void HAL_SPI_TxRxHalfCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

Tx and Rx Half Transfer callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2573 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), and SPI_DMAHalfTransmitReceiveCplt().

◆ HAL_SPI_ErrorCallback()

__weak void HAL_SPI_ErrorCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

SPI error callback.

Parameters
hspipointer to a SPI_HandleTypeDef structure that contains the configuration information for SPI module.
Return values
None

Definition at line 2589 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Init(), HAL_SPI_IRQHandler(), SPI_CloseRx_ISR(), SPI_CloseRxTx_ISR(), SPI_CloseTx_ISR(), SPI_DMAAbortOnError(), SPI_DMAError(), SPI_DMAReceiveCplt(), SPI_DMATransmitCplt(), and SPI_DMATransmitReceiveCplt().

◆ HAL_SPI_AbortCpltCallback()

__weak void HAL_SPI_AbortCpltCallback ( SPI_HandleTypeDef * hspi)

#include <stm32f4xx_hal_spi.h>

SPI Abort Complete callback.

Parameters
hspiSPI handle.
Return values
None

Definition at line 2607 of file stm32f4xx_hal_spi.c.

References UNUSED.

Referenced by HAL_SPI_Abort_IT(), HAL_SPI_Init(), SPI_DMARxAbortCallback(), and SPI_DMATxAbortCallback().