cancel
Showing results for 
Search instead for 
Did you mean: 

SPI data transmission

Bs.1
Associate II

Using STM32f3xxx series & using SPI2.

I wanted to transmit 32 bits data at atime, but in API

HAL_StatusTypeDef HAL_SPI_Transmit(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size, uint32_t Timeout) 

pData is fo r uint8_t.

how to transmit uint32?

2 REPLIES 2

hello

uint32_t myData;

if SPI initialized as 8 bit , HAL_SPI_Transmit(&hspi, (uint8_t*)&myData, 4,Timeout) ;

if SPI initialized as 16 bit , HAL_SPI_Transmit(&hspi, (uint8_t*)&myData, 2, Timeout) ;

Bs.1
Associate II

Thanks for the reply.​