Expand description
A crate to help with bit manipulation of integers.
Naming Conventions
- The
bit
function work on a single bit. - The
region
functions work on multiple adjacent bits. - The
value
functions are like aregion
but the value is automatically shifted down on read and up on write so that you can input/output normal values and the function will put it in place for you. get
reads a value.with
returns a new value.
Structs
An iterator that will give out bit groups from within an integer.
An iterator that will give out bit groups from within an integer.
An iterator that will give out bit groups from within an integer.
An iterator that will give out bit groups from within an integer.
An iterator that will give out bit groups from within an integer.
Two u8
values packed as a u16
.
Functions
Determines if the b
bit is set in u
.
Get the low
to high
bit region of u
.
Get the low
to high
bit region of u
, down shifted by low
.
Generates a bit mask where all bits in the region are 1.
Replicates the low count
bits across the entire value.
Replaces the b
bit in u
.
Replaces the low
to high
bit region of old
.
Replaces the low
to high
bit region of old
with an input up shifted by low
.
Determines if the b
bit is set in u
.
Get the low
to high
bit region of u
.
Get the low
to high
bit region of u
, down shifted by low
.
Generates a bit mask where all bits in the region are 1.
Replicates the low count
bits across the entire value.
Replaces the b
bit in u
.
Replaces the low
to high
bit region of old
.
Replaces the low
to high
bit region of old
with an input up shifted by low
.
Determines if the b
bit is set in u
.
Get the low
to high
bit region of u
.
Get the low
to high
bit region of u
, down shifted by low
.
Generates a bit mask where all bits in the region are 1.
Replicates the low count
bits across the entire value.
Replaces the b
bit in u
.
Replaces the low
to high
bit region of old
.
Replaces the low
to high
bit region of old
with an input up shifted by low
.
Determines if the b
bit is set in u
.
Get the low
to high
bit region of u
.
Get the low
to high
bit region of u
, down shifted by low
.
Generates a bit mask where all bits in the region are 1.
Replicates the low count
bits across the entire value.
Replaces the b
bit in u
.
Replaces the low
to high
bit region of old
.
Replaces the low
to high
bit region of old
with an input up shifted by low
.
Determines if the b
bit is set in u
.
Get the low
to high
bit region of u
.
Get the low
to high
bit region of u
, down shifted by low
.
Generates a bit mask where all bits in the region are 1.
Replicates the low count
bits across the entire value.
Replaces the b
bit in u
.
Replaces the low
to high
bit region of old
.
Replaces the low
to high
bit region of old
with an input up shifted by low
.