2015-08-07 09:13 AM
Hello, I'm using I2S interface of my 411RE uC. I nee to send some int32 (positive and negative number) becouse my codec expect int32 format. But HAL_I2SEx_TransmitReceive_DMA expect unsigned number. So how do I do to send signed integer using that HAL function?
Regards!2015-08-07 09:50 AM
Doesn't it want uint16_t pointers?
Understand that the STM32 hardware doesn't care what the 8-bit bytes represent.You might need to be concerned about the endian/interleaving expectations at the end-points, but as far as the function's concerned cast the pointers, and express the size in units of the expected units. ie an int32_t is going to need 2x uint16_t2015-08-08 06:05 AM
yes, it expect uint16_t pointer.
let me see if I understand. I define a buffer:int16_t OutputBuffer[1000];int16_t InputBuffer[1000];then I cast yhe buffer to uint16_t:HAL_I2SEx_TransmitReceive_DMA(&hi2s2, (uint16_t *)OutputBuffer, (uint16_t *)InputBuffer, BufferSize);that should work ok, right?now in 32 bits:int32_t OutputBuffer[500];int32_t InputBuffer[500];then I cast yhe buffer to uint16_t:HAL_I2SEx_TransmitReceive_DMA(&hi2s2, (uint16_t *)OutputBuffer, (uint16_t *)InputBuffer, BufferSize);is that ok? am I missing something? If I configure Data Frame Format on 32bits data on 32 bits frame the hal driver should make 2 transfer (16 bit each) before toggle WS signal, right?thank clive!