#range #bit #extract #register #manipulating #ic #bitrange

no-std simple-bitrange

A simple crate for manipulating bit ranges which is common when working with IC registers

1 unstable release

0.1.3 Jul 22, 2020
0.1.2 Jul 22, 2020
0.1.1 Jul 21, 2020
0.1.0 Jul 20, 2020

#1913 in Data structures

Download history 125/week @ 2023-12-06 233/week @ 2023-12-13 113/week @ 2023-12-20 46/week @ 2023-12-27 158/week @ 2024-01-03 600/week @ 2024-01-10 412/week @ 2024-01-17 259/week @ 2024-01-24 171/week @ 2024-01-31 113/week @ 2024-02-07 60/week @ 2024-02-14 518/week @ 2024-02-21 153/week @ 2024-02-28 271/week @ 2024-03-06 110/week @ 2024-03-13 190/week @ 2024-03-20

785 downloads per month

MIT/Apache

12KB
197 lines

simple-bitrange

Simple manipulation of bit ranges.

Documentation

Change log

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

A simple bit range crate

This crate aims to facilitate the extraction of bits in a small, simple crate. While it does not have as many bells and whistle as many other crates, simplicity is the key here.

Usage examples

Extract bits from slice of bytes:

let y: u32 = 0b00001111_11110000_01010000_00001010;
let p: &[u8] = &y.to_le_bytes();
let ret: u32 = p.range_read_le(..);

assert_eq!(ret, y);

No runtime deps

Features