Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _AROARFW_BYTEORDER_H_
00026 #define _AROARFW_BYTEORDER_H_
00027
00037 #define RBO_H2NB16(buf, v) ( \
00038 ((uint16_t)(((unsigned char*)(buf))[0] = ((uint16_t)(v) >> 8) & 0xFF) << 8) + \
00039 (uint16_t)(((unsigned char*)(buf))[1] = (uint16_t)(v) & 0xFF) \
00040 )
00041
00050 #define RBO_NB2H16(buf) ( \
00051 ((uint16_t)(((unsigned char*)(buf))[0]) << 8) + \
00052 (uint16_t)(((unsigned char*)(buf))[1]) \
00053 )
00054
00064 #define RBO_H2NB32(buf, v) ( \
00065 ((uint32_t)(((unsigned char*)(buf))[0] = ((uint32_t)(v) >> 24) & 0xFF) << 24) + \
00066 ((uint32_t)(((unsigned char*)(buf))[1] = ((uint32_t)(v) >> 16) & 0xFF) << 16) + \
00067 ((uint32_t)(((unsigned char*)(buf))[2] = ((uint32_t)(v) >> 8) & 0xFF) << 8) + \
00068 (uint32_t)(((unsigned char*)(buf))[3] = (uint32_t)(v) & 0xFF) \
00069 )
00070
00079 #define RBO_NB2H32(buf) ( \
00080 ((uint32_t)(((unsigned char*)(buf))[0]) << 24) + \
00081 ((uint32_t)(((unsigned char*)(buf))[1]) << 16) + \
00082 ((uint32_t)(((unsigned char*)(buf))[2]) << 8) + \
00083 (uint32_t)(((unsigned char*)(buf))[3]) \
00084 )
00085
00086 #endif
00087
00088