Input and Output operation functions.
More...
|
| HAL_StatusTypeDef | HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength) |
| | Start the DMA Transfer. More...
|
| |
| 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. More...
|
| |
| HAL_StatusTypeDef | HAL_DMA_Abort (DMA_HandleTypeDef *hdma) |
| | Abort the DMA Transfer. More...
|
| |
| HAL_StatusTypeDef | HAL_DMA_Abort_IT (DMA_HandleTypeDef *hdma) |
| | Aborts the DMA Transfer in Interrupt mode. More...
|
| |
| HAL_StatusTypeDef | HAL_DMA_PollForTransfer (DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout) |
| | Polling for transfer complete. More...
|
| |
| void | HAL_DMA_IRQHandler (DMA_HandleTypeDef *hdma) |
| | Handle DMA interrupt request. More...
|
| |
| HAL_StatusTypeDef | HAL_DMA_RegisterCallback (DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void(*pCallback)(DMA_HandleTypeDef *_hdma)) |
| | Register callbacks. More...
|
| |
| HAL_StatusTypeDef | HAL_DMA_UnRegisterCallback (DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID) |
| | UnRegister callbacks. More...
|
| |
Input and Output 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
◆ HAL_DMA_Abort()
Abort the DMA Transfer.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
- Return values
-
Definition at line 546 of file stm32l4xx_hal_dma.c.
548 HAL_StatusTypeDef status =
HAL_OK;
563 __HAL_DMA_DISABLE_IT(hdma, (DMA_IT_TC | DMA_IT_HT | DMA_IT_TE));
571 __HAL_DMA_DISABLE(hdma);
uint32_t DMAmuxChannelStatusMask
DMAMUX_RequestGenStatus_TypeDef * DMAmuxRequestGenStatus
DMAMUX_RequestGen_TypeDef * DMAmuxRequestGen
DMA_TypeDef * DmaBaseAddress
__IO HAL_DMA_StateTypeDef State
DMAMUX_Channel_TypeDef * DMAmuxChannel
uint32_t DMAmuxRequestGenStatusMask
DMAMUX_ChannelStatus_TypeDef * DMAmuxChannelStatus
◆ HAL_DMA_Abort_IT()
Aborts the DMA Transfer in Interrupt mode.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
- Return values
-
Definition at line 608 of file stm32l4xx_hal_dma.c.
610 HAL_StatusTypeDef status =
HAL_OK;
622 __HAL_DMA_DISABLE_IT(hdma, (DMA_IT_TC | DMA_IT_HT | DMA_IT_TE));
625 __HAL_DMA_DISABLE(hdma);
uint32_t DMAmuxChannelStatusMask
void(* XferAbortCallback)(struct __DMA_HandleTypeDef *hdma)
DMAMUX_RequestGenStatus_TypeDef * DMAmuxRequestGenStatus
DMAMUX_RequestGen_TypeDef * DMAmuxRequestGen
DMA_TypeDef * DmaBaseAddress
__IO HAL_DMA_StateTypeDef State
DMAMUX_Channel_TypeDef * DMAmuxChannel
uint32_t DMAmuxRequestGenStatusMask
DMAMUX_ChannelStatus_TypeDef * DMAmuxChannelStatus
◆ HAL_DMA_IRQHandler()
Handle DMA interrupt request.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
- Return values
-
Definition at line 805 of file stm32l4xx_hal_dma.c.
808 uint32_t source_it = hdma->
Instance->CCR;
811 if (((flag_it & (DMA_FLAG_HT1 << (hdma->
ChannelIndex & 0x1CU))) != 0U) && ((source_it & DMA_IT_HT) != 0U))
814 if((hdma->
Instance->CCR & DMA_CCR_CIRC) == 0U)
817 __HAL_DMA_DISABLE_IT(hdma, DMA_IT_HT);
833 else if (((flag_it & (DMA_FLAG_TC1 << (hdma->
ChannelIndex & 0x1CU))) != 0U) && ((source_it & DMA_IT_TC) != 0U))
835 if((hdma->
Instance->CCR & DMA_CCR_CIRC) == 0U)
840 __HAL_DMA_DISABLE_IT(hdma, DMA_IT_TE | DMA_IT_TC);
859 else if (((flag_it & (DMA_FLAG_TE1 << (hdma->
ChannelIndex & 0x1CU))) != 0U) && ((source_it & DMA_IT_TE) != 0U))
864 __HAL_DMA_DISABLE_IT(hdma, (DMA_IT_TC | DMA_IT_HT | DMA_IT_TE));
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
DMA_Channel_TypeDef * Instance
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
DMA_TypeDef * DmaBaseAddress
__IO HAL_DMA_StateTypeDef State
◆ HAL_DMA_PollForTransfer()
Polling for transfer complete.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
| CompleteLevel | Specifies the DMA level complete. |
| Timeout | Timeout duration. |
- Return values
-
Definition at line 675 of file stm32l4xx_hal_dma.c.
689 if ((hdma->
Instance->CCR & DMA_CCR_CIRC) != 0U)
691 hdma->
ErrorCode = HAL_DMA_ERROR_NOT_SUPPORTED;
731 if(Timeout != HAL_MAX_DELAY)
733 if(((
HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U))
uint32_t DMAmuxChannelStatusMask
DMAMUX_RequestGenStatus_TypeDef * DMAmuxRequestGenStatus
DMAMUX_RequestGen_TypeDef * DMAmuxRequestGen
uint32_t HAL_GetTick(void)
Provide a tick value in millisecond.
DMA_Channel_TypeDef * Instance
DMA_TypeDef * DmaBaseAddress
__IO HAL_DMA_StateTypeDef State
uint32_t DMAmuxRequestGenStatusMask
DMAMUX_ChannelStatus_TypeDef * DMAmuxChannelStatus
◆ HAL_DMA_RegisterCallback()
Register callbacks.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
| CallbackID | User Callback identifer a HAL_DMA_CallbackIDTypeDef ENUM as parameter. |
| pCallback | pointer to private callbacsk function which has pointer to a DMA_HandleTypeDef structure as parameter. |
- Return values
-
Definition at line 901 of file stm32l4xx_hal_dma.c.
903 HAL_StatusTypeDef status =
HAL_OK;
void(* XferAbortCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
__IO HAL_DMA_StateTypeDef State
◆ HAL_DMA_Start()
| HAL_StatusTypeDef HAL_DMA_Start |
( |
DMA_HandleTypeDef * |
hdma, |
|
|
uint32_t |
SrcAddress, |
|
|
uint32_t |
DstAddress, |
|
|
uint32_t |
DataLength |
|
) |
| |
Start the DMA Transfer.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
| SrcAddress | The source memory Buffer address |
| DstAddress | The destination memory Buffer address |
| DataLength | The length of data to be transferred from source to destination |
- Return values
-
Definition at line 430 of file stm32l4xx_hal_dma.c.
432 HAL_StatusTypeDef status =
HAL_OK;
447 __HAL_DMA_DISABLE(hdma);
453 __HAL_DMA_ENABLE(hdma);
__IO HAL_DMA_StateTypeDef State
static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
Sets the DMA Transfer parameter.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_DMA_Start_IT()
| 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
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
| SrcAddress | The source memory Buffer address |
| DstAddress | The destination memory Buffer address |
| DataLength | The length of data to be transferred from source to destination |
- Return values
-
Definition at line 473 of file stm32l4xx_hal_dma.c.
475 HAL_StatusTypeDef status =
HAL_OK;
490 __HAL_DMA_DISABLE(hdma);
500 __HAL_DMA_ENABLE_IT(hdma, (DMA_IT_TC | DMA_IT_HT | DMA_IT_TE));
504 __HAL_DMA_DISABLE_IT(hdma, DMA_IT_HT);
505 __HAL_DMA_ENABLE_IT(hdma, (DMA_IT_TC | DMA_IT_TE));
527 __HAL_DMA_ENABLE(hdma);
DMAMUX_RequestGen_TypeDef * DMAmuxRequestGen
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
__IO HAL_DMA_StateTypeDef State
DMAMUX_Channel_TypeDef * DMAmuxChannel
static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
Sets the DMA Transfer parameter.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_DMA_UnRegisterCallback()
UnRegister callbacks.
- Parameters
-
| hdma | pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel. |
| CallbackID | User Callback identifer a HAL_DMA_CallbackIDTypeDef ENUM as parameter. |
- Return values
-
Definition at line 952 of file stm32l4xx_hal_dma.c.
954 HAL_StatusTypeDef status =
HAL_OK;
void(* XferAbortCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
__IO HAL_DMA_StateTypeDef State