2019-06-01 06:38 PM
I'm using the following code to read from the QUADSPI data register.
(uint8_t) * dptr;
*dptr++ = QUADSPI->DR;
What I get is it reads 4 BYTEs from the FIFO and only returns the lowest Byte in memory pointed to by dptr. The ref manual says you can read Bytes, Half Words, and Words. Also says you have to read just the lowest byte from the DR[31..0] ..
I'm sure it is simple any help appreciated.
Thanks!
2019-06-01 07:37 PM
At the moment it is doing a 32-bit read of DR, if you needed it to read 8 or 16-bit from it you'd need to cast to an appropriate width pointer.
ie
*dptr++ = *((uint8_t *)&QUADSPI->DR);
2019-06-01 10:27 PM
Thank you Sir!
Is there a reference that explains these cast rules by example would be nice.
Thanks again.