STM32F439xx HAL User Manual
Functions
I/O operation functions
DMA Exported Functions

I/O operation functions. More...

Functions

HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
 Starts the DMA Transfer.
HAL_StatusTypeDef HAL_DMA_Start_IT (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
 Start the DMA Transfer with interrupt enabled.
HAL_StatusTypeDef HAL_DMA_Abort (DMA_HandleTypeDef *hdma)
 Aborts the DMA Transfer.
HAL_StatusTypeDef HAL_DMA_Abort_IT (DMA_HandleTypeDef *hdma)
 Aborts the DMA Transfer in Interrupt mode.
HAL_StatusTypeDef HAL_DMA_PollForTransfer (DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout)
 Polling for transfer complete.
void HAL_DMA_IRQHandler (DMA_HandleTypeDef *hdma)
 Handles DMA interrupt request.
HAL_StatusTypeDef HAL_DMA_RegisterCallback (DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void(*pCallback)(DMA_HandleTypeDef *_hdma))
 Register callbacks.
HAL_StatusTypeDef HAL_DMA_UnRegisterCallback (DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID)
 UnRegister callbacks.
HAL_StatusTypeDef HAL_DMA_CleanCallbacks (DMA_HandleTypeDef *hdma)

Detailed Description

I/O operation functions.

 ===============================================================================
                      #####  IO operation functions  #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Configure the source, destination address and data length and Start DMA transfer
      (+) Configure the source, destination address and data length and 
          Start DMA transfer with interrupt
      (+) Abort DMA transfer
      (+) Poll for transfer complete
      (+) Handle DMA interrupt request  


Function Documentation

HAL_StatusTypeDef HAL_DMA_Abort ( DMA_HandleTypeDef hdma)

Aborts the DMA Transfer.

Parameters:
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
Note:
After disabling a DMA Stream, a check for wait until the DMA Stream is effectively disabled is added. If a Stream is disabled while a data transfer is ongoing, the current data will be transferred and the Stream will be effectively disabled only after the transfer of this single data is finished.
Return values:
HALstatus

Definition at line 523 of file stm32f4xx_hal_dma.c.

References __HAL_DMA_DISABLE, DMA_IT_DME, DMA_IT_FE, DMA_IT_HT, DMA_IT_TC, DMA_IT_TE, __DMA_HandleTypeDef::ErrorCode, HAL_DMA_ERROR_NO_XFER, HAL_DMA_ERROR_TIMEOUT, HAL_DMA_STATE_BUSY, HAL_DMA_STATE_READY, HAL_DMA_STATE_TIMEOUT, HAL_GetTick(), HAL_TIMEOUT_DMA_ABORT, DMA_Base_Registers::IFCR, __DMA_HandleTypeDef::Instance, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::StreamBaseAddress, __DMA_HandleTypeDef::StreamIndex, __DMA_HandleTypeDef::XferHalfCpltCallback, and __DMA_HandleTypeDef::XferM1HalfCpltCallback.

Referenced by HAL_ADC_Stop_DMA(), HAL_ADCEx_MultiModeStop_DMA(), HAL_DAC_Stop_DMA(), HAL_DCMI_Stop(), HAL_DMA_PollForTransfer(), HAL_I2S_DMAStop(), HAL_IRDA_Abort(), HAL_IRDA_AbortReceive(), HAL_IRDA_AbortTransmit(), HAL_IRDA_DMAStop(), HAL_MMC_Abort(), HAL_SAI_Abort(), HAL_SAI_DMAStop(), HAL_SD_Abort(), HAL_SMARTCARD_Abort(), HAL_SMARTCARD_AbortReceive(), HAL_SMARTCARD_AbortTransmit(), HAL_SPI_Abort(), HAL_SPI_DMAStop(), HAL_TIM_DMABurst_ReadStop(), HAL_TIM_DMABurst_WriteStop(), HAL_UART_Abort(), HAL_UART_AbortReceive(), HAL_UART_AbortTransmit(), HAL_UART_DMAStop(), HAL_USART_Abort(), and HAL_USART_DMAStop().

HAL_StatusTypeDef HAL_DMA_Abort_IT ( DMA_HandleTypeDef hdma)
HAL_StatusTypeDef HAL_DMA_CleanCallbacks ( DMA_HandleTypeDef hdma)
HAL_StatusTypeDef HAL_DMA_PollForTransfer ( DMA_HandleTypeDef hdma,
HAL_DMA_LevelCompleteTypeDef  CompleteLevel,
uint32_t  Timeout 
)

Polling for transfer complete.

Parameters:
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
CompleteLevelSpecifies the DMA level complete.
Note:
The polling mode is kept in this version for legacy. it is recommanded to use the IT model instead. This model could be used for debug purpose.
The HAL_DMA_PollForTransfer API cannot be used in circular and double buffering mode (automatic circular mode).
Parameters:
TimeoutTimeout duration.
Return values:
HALstatus

Definition at line 620 of file stm32f4xx_hal_dma.c.

References DMA_FLAG_DMEIF0_4, DMA_FLAG_FEIF0_4, DMA_FLAG_HTIF0_4, DMA_FLAG_TCIF0_4, DMA_FLAG_TEIF0_4, __DMA_HandleTypeDef::ErrorCode, HAL_DMA_Abort(), HAL_DMA_ERROR_DME, HAL_DMA_ERROR_FE, HAL_DMA_ERROR_NO_XFER, HAL_DMA_ERROR_NONE, HAL_DMA_ERROR_NOT_SUPPORTED, HAL_DMA_ERROR_TE, HAL_DMA_ERROR_TIMEOUT, HAL_DMA_FULL_TRANSFER, HAL_DMA_STATE_BUSY, HAL_DMA_STATE_READY, HAL_GetTick(), DMA_Base_Registers::IFCR, __DMA_HandleTypeDef::Instance, DMA_Base_Registers::ISR, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::StreamBaseAddress, and __DMA_HandleTypeDef::StreamIndex.

HAL_StatusTypeDef HAL_DMA_RegisterCallback ( DMA_HandleTypeDef hdma,
HAL_DMA_CallbackIDTypeDef  CallbackID,
void(*)(DMA_HandleTypeDef *_hdma)  pCallback 
)

Register callbacks.

Parameters:
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
CallbackIDUser Callback identifer a DMA_HandleTypeDef structure as parameter.
pCallbackpointer to private callbacsk function which has pointer to a DMA_HandleTypeDef structure as parameter.
Return values:
HALstatus

Definition at line 977 of file stm32f4xx_hal_dma.c.

References HAL_DMA_STATE_READY, HAL_DMA_XFER_ABORT_CB_ID, HAL_DMA_XFER_CPLT_CB_ID, HAL_DMA_XFER_ERROR_CB_ID, HAL_DMA_XFER_HALFCPLT_CB_ID, HAL_DMA_XFER_M1CPLT_CB_ID, HAL_DMA_XFER_M1HALFCPLT_CB_ID, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, __DMA_HandleTypeDef::XferHalfCpltCallback, __DMA_HandleTypeDef::XferM1CpltCallback, and __DMA_HandleTypeDef::XferM1HalfCpltCallback.

HAL_StatusTypeDef HAL_DMA_Start ( DMA_HandleTypeDef hdma,
uint32_t  SrcAddress,
uint32_t  DstAddress,
uint32_t  DataLength 
)

Starts the DMA Transfer.

Parameters:
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
SrcAddressThe source memory Buffer address
DstAddressThe destination memory Buffer address
DataLengthThe length of data to be transferred from source to destination
Return values:
HALstatus

Definition at line 416 of file stm32f4xx_hal_dma.c.

References __HAL_DMA_ENABLE, assert_param, DMA_SetConfig(), __DMA_HandleTypeDef::ErrorCode, HAL_DMA_ERROR_NONE, HAL_DMA_STATE_BUSY, HAL_DMA_STATE_READY, IS_DMA_BUFFER_SIZE, and __DMA_HandleTypeDef::State.

HAL_StatusTypeDef HAL_DMA_Start_IT ( DMA_HandleTypeDef hdma,
uint32_t  SrcAddress,
uint32_t  DstAddress,
uint32_t  DataLength 
)

Start the DMA Transfer with interrupt enabled.

Parameters:
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
SrcAddressThe source memory Buffer address
DstAddressThe destination memory Buffer address
DataLengthThe length of data to be transferred from source to destination
Return values:
HALstatus

Definition at line 460 of file stm32f4xx_hal_dma.c.

References __HAL_DMA_ENABLE, assert_param, DMA_IT_DME, DMA_IT_FE, DMA_IT_HT, DMA_IT_TC, DMA_IT_TE, DMA_SetConfig(), __DMA_HandleTypeDef::ErrorCode, HAL_DMA_ERROR_NONE, HAL_DMA_STATE_BUSY, HAL_DMA_STATE_READY, DMA_Base_Registers::IFCR, __DMA_HandleTypeDef::Instance, IS_DMA_BUFFER_SIZE, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::StreamBaseAddress, __DMA_HandleTypeDef::StreamIndex, and __DMA_HandleTypeDef::XferHalfCpltCallback.

Referenced by CRYP_SetDMAConfig(), CRYPEx_GCMCCM_SetDMAConfig(), HAL_ADC_Start_DMA(), HAL_ADCEx_MultiModeStart_DMA(), HAL_DAC_Start_DMA(), HAL_DCMI_Start_DMA(), HAL_HASH_MD5_Start_DMA(), HAL_HASH_SHA1_Start_DMA(), HAL_HASHEx_SHA224_Start_DMA(), HAL_HASHEx_SHA256_Start_DMA(), HAL_HMAC_MD5_Start_DMA(), HAL_HMAC_SHA1_Start_DMA(), HAL_HMACEx_SHA224_Start_DMA(), HAL_HMACEx_SHA256_Start_DMA(), HAL_I2C_Master_Receive_DMA(), HAL_I2C_Master_Transmit_DMA(), HAL_I2C_Mem_Read_DMA(), HAL_I2C_Mem_Write_DMA(), HAL_I2C_Slave_Receive_DMA(), HAL_I2C_Slave_Transmit_DMA(), HAL_I2S_Receive_DMA(), HAL_I2S_Transmit_DMA(), HAL_I2SEx_TransmitReceive_DMA(), HAL_IRDA_Receive_DMA(), HAL_IRDA_Transmit_DMA(), HAL_MMC_ReadBlocks_DMA(), HAL_MMC_WriteBlocks_DMA(), HAL_SAI_Receive_DMA(), HAL_SAI_Transmit_DMA(), HAL_SD_ReadBlocks_DMA(), HAL_SD_WriteBlocks_DMA(), HAL_SDRAM_Read_DMA(), HAL_SDRAM_Write_DMA(), HAL_SMARTCARD_Receive_DMA(), HAL_SMARTCARD_Transmit_DMA(), HAL_SPI_Receive_DMA(), HAL_SPI_Transmit_DMA(), HAL_SPI_TransmitReceive_DMA(), HAL_SRAM_Read_DMA(), HAL_SRAM_Write_DMA(), HAL_TIM_Base_Start_DMA(), HAL_TIM_DMABurst_ReadStart(), HAL_TIM_DMABurst_WriteStart(), HAL_TIM_Encoder_Start_DMA(), HAL_TIM_IC_Start_DMA(), HAL_TIM_OC_Start_DMA(), HAL_TIM_PWM_Start_DMA(), HAL_TIMEx_HallSensor_Start_DMA(), HAL_TIMEx_OCN_Start_DMA(), HAL_TIMEx_PWMN_Start_DMA(), HAL_UART_Receive_DMA(), HAL_UART_Transmit_DMA(), HAL_USART_Receive_DMA(), HAL_USART_Transmit_DMA(), HAL_USART_TransmitReceive_DMA(), HASH_DMAXferCplt(), and HASHEx_DMAXferCplt().

HAL_StatusTypeDef HAL_DMA_UnRegisterCallback ( DMA_HandleTypeDef hdma,
HAL_DMA_CallbackIDTypeDef  CallbackID 
)

UnRegister callbacks.

Parameters:
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
CallbackIDUser Callback identifer a HAL_DMA_CallbackIDTypeDef ENUM as parameter.
Return values:
HALstatus

Definition at line 1037 of file stm32f4xx_hal_dma.c.

References HAL_DMA_STATE_READY, HAL_DMA_XFER_ABORT_CB_ID, HAL_DMA_XFER_ALL_CB_ID, HAL_DMA_XFER_CPLT_CB_ID, HAL_DMA_XFER_ERROR_CB_ID, HAL_DMA_XFER_HALFCPLT_CB_ID, HAL_DMA_XFER_M1CPLT_CB_ID, HAL_DMA_XFER_M1HALFCPLT_CB_ID, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, __DMA_HandleTypeDef::XferHalfCpltCallback, __DMA_HandleTypeDef::XferM1CpltCallback, and __DMA_HandleTypeDef::XferM1HalfCpltCallback.