So, I am using the HAL from STM32 so I can talk SPI to a device.
I have to send a 24 bit word, but the HAL only supports 8 bit transfers.
HAL_SPI_Transmit(&hspi1, &transferValue, num_of_bytes, HAL_MAX_DELAY);
Normally, I would just mask and split the values into three variables and just transfer each new variable one byte at a time. However, there has to be a better way.
is it possible to just point to my 24 bit (or 32 bit) variable so I can have the HAL just increment my pointer?
For example:
uint32_t *32bitValue;
HAL_SPI_Transmit(&hspi1, &32bitValue, 3, HAL_MAX_DELAY);
I tried this, but now my SPI device only partially works. How would I go about just pointing to the 8 bits of the address or am I just not understanding this?
I have to send a 24 bit word, but the HAL only supports 8 bit transfers.
HAL_SPI_Transmit(&hspi1, &transferValue, num_of_bytes, HAL_MAX_DELAY);
Normally, I would just mask and split the values into three variables and just transfer each new variable one byte at a time. However, there has to be a better way.
is it possible to just point to my 24 bit (or 32 bit) variable so I can have the HAL just increment my pointer?
For example:
uint32_t *32bitValue;
HAL_SPI_Transmit(&hspi1, &32bitValue, 3, HAL_MAX_DELAY);
I tried this, but now my SPI device only partially works. How would I go about just pointing to the 8 bits of the address or am I just not understanding this?