imxrt:edma Add idle chack

This commit is contained in:
David Sidrane 2023-11-21 10:36:17 -08:00 committed by Xiang Xiao
parent cc632ea789
commit a81b36394e
2 changed files with 32 additions and 0 deletions

View File

@ -1273,6 +1273,24 @@ unsigned int imxrt_dmach_getcount(DMACH_HANDLE handle)
return remaining;
}
/****************************************************************************
* Name: imxrt_dmach_idle
*
* Description:
* This function checks if the dma is idle
*
* Returned Value:
* 0 - if idle
* !0 - not
*
****************************************************************************/
unsigned int imxrt_dmach_idle(DMACH_HANDLE handle)
{
struct imxrt_dmach_s *dmach = (struct imxrt_dmach_s *)handle;
return dmach->state == IMXRT_DMA_IDLE ? 0 : -1;
}
/****************************************************************************
* Name: imxrt_dmasample
*

View File

@ -411,6 +411,20 @@ void imxrt_dmach_stop(DMACH_HANDLE handle);
unsigned int imxrt_dmach_getcount(DMACH_HANDLE handle);
/****************************************************************************
* Name: imxrt_dmach_idle
*
* Description:
* This function checks if the dma is idle
*
* Returned Value:
* 0 - if idle
* !0 - not
*
****************************************************************************/
unsigned int imxrt_dmach_idle(DMACH_HANDLE handle);
/****************************************************************************
* Name: imxrt_dmasample
*