Обновление

This commit is contained in:
cfif 2025-12-16 16:49:05 +03:00
parent 66cd60a4b8
commit 93d1085bb6
2 changed files with 25 additions and 0 deletions

View File

@ -305,6 +305,8 @@ extern "C" {
DMA_StatusType DMA_ModifyAddress(const DMA_InstanceType eDma_Instance, const DMA_ChannelType eChannel,
const volatile void *pSrcBuffer, const volatile void *pDestBuffer);
DMA_StatusType DMA_ModifySize(const DMA_InstanceType eDma_Instance, const DMA_ChannelType eChannel, uint16_t u16LoopCnt);
/**
* @brief Start the DMA channel transfer
*

View File

@ -666,6 +666,29 @@ void DMA_ConfigChainedTransfer(const DMA_InstanceType eDma_Instance, const DMA_C
DMA_HWA_SetOuterLoopTrigChannel(pDma, (uint8_t)eChannel, pChainTransferCfg->u8ChainedChannel);
}
DMA_StatusType DMA_ModifySize(const DMA_InstanceType eDma_Instance, const DMA_ChannelType eChannel, uint16_t u16LoopCnt) {
DEV_ASSERT(eDma_Instance < DMA_INSTANCE_MAX);
DEV_ASSERT(eChannel < DMA_CHANNEL_MAX);
DMA_Type * aDma[] = DMA_BASE_PTRS;
DMA_Type *const pDma = aDma[eDma_Instance];
DMA_StatusType ret;
if (DMA_GetChannelStatus(eDma_Instance, eChannel) == DMA_RUNNING_STATUS_IDLE)
{
DMA_HWA_SetLoopCount(pDma, (uint8_t)eChannel, u16LoopCnt);
ret = DMA_STATUS_SUCCESS;
}
else
{
ret = DMA_STATUS_BUSY;
}
return ret;
}
DMA_StatusType DMA_ModifyAddress(const DMA_InstanceType eDma_Instance, const DMA_ChannelType eChannel,
const volatile void *pSrcBuffer, const volatile void *pDestBuffer)
{