Skip to main content
RMull.2
Visitor II
Jul 22, 2020 6:02 AM UTC
Question

How to send 32 bit data on HAL_SPI_Transmit

I want to send

uint32_t spiData1 = 0x48240000;

using HAL_SPI_Transmit func but I'm unable to send this data.

How can I do the following thing.

This topic has been closed for replies.

2 replies

TDK
Jul 22, 2020 12:51 PM UTC

Include your STM32 chip number in your post.

In general, you send it as 4 separate bytes using any of the HAL_SPI_Transmit functions.

HAL_SPI_Transmit(&hspi1, (uint8_t *) &spiData1, 4, 0xFFFF);

"If you feel a post has answered your question, please click ""Accept as Solution""."
S.Ma
Principal
Jul 22, 2020 4:13 PM UTC

newer spi ips have 32bit fifo so the 16 bit data register will accept 2 x 16 bit writes as fast as you can. go under the hal hood to see what it does.