The purpose of the 'if ((hspi->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST)' in STM32U5 SPI transfer with DMA APIs
Hi,
I'm trying to combine the SPI and GPDMA on STM32U5. In the various SPI transfer APIs with suffix '_DMA', I can see the code below:
/* Enable the Tx DMA Stream/Channel */
if ((hspi->hdmatx->Mode & DMA_LINKEDLIST) == DMA_LINKEDLIST)
{
if (hspi->hdmatx->LinkedListQueue != NULL)
{
/* Set DMA data size */
hspi->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CBR1_DEFAULT_OFFSET] = hspi->TxXferCount;
/* Set DMA source address */
hspi->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CSAR_DEFAULT_OFFSET] = (uint32_t)hspi->pTxBuffPtr;
/* Set DMA destination address */
hspi->hdmatx->LinkedListQueue->Head->LinkRegisters[NODE_CDAR_DEFAULT_OFFSET] = (uint32_t)&hspi->Instance->TXDR;
status = HAL_DMAEx_List_Start_IT(hspi->hdmatx);
}
else
{
status = HAL_ERROR;
}
}
else
{
status = HAL_DMA_Start_IT(hspi->hdmatx, (uint32_t)hspi->pTxBuffPtr, (uint32_t)&hspi->Instance->TXDR,
hspi->TxXferCount);
}It seems the code try to support the 'DMA_LINKEDLIST' mode. But can't find a way to set it to 'DMA_LINKEDLIST' in the .ioc file. So, how ST expect us to use this mode?
Thanks.
