cancel
Showing results for 
Search instead for 
Did you mean: 

How to recover continuous data with DMA ?

DYann.1
Senior

Hello,

I have a program that works in DMA but I would like to put a function to know when the transfer in the DMA is finished so that I can recover the data continuously. Do you have any information on this ? Here is part of my code

 

  HAL_SAI_RegisterCallback(&hsai_BlockA1, HAL_SAI_RX_HALFCOMPLETE_CB_ID, HAL_SAI_RxHalfCpltCallback);
  HAL_SAI_RegisterCallback(&hsai_BlockA1, HAL_SAI_RX_COMPLETE_CB_ID, HAL_SAI_RxCpltCallback);
  fresult= HAL_SAI_Init(&hsai_BlockA1);
  if (fresult != HAL_OK)
  	{
  	return HAL_ERROR;
  	}

  HAL_SAI_RegisterCallback(&hsai_BlockB1, HAL_SAI_TX_HALFCOMPLETE_CB_ID, HAL_SAI_TxHalfCpltCallback);
  HAL_SAI_RegisterCallback(&hsai_BlockB1, HAL_SAI_TX_COMPLETE_CB_ID, HAL_SAI_TxCpltCallback);
  fresult= HAL_SAI_Init(&hsai_BlockB1);
  if (fresult != HAL_OK)
	{
  	return HAL_ERROR;
	}
  fresult = HAL_SAI_Receive_DMA(&hsai_BlockA1, (uint8_t *)playbuf_RX, (sizeof(playbuf_RX))/4);
  if (fresult != HAL_OK)
  	{
  	return HAL_ERROR;
  	}
  fresult = HAL_SAI_Transmit_DMA(&hsai_BlockB1, (uint8_t *)playbuf , (sizeof(playbuf))/4);
  if (fresult != HAL_OK)
  	{
  	return HAL_ERROR;
  	}

 

Thanks in advance

11 REPLIES 11

Another entitled brat.  Thanks, Generation Arduino!


@David Littell wrote:

Another entitled brat.  Thanks, Generation Arduino!


We talk about everything except the subject. You deserve to be the KING my friend ! Not the Senior III.