Functions
Peripheral State and Errors functions
Peripheral Driver » HAL Driver » DMA » Functions

Peripheral State and Errors functions. More...

## Functions
hal_dma_state_t | hal_dma_get_state (dma_handle_t *p_dma)
| Return the DMA hande state. More...
uint32_t | hal_dma_get_error (dma_handle_t *p_dma)
| Return the DMA error code. More...
void | hal_dma_suspend_reg (dma_handle_t *p_dma)
| Suspend some registers related to DMA configuration before sleep. More...
void | hal_dma_resume_reg (dma_handle_t *p_dma)
| Restore some registers related to DMA configuration after sleep. This function must be used in conjunction with the hal_dma_resume_reg(). More...
hal_pm_status_t | hal_pm_dma_suspend (dma_handle_t *p_dma)
| Suspend the register of the specified DMA channel. More...
void | hal_pm_dma_resume (dma_handle_t *p_dma)
| Resume the register of the specified DMA channel. More...
void | hal_dma_suspend_channel (dma_handle_t *p_dma, uint32_t channel)
| Suspend the register of the specified DMA channel. More...
void | hal_dma_resume_channel (dma_handle_t *p_dma, uint32_t channel)
| Resume the register of the specified DMA channel. More...

## Detailed Description

Peripheral State and Errors functions.

     ===============================================================================
                ##### Peripheral State and Errors functions #####
     ===============================================================================
        [..]
        This subsection provides functions allowing to
          (+) Check the DMA state
          (+) Get error code

## Function Documentation

## ◆ hal_dma_get_error()

uint32_t hal_dma_get_error | ( | dma_handle_t * | p_dma | ) |

Return the DMA error code.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA Channel.

Returns
  DMA Error Code

## ◆ hal_dma_get_state()

hal_dma_state_t hal_dma_get_state | ( | dma_handle_t * | p_dma | ) |

Return the DMA hande state.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA Channel.

Return values

  HAL_DMA_STATE_RESET | DMA not yet initialized or disabled.
  HAL_DMA_STATE_READY | DMA process succeeded and ready for use.
  HAL_DMA_STATE_BUSY | DMA process is ongoing.
  HAL_DMA_STATE_TIMEOUT | DMA timeout state.
  HAL_DMA_STATE_ERROR | DMA error state.

## ◆ hal_dma_resume_channel()

void hal_dma_resume_channel | ( | dma_handle_t * | p_dma,
|  | uint32_t | channel
| ) |  |

Resume the register of the specified DMA channel.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA module.
  [in] | channel | dma channel,can be one of the values of dma_channel_t.

Return values

  ::None |

## ◆ hal_dma_resume_reg()

void hal_dma_resume_reg | ( | dma_handle_t * | p_dma | ) |

Restore some registers related to DMA configuration after sleep. This function must be used in conjunction with the hal_dma_resume_reg().

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_dma_suspend_channel()

void hal_dma_suspend_channel | ( | dma_handle_t * | p_dma,
|  | uint32_t | channel
| ) |  |

Suspend the register of the specified DMA channel.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA module.
  [in] | channel | dma channel,can be one of the values of dma_channel_t.

Return values

  ::None |

## ◆ hal_dma_suspend_reg()

void hal_dma_suspend_reg | ( | dma_handle_t * | p_dma | ) |

Suspend some registers related to DMA configuration before sleep.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_pm_dma_resume()

void hal_pm_dma_resume | ( | dma_handle_t * | p_dma | ) |

Resume the register of the specified DMA channel.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA module.

Return values

  ::None |

## ◆ hal_pm_dma_suspend()

hal_pm_status_t hal_pm_dma_suspend | ( | dma_handle_t * | p_dma | ) |

Suspend the register of the specified DMA channel.

Parameters

  [in] | p_dma | Pointer to a DMA handle which contains the configuration information for the specified DMA module.

Return values

  HAL_PM_ACTIVE | Device is active, not allow sleep.
  HAL_PM_SLEEP | Allow sleep.