I am using the STM32F407VG and PmodI2S2 to transfer 24-bit audio. For the most part I have followed this tutorial. So far everything works and I have audio throughput and the ability to manipulate it.
In order to understand better the underlying code, I want to understand the following:
In I2S2 > Parameter Settings > Data and Frame Format I have setup 24 bits Data on 32 Bits Frame and in DMA Settings > I2S2_EXT_RX and SPI2_TX I have Data Width set to Half Word. Currently I am receiving 16-bit data which I then restructure into a 32-bit int variable. Would it be possible to receive 32-bit data directly by selecting a data width of Word? I'm a bit confused about this as the method to setup the DMA (HAL_I2SEx_TransmitReceive_DMA) only accepts pointers to a uint16_t even after selecting a data width of word.
If I2S2 > DMA Settings has two DMA requests (I2S2_EXT_RX and SPI2_TX), does this mean that the callbacks 'HAL_I2SEx_TxRxHalfCpltCallback' and 'HAL_I2SEx_TxRxCpltCallback' are called on both Tx and Rx interrupts? My concern here is that the incoming samples would then be processed twice.
Thanks