cancel
Showing results for 
Search instead for 
Did you mean: 

Datasize SPI

Kewin_J
Associate II

Hello,

I’ve configured SPI in CubeMX with DataSize = 12 bits. However, when I use the HAL function HAL_SPI_Transmit, the pData argument seems to require a uint16_t (or at least 16-bit aligned) buffer.

I'm a bit confused about how this works in practice. Since I'm sending a 16-bit word, but only configured 12-bit frames, does the SPI peripheral transmit just the lower 12 bits of each word? Or do I need to pack the 12-bit values differently?

I'm still fairly new to STM32 development, so I appreciate any clarification you can offer!

Best regards,
Kewin

1 ACCEPTED SOLUTION

Accepted Solutions
Kewin_J
Associate II

Solved after reviewing the declaration again. I just misunderstood something. :))

 

View solution in original post

1 REPLY 1
Kewin_J
Associate II

Solved after reviewing the declaration again. I just misunderstood something. :))