Peripheral State and Errors 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...
 
hal_status_t hal_dma_suspend_reg (dma_handle_t *p_dma)
 Suspend some registers related to DMA configuration before sleep. More...
 
hal_status_t 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...
 
void dma_set_renew_flag (dma_handle_t *p_dma)
 set the flag if DMAn has been used before sleep More...
 
void dma_resume_before_using (dma_handle_t *p_dma, bool init_flag)
 resume dma regs before using if just waked up from sleep /only need to clear sleep_flag if on initial or deinitial state. 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

◆ dma_resume_before_using()

void dma_resume_before_using ( dma_handle_t p_dma,
bool  init_flag 
)

resume dma regs before using if just waked up from sleep /only need to clear sleep_flag if on initial or deinitial state.

Parameters
[in]p_dmaPointer to a DMA handle which contains the configuration information for the specified DMA module.
[in]init_flagtrue: use in init function or deinit function fault: not use in init function or deinit function
Return values
::None

◆ dma_set_renew_flag()

void dma_set_renew_flag ( dma_handle_t p_dma)

set the flag if DMAn has been used before sleep

Parameters
[in]p_dmaPointer to a DMA handle which contains the configuration information for the specified DMA module.
Return values
::None

◆ hal_dma_get_error()

uint32_t hal_dma_get_error ( dma_handle_t p_dma)

Return the DMA error code.

Parameters
[in]p_dmaPointer 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_dmaPointer to a DMA handle which contains the configuration information for the specified DMA Channel.
Return values
HAL_DMA_STATE_RESETDMA not yet initialized or disabled.
HAL_DMA_STATE_READYDMA process succeeded and ready for use.
HAL_DMA_STATE_BUSYDMA process is ongoing.
HAL_DMA_STATE_TIMEOUTDMA timeout state.
HAL_DMA_STATE_ERRORDMA error state.

◆ hal_dma_resume_reg()

hal_status_t 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_dmaPointer to a DMA handle which contains the configuration information for the specified DMA module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_dma_suspend_reg()

hal_status_t hal_dma_suspend_reg ( dma_handle_t p_dma)

Suspend some registers related to DMA configuration before sleep.

Parameters
[in]p_dmaPointer to a DMA handle which contains the configuration information for the specified DMA module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.