2020-09-26 04:12 PM
Hello,
In Section 36. I2S Generic Driver of HAL document (UM1725), I found an incorrect or misleading explanation.
In the explanation of HAL_I2S_Transmit, there is a "notes" below.
-----------------
HAL_I2S_Transmit (I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size, uint32_t Timeout)
Notes: When a 16-bit data frame or a 16-bit data frame extended is selected during the I2S configuration phase, the Size parameter means the number of 16-bit data length in the transaction
and when a 24-bit data frame or a 32-bit data
frame is selected the Size parameter means the number of 16-bit data length.
-----------------
(Same explanation is shown many times in the source code of stm32f4xx_hal_i2s.c.)
However, Code is implemented as below.
if ((tmpreg_cfgr == I2S_DATAFORMAT_24B) || (tmpreg_cfgr == I2S_DATAFORMAT_32B))
{
hi2s->TxXferSize = (Size << 1U);
hi2s->TxXferCount = (Size << 1U);
}
else
{
hi2s->TxXferSize = Size;
hi2s->TxXferCount = Size;
}
That means,
when a 24-bit data frame or a 32-bit data
frame is selected the Size parameter means the number of 16-bit 24/32-bit data length. (or the number of 24/32-bit data)
Original explanation is incorrect or misleading for the beginner like me, please consider to change as above.
Thanks,
2020-09-29 06:20 AM
Hello,
I have raised your feedback internally to take into consideration.
Imen
2020-09-29 01:59 PM
Dear Imen,
Many Thanks for your kind reply.
And please convey my appreciation for the great effort of HAL team.
K.A.
2020-09-30 02:56 AM
Hello @KAJIK.1,
Thanks
You are welcome.
2020-11-09 03:00 AM
Hi all,
I've a different question on the same topic: what does "length in transaction" mean?
Thanks
L.F.
2020-11-09 04:25 AM
"number of 16-bit data length in the transaction" supposedly means "number of data, 16-bit long, in the transaction".
I am not native English speaker either...
JW