Skip to main content
Explorer
October 27, 2023
Question

SAI witH CODEC SGTL5000

  • October 27, 2023
  • 1 reply
  • 1488 views

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

    This topic has been closed for replies.

    1 reply

    DYann.1Author
    Explorer
    October 27, 2023

    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 ?