My STM32 SDIO+SDCard example’s functions give their result in a 32bit pointer, like: u32 *readbuff.
Now, I want to implement a filesystem library like dosfs or efsl. They all require to have a read/write function wich use a 8 bit pointer, like: u8 *buffer.
Now, is there an easy way to pass/convert one to another, without have to transfer the u32* buffer to another u8*buffer 8bits at a time?
I was looking at something like “u8 *buffer8 = (u8 *) buffer32” …
If you aren’t using anything that is outside a U8 range, then you can just cast it to a U8. Just be careful with sequential read, it may skip 32 bits at a time, so you might have to create a new U8 that points to the U32 and read 4 bytes out of it then call the library read again.