![]() |
Contiki-NG
|
Files | |
| file | bitrev.c |
| Bit reversal library implementation. | |
| file | bitrev.h |
| Bit reversal library header. | |
Functions | |
| uint8_t | bitrev_byte (uint8_t byte) |
| Reverse the bits in a single byte. | |
| void | bitrev_array (uint8_t *data, size_t len) |
| Reverse bits in all bytes of an array (in-place) | |
| void | bitrev_array_copy (const uint8_t *input, uint8_t *output, size_t len) |
| Reverse bits in all bytes of an array (copy to output) | |
This library provides functions for reversing bits in bytes and byte arrays. It's commonly used by radio drivers for protocol compliance (e.g., 802.15.4g).
| void bitrev_array | ( | uint8_t * | data, |
| size_t | len ) |
Reverse bits in all bytes of an array (in-place)
| data | Pointer to the data array |
| len | Length of the array in bytes |
This function modifies the input array in-place, reversing the bit order within each byte. Commonly used for protocol compliance.
Definition at line 72 of file bitrev.c.
Referenced by read().
| void bitrev_array_copy | ( | const uint8_t * | input, |
| uint8_t * | output, | ||
| size_t | len ) |
Reverse bits in all bytes of an array (copy to output)
| input | Pointer to the input data array |
| output | Pointer to the output data array |
| len | Length of the arrays in bytes |
This function copies data from input to output while reversing the bit order within each byte. Input and output arrays must not overlap.
Definition at line 81 of file bitrev.c.
References input().