Endian conversion functions.
| Include: | #include <dmsdk/dlib/endian.h> |
| FUNCTIONS | |
|---|---|
| uint16_t EndianSwap16 (uint16_t x) | swap bytes in a 16-bit value |
| uint32_t EndianSwap32 (uint32_t x) | swap bytes in a 32-bit value |
| uint64_t EndianSwap64 (uint64_t x) | swap bytes in a 64-bit value |
| uint16_t EndianToHost16 (uint16_t x) | convert a 16-bit network value to host byte order |
| uint32_t EndianToHost32 (uint32_t x) | convert a 32-bit network value to host byte order |
| uint64_t EndianToHost64 (uint64_t x) | convert a 64-bit network value to host byte order |
| uint16_t EndianToNetwork16 (uint16_t x) | convert a 16-bit host value to network byte order |
| uint32_t EndianToNetwork32 (uint32_t x) | convert a 32-bit host value to network byte order |
| uint64_t EndianToNetwork64 (uint64_t x) | convert a 64-bit host value to network byte order |
uint16_t EndianSwap16(uint16_t x)
swap bytes in a 16-bit value
PARAMETERS
uint16_t |
x |
Value to byte swap |
RETURNS
uint16_t |
Byte-swapped value |
uint32_t EndianSwap32(uint32_t x)
swap bytes in a 32-bit value
PARAMETERS
uint32_t |
x |
Value to byte swap |
RETURNS
uint32_t |
Byte-swapped value |
uint64_t EndianSwap64(uint64_t x)
swap bytes in a 64-bit value
PARAMETERS
uint64_t |
x |
Value to byte swap |
RETURNS
uint64_t |
Byte-swapped value |
uint16_t EndianToHost16(uint16_t x)
Network byte order is big-endian.
PARAMETERS
uint16_t |
x |
Network-order (big-endian) value |
RETURNS
uint16_t |
Host-order value |
uint32_t EndianToHost32(uint32_t x)
Network byte order is big-endian.
PARAMETERS
uint32_t |
x |
Network-order (big-endian) value |
RETURNS
uint32_t |
Host-order value |
uint64_t EndianToHost64(uint64_t x)
Network byte order is big-endian.
PARAMETERS
uint64_t |
x |
Network-order (big-endian) value |
RETURNS
uint64_t |
Host-order value |
uint16_t EndianToNetwork16(uint16_t x)
Network byte order is big-endian.
PARAMETERS
uint16_t |
x |
Host-order value |
RETURNS
uint16_t |
Network-order (big-endian) value |
uint32_t EndianToNetwork32(uint32_t x)
Network byte order is big-endian.
PARAMETERS
uint32_t |
x |
Host-order value |
RETURNS
uint32_t |
Network-order (big-endian) value |