Go to the documentation of this file.
25 #ifndef _AROARFW_BYTEORDER_H_
26 #define _AROARFW_BYTEORDER_H_
37 #define RBO_H2NB16(buf, v) ( \
38 ((uint16_t)(((unsigned char*)(buf))[0] = ((uint16_t)(v) >> 8) & 0xFF) << 8) + \
39 (uint16_t)(((unsigned char*)(buf))[1] = (uint16_t)(v) & 0xFF) \
50 #define RBO_NB2H16(buf) ( \
51 ((uint16_t)(((unsigned char*)(buf))[0]) << 8) + \
52 (uint16_t)(((unsigned char*)(buf))[1]) \
64 #define RBO_H2NB32(buf, v) ( \
65 ((uint32_t)(((unsigned char*)(buf))[0] = ((uint32_t)(v) >> 24) & 0xFF) << 24) + \
66 ((uint32_t)(((unsigned char*)(buf))[1] = ((uint32_t)(v) >> 16) & 0xFF) << 16) + \
67 ((uint32_t)(((unsigned char*)(buf))[2] = ((uint32_t)(v) >> 8) & 0xFF) << 8) + \
68 (uint32_t)(((unsigned char*)(buf))[3] = (uint32_t)(v) & 0xFF) \
79 #define RBO_NB2H32(buf) ( \
80 ((uint32_t)(((unsigned char*)(buf))[0]) << 24) + \
81 ((uint32_t)(((unsigned char*)(buf))[1]) << 16) + \
82 ((uint32_t)(((unsigned char*)(buf))[2]) << 8) + \
83 (uint32_t)(((unsigned char*)(buf))[3]) \