73 #ifndef __XBEE_ENDIAN_H 74 #define __XBEE_ENDIAN_H 103 void _swapcpy(
void FAR *dst,
const void FAR *src, uint_fast8_t count);
105 #if BYTE_ORDER == LITTLE_ENDIAN 106 #define memcpy_letoh( dst, src_le, count) _f_memcpy( dst, src_le, count) 107 #define memcpy_htole( dst_le, src, count) _f_memcpy( dst_le, src, count) 109 #define memcpy_betoh( dst, src_be, count) _swapcpy( dst, src_be, count) 110 #define memcpy_htobe( dst_be, src, count) _swapcpy( dst_be, src, count) 112 #define memcpy_letoh( dst, src_le, count) _swapcpy( dst, src_le, count) 113 #define memcpy_htole( dst_le, src, count) _swapcpy( dst_le, src, count) 115 #define memcpy_betoh( dst, src_be, count) _f_memcpy( dst, src_be, count) 116 #define memcpy_htobe( dst_be, src, count) _f_memcpy( dst_be, src, count) 119 #define memcpy_betole( dst_le, src_be, count) \ 120 _swapcpy( dst_le, src_be, count) 121 #define memcpy_letobe( dst_be, src_le, count) \ 122 _swapcpy( dst_be, src_le, count) 126 #if BYTE_ORDER == LITTLE_ENDIAN 128 #define htobe16(x) swap16(x) 129 #define htobe32(x) swap32(x) 132 #define be16toh(x) swap16(x) 133 #define be32toh(x) swap32(x) 136 #define htole16(x) (x) 137 #define htole32(x) (x) 140 #define le16toh(x) (x) 141 #define le32toh(x) (x) 144 #define htole16(x) swap16(x) 145 #define htole32(x) swap32(x) 148 #define le16toh(x) swap16(x) 149 #define le32toh(x) swap32(x) 152 #define htobe16(x) (x) 153 #define htobe32(x) (x) 156 #define be16toh(x) (x) 157 #define be32toh(x) (x) unsigned long uint32_t
32-bit unsigned integer
Definition: platform_config.h:43
#define FAR
On platforms with "far" pointers, define to the proper keyword; empty definition if not required...
Definition: platform.h:396
#define XBEE_BEGIN_DECLS
Macro defined to.
Definition: platform.h:41
uint16_t swap16(uint16_t value)
Swap the byte order of a 16-bit value.
Definition: swapbytes.c:47
unsigned short uint16_t
16-bit unsigned integer
Definition: platform_config.h:41
void _swapcpy(void FAR *dst, const void FAR *src, uint_fast8_t count)
Function similar to memcpy() but reverses byte order during copy. Copy count from src to dst while re...
Definition: swapcpy.c:24
#define XBEE_END_DECLS
Macro defined to.
Definition: platform.h:42
uint32_t swap32(uint32_t value)
Swap the byte order of a 32-bit value.
Definition: swapbytes.c:33