I have an array uint8_t data[256]
. But each element is single byte.
My data bus is 32 bit long. So, If I want to access 32 bits, I do:
DATA = data[i] + (data[i + 1] << 8) + (data[i + 2] << 16) + (data[i + 3] << 24);
But this translates into 4 separate read requests in the memory of one byte each.
How can I access all the 4 bytes in the form of single transaction?