Functions |
static uint8_t | BitReverse (uint8_t Byte) ATTR_WARN_UNUSED_RESULT ATTR_CONST |
static uint16_t | SwapEndian_16 (uint16_t Word) ATTR_WARN_UNUSED_RESULT ATTR_CONST |
static uint32_t | SwapEndian_32 (uint32_t DWord) ATTR_WARN_UNUSED_RESULT ATTR_CONST |
static void | SwapEndian_n (void *Data, uint8_t Bytes) |
Detailed Description
Functions for swapping endianness and reversing bit orders.
Function Documentation
static uint8_t BitReverse |
( |
uint8_t |
Byte |
) |
[inline, static] |
Function to reverse the individual bits in a byte - i.e. bit 7 is moved to bit 0, bit 6 to bit 1, etc.
- Parameters:
-
[in] | Byte | Byte of data whose bits are to be reversed |
static uint16_t SwapEndian_16 |
( |
uint16_t |
Word |
) |
[inline, static] |
Function to reverse the byte ordering of the individual bytes in a 16 bit number.
- Parameters:
-
[in] | Word | Word of data whose bytes are to be swapped |
static uint32_t SwapEndian_32 |
( |
uint32_t |
DWord |
) |
[inline, static] |
Function to reverse the byte ordering of the individual bytes in a 32 bit number.
- Parameters:
-
[in] | DWord | Double word of data whose bytes are to be swapped |
static void SwapEndian_n |
( |
void * |
Data, |
|
|
uint8_t |
Bytes | |
|
) |
| | [inline, static] |
Function to reverse the byte ordering of the individual bytes in a n byte number.
- Parameters:
-
[in,out] | Data | Pointer to a number containing an even number of bytes to be reversed |
[in] | Bytes | Length of the data in bytes |