How to combine four uint8_t to make a uint32_t? | Cypress Semiconductor
How to combine four uint8_t to make a uint32_t?
It seems very simple but I cannot combine four uint8_t and make uint32_t conventionally or even using the predefined function: "CY_U3P_MAKEDWORD". The result is always the least significant byte:
uint8_t byte4, byte3, byte2, byte1;
byte4 (MSB) = 0xFE; byte3 = 0x56; byte2 = 0x78; byte1 (LSB) = 0x1F;
readDataDW = CY_U3P_MAKEDWORD(byte4, byte3, byte2, byte1);
The result is
readDataDW = 0x1F 0x1F 0x1F 0x1F