cancel
Showing results for 
Search instead for 
Did you mean: 

SAI witH CODEC SGTL5000

DYann.1
Senior II

Hello,

I would like to know how to recover acquisition data ​​and save the data to an SD card. I have this configuration

DYann1_0-1698393813776.png

I can compile and communicate with I2C to configure the SGTL5000 CODEC, I enabled DMA too. No errors for this moments.

Thank you for your helps.

Regards

1 REPLY 1
DYann.1
Senior II

I have this code below but I don't know how does it work ?

  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_Transmit_DMA(&hsai_BlockB1, (uint8_t *)playbuf , (sizeof(playbuf))/4);

Do you have a idea how to get the acquisition values ?