Question
Reading 16 bit word with SPI
I have declared the following variable:
uint16_t SPIRx;
If I use this line to read SPI data, the compiler doesn't throw warnings:
HAL_SPI_Receive(&hspi1, (uint8_t *)&SPIRx, 2, 500);
But if I say:
HAL_SPI_Receive(&hspi1, (uint16_t *)&SPIRx, 1, 500);
It throws a warning because the pointer should be 8 bit.
What is the right way to use the SPI Receive module to read a 16 bit word?
