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

I/O operation functions
More...

Collaboration diagram for I/O operation functions:

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_CleanCallbacks (DMA_HandleTypeDef *hdma)
 
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.
 

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_DMA_Start()

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

#include <stm32f4xx_hal_dma.h>

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 407 of file stm32f4xx_hal_dma.c.

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

◆ HAL_DMA_Start_IT()

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

#include <stm32f4xx_hal_dma.h>

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 451 of file stm32f4xx_hal_dma.c.

References __HAL_DMA_ENABLE, __HAL_LOCK, __HAL_UNLOCK, assert_param, DMA_IT_DME, DMA_IT_HT, DMA_IT_TC, DMA_IT_TE, DMA_SetConfig(), __DMA_HandleTypeDef::ErrorCode, HAL_BUSY, HAL_DMA_ERROR_NONE, HAL_DMA_STATE_BUSY, HAL_DMA_STATE_READY, HAL_OK, 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(), FMPI2C_DMAMasterReceiveCplt(), FMPI2C_DMAMasterTransmitCplt(), HAL_ADC_Start_DMA(), HAL_ADCEx_MultiModeStart_DMA(), HAL_DAC_Start_DMA(), HAL_DCMI_Start_DMA(), HAL_FMPI2C_Master_Receive_DMA(), HAL_FMPI2C_Master_Seq_Receive_DMA(), HAL_FMPI2C_Master_Seq_Transmit_DMA(), HAL_FMPI2C_Master_Transmit_DMA(), HAL_FMPI2C_Mem_Read_DMA(), HAL_FMPI2C_Mem_Write_DMA(), HAL_FMPI2C_Slave_Receive_DMA(), HAL_FMPI2C_Slave_Seq_Receive_DMA(), HAL_FMPI2C_Slave_Seq_Transmit_DMA(), HAL_FMPI2C_Slave_Transmit_DMA(), HAL_I2C_Master_Receive_DMA(), HAL_I2C_Master_Seq_Receive_DMA(), HAL_I2C_Master_Seq_Transmit_DMA(), HAL_I2C_Master_Transmit_DMA(), HAL_I2C_Mem_Read_DMA(), HAL_I2C_Mem_Write_DMA(), HAL_I2C_Slave_Receive_DMA(), HAL_I2C_Slave_Seq_Receive_DMA(), HAL_I2C_Slave_Seq_Transmit_DMA(), HAL_I2C_Slave_Transmit_DMA(), HAL_I2S_Receive_DMA(), HAL_I2S_Transmit_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_SMARTCARD_Receive_DMA(), HAL_SMARTCARD_Transmit_DMA(), HAL_SPI_Receive_DMA(), HAL_SPI_Transmit_DMA(), HAL_SPI_TransmitReceive_DMA(), HAL_TIM_Base_Start_DMA(), HAL_TIM_DMABurst_MultiReadStart(), HAL_TIM_DMABurst_MultiWriteStart(), 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_Transmit_DMA(), HAL_USART_Receive_DMA(), HAL_USART_Transmit_DMA(), HAL_USART_TransmitReceive_DMA(), HASH_DMAXferCplt(), HASH_Start_DMA(), HMAC_Start_DMA(), and UART_Start_Receive_DMA().

◆ HAL_DMA_Abort()

HAL_StatusTypeDef HAL_DMA_Abort ( DMA_HandleTypeDef * hdma)

#include <stm32f4xx_hal_dma.h>

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 513 of file stm32f4xx_hal_dma.c.

References __HAL_DMA_DISABLE, __HAL_UNLOCK, 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_ERROR, HAL_GetTick(), HAL_OK, HAL_TIMEOUT, 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_HASH_DMAFeed_ProcessSuspend(), 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_UART_Abort(), HAL_UART_AbortReceive(), HAL_UART_AbortTransmit(), HAL_UART_DMAStop(), HAL_UART_IRQHandler(), HAL_USART_Abort(), and HAL_USART_DMAStop().

◆ HAL_DMA_Abort_IT()

HAL_StatusTypeDef HAL_DMA_Abort_IT ( DMA_HandleTypeDef * hdma)

#include <stm32f4xx_hal_dma.h>

Aborts the DMA Transfer in Interrupt mode.

Parameters
hdmapointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Stream.
Return values
HALstatus

Definition at line 580 of file stm32f4xx_hal_dma.c.

References __HAL_DMA_DISABLE, __DMA_HandleTypeDef::ErrorCode, HAL_DMA_ERROR_NO_XFER, HAL_DMA_STATE_ABORT, HAL_DMA_STATE_BUSY, HAL_ERROR, HAL_OK, and __DMA_HandleTypeDef::State.

Referenced by FMPI2C_ITError(), HAL_DCMI_IRQHandler(), HAL_FMPI2C_Slave_Seq_Receive_DMA(), HAL_FMPI2C_Slave_Seq_Receive_IT(), HAL_FMPI2C_Slave_Seq_Transmit_DMA(), HAL_FMPI2C_Slave_Seq_Transmit_IT(), HAL_I2C_Mem_Read_DMA(), HAL_I2C_Mem_Write_DMA(), HAL_I2C_Slave_Seq_Receive_DMA(), HAL_I2C_Slave_Seq_Transmit_DMA(), HAL_IRDA_Abort_IT(), HAL_IRDA_AbortReceive_IT(), HAL_IRDA_AbortTransmit_IT(), HAL_IRDA_IRQHandler(), HAL_MMC_Abort_IT(), HAL_MMC_IRQHandler(), HAL_SAI_IRQHandler(), HAL_SD_Abort_IT(), HAL_SD_IRQHandler(), HAL_SMARTCARD_Abort_IT(), HAL_SMARTCARD_AbortReceive_IT(), HAL_SMARTCARD_AbortTransmit_IT(), HAL_SMARTCARD_IRQHandler(), HAL_SPI_Abort_IT(), HAL_SPI_IRQHandler(), HAL_TIM_Base_Stop_DMA(), HAL_TIM_DMABurst_ReadStop(), HAL_TIM_DMABurst_WriteStop(), HAL_TIM_Encoder_Stop_DMA(), HAL_TIM_IC_Stop_DMA(), HAL_TIM_OC_Stop_DMA(), HAL_TIM_PWM_Stop_DMA(), HAL_TIMEx_HallSensor_Stop_DMA(), HAL_TIMEx_OCN_Stop_DMA(), HAL_TIMEx_PWMN_Stop_DMA(), HAL_UART_Abort_IT(), HAL_UART_AbortReceive_IT(), HAL_UART_AbortTransmit_IT(), HAL_UART_IRQHandler(), HAL_USART_Abort_IT(), HAL_USART_IRQHandler(), I2C_ITError(), and I2C_Slave_STOPF().

◆ HAL_DMA_PollForTransfer()

HAL_StatusTypeDef HAL_DMA_PollForTransfer ( DMA_HandleTypeDef * hdma,
HAL_DMA_LevelCompleteTypeDef CompleteLevel,
uint32_t Timeout )

#include <stm32f4xx_hal_dma.h>

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 recommended 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 610 of file stm32f4xx_hal_dma.c.

References __HAL_UNLOCK, 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_ERROR, HAL_GetTick(), HAL_MAX_DELAY, HAL_OK, HAL_TIMEOUT, DMA_Base_Registers::IFCR, __DMA_HandleTypeDef::Instance, DMA_Base_Registers::ISR, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::StreamBaseAddress, and __DMA_HandleTypeDef::StreamIndex.

◆ HAL_DMA_IRQHandler()

◆ HAL_DMA_CleanCallbacks()

HAL_StatusTypeDef HAL_DMA_CleanCallbacks ( DMA_HandleTypeDef * hdma)

#include <stm32f4xx_hal_dma.h>

◆ HAL_DMA_RegisterCallback()

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

#include <stm32f4xx_hal_dma.h>

Register callbacks.

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

Definition at line 967 of file stm32f4xx_hal_dma.c.

References __HAL_LOCK, __HAL_UNLOCK, 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, HAL_ERROR, HAL_OK, __DMA_HandleTypeDef::State, __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, __DMA_HandleTypeDef::XferHalfCpltCallback, __DMA_HandleTypeDef::XferM1CpltCallback, and __DMA_HandleTypeDef::XferM1HalfCpltCallback.

◆ HAL_DMA_UnRegisterCallback()

HAL_StatusTypeDef HAL_DMA_UnRegisterCallback ( DMA_HandleTypeDef * hdma,
HAL_DMA_CallbackIDTypeDef CallbackID )