SAI1 interface receive parameter?

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

SAI1 interface receive parameter?

Post by Bambo »

Hi,

When using the SAI protocol i'm not sure what parameter to pass as Size for the HAL_SAI_Receive() function?

I posted a thread here but doesn't anyone know?

https://community.st.com/s/question/0D5 ... -parameter
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: SAI1 interface receive parameter?

Post by fpiSTM »

Maybe this could help:
UM1884: Description of STM32L4/L4+ HAL and low-layer drivers

STM32L4-Peripheral-Serial-Audio-Interface(SAI)

I never use it anyway, I guess this should be size of what you expect (at least the size of your allocated buffer)
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

Re: SAI1 interface receive parameter?

Post by Bambo »

Yeah i've read these resources, its just that the parameter Size isn't documented anywhere, and i can't find documentation for hsai->XferSize or hsai->XferCount either so i'm sorta guessing here.

Looking at the source, i think it depends on your data size as to how the HAL_SAI_Receive() behaves because if you use a datasize of 1 byte, Size is the number of bytes to read, however, when its 32bit its the number of 32bit blocks to read.

It's annoying that they haven't documented this feature as fully as the others because it's the only way to interface with serious audio components!
Post Reply

Return to “General discussion”