Bit sets stored in byte or word arrays, rotation and bit reversal.
More...
|
| static void | pbl_bitset8_set (uint8_t *bitset, unsigned int index) |
| | Set a bit in a byte-array bit set.
|
| |
| static void | pbl_bitset8_clear (uint8_t *bitset, unsigned int index) |
| | Clear a bit in a byte-array bit set.
|
| |
| static void | pbl_bitset8_update (uint8_t *bitset, unsigned int index, bool value) |
| | Set or clear a bit in a byte-array bit set.
|
| |
| static bool | pbl_bitset8_get (const uint8_t *bitset, unsigned int index) |
| | Test a bit in a byte-array bit set.
|
| |
| static void | pbl_bitset32_set (uint32_t *bitset, unsigned int index) |
| | Set a bit in a word-array bit set.
|
| |
| static void | pbl_bitset32_clear (uint32_t *bitset, unsigned int index) |
| | Clear a bit in a word-array bit set.
|
| |
| static void | pbl_bitset32_update (uint32_t *bitset, unsigned int index, bool value) |
| | Set or clear a bit in a word-array bit set.
|
| |
| static bool | pbl_bitset32_get (const uint32_t *bitset, unsigned int index) |
| | Test a bit in a word-array bit set.
|
| |
| static uint32_t | pbl_rotl32 (uint32_t x, unsigned int shift) |
| | Rotate a 32-bit value left.
|
| |
| static uint8_t | pbl_bitrev8 (uint8_t v) |
| | Reverse the bit order of a byte.
|
| |
Bit sets stored in byte or word arrays, rotation and bit reversal.
Bit index of a bit set lives in element index / width, at bit index % width. No bounds checking is done.
uint32_t active[2] = {0};
...
}
static bool pbl_bitset32_get(const uint32_t *bitset, unsigned int index)
Test a bit in a word-array bit set.
Definition bitops.h:116
static void pbl_bitset32_set(uint32_t *bitset, unsigned int index)
Set a bit in a word-array bit set.
Definition bitops.h:80
◆ pbl_bitrev8()
| static uint8_t pbl_bitrev8 |
( |
uint8_t |
v | ) |
|
|
inlinestatic |
Reverse the bit order of a byte.
- Parameters
-
- Returns
v with bit 0 swapped with bit 7, bit 1 with bit 6, and so on.
◆ pbl_bitset32_clear()
| static void pbl_bitset32_clear |
( |
uint32_t * |
bitset, |
|
|
unsigned int |
index |
|
) |
| |
|
inlinestatic |
Clear a bit in a word-array bit set.
- Parameters
-
| bitset | Bit set. |
| index | Bit index. |
Referenced by pbl_bitset32_update().
◆ pbl_bitset32_get()
| static bool pbl_bitset32_get |
( |
const uint32_t * |
bitset, |
|
|
unsigned int |
index |
|
) |
| |
|
inlinestatic |
Test a bit in a word-array bit set.
- Parameters
-
| bitset | Bit set. |
| index | Bit index. |
- Returns
- Value of the bit.
◆ pbl_bitset32_set()
| static void pbl_bitset32_set |
( |
uint32_t * |
bitset, |
|
|
unsigned int |
index |
|
) |
| |
|
inlinestatic |
Set a bit in a word-array bit set.
- Parameters
-
| bitset | Bit set. |
| index | Bit index. |
Referenced by pbl_bitset32_update().
◆ pbl_bitset32_update()
| static void pbl_bitset32_update |
( |
uint32_t * |
bitset, |
|
|
unsigned int |
index, |
|
|
bool |
value |
|
) |
| |
|
inlinestatic |
◆ pbl_bitset8_clear()
| static void pbl_bitset8_clear |
( |
uint8_t * |
bitset, |
|
|
unsigned int |
index |
|
) |
| |
|
inlinestatic |
Clear a bit in a byte-array bit set.
- Parameters
-
| bitset | Bit set. |
| index | Bit index. |
Referenced by pbl_bitset8_update().
◆ pbl_bitset8_get()
| static bool pbl_bitset8_get |
( |
const uint8_t * |
bitset, |
|
|
unsigned int |
index |
|
) |
| |
|
inlinestatic |
Test a bit in a byte-array bit set.
- Parameters
-
| bitset | Bit set. |
| index | Bit index. |
- Returns
- Value of the bit.
◆ pbl_bitset8_set()
| static void pbl_bitset8_set |
( |
uint8_t * |
bitset, |
|
|
unsigned int |
index |
|
) |
| |
|
inlinestatic |
Set a bit in a byte-array bit set.
- Parameters
-
| bitset | Bit set. |
| index | Bit index. |
Referenced by pbl_bitset8_update().
◆ pbl_bitset8_update()
| static void pbl_bitset8_update |
( |
uint8_t * |
bitset, |
|
|
unsigned int |
index, |
|
|
bool |
value |
|
) |
| |
|
inlinestatic |
◆ pbl_rotl32()
| static uint32_t pbl_rotl32 |
( |
uint32_t |
x, |
|
|
unsigned int |
shift |
|
) |
| |
|
inlinestatic |
Rotate a 32-bit value left.
- Parameters
-
| x | Value to rotate. |
| shift | Number of bits, taken modulo 32. |
- Returns
- Rotated value.