ham 0.2.0

A crate with interfaces for small packet radios, with an implementation for RFM69.
Documentation
use crate::rfm69::Bw;

#[test]
fn bw() {
    let a = Bw(0);
    let test_vals = [
        (23_u8, 2604_u32),
        (15, 2605),
        (15, 3125),
        (7, 3126),
        (7, 3906),
        (22, 3907),
        (22, 5208),
        (14, 5209),
        (14, 6250),
        (6, 6251),
        (6, 7812),
        (21, 7813),
        (21, 10416),
        (13, 10417),
        (13, 12500),
        (5, 12501),
        (5, 15625),
        (20, 15626),
        (20, 20833),
        (12, 20834),
        (12, 25000),
        (4, 25001),
        (4, 31250),
        (19, 31251),
        (19, 41_666),
        (11, 41_667),
        (11, 50_000),
        (3, 50_001),
        (3, 62_500),
        (18, 62_501),
        (18, 83_333),
        (10, 83_334),
        (10, 100_000),
        (2, 100_001),
        (2, 125_000),
        (17, 125_001),
        (17, 166_666),
        (9, 166_667),
        (9, 200_000),
        (1, 200_001),
        (1, 250_000),
        (16, 250_001),
        (16, 333_333),
        (8, 333_334),
        (8, 400_000),
        (0, 400_001),
        (0, 500_000),
    ];
    for (i, (tar, bw)) in test_vals.iter().enumerate() {
        let out = a.set_bw_fsk(*bw);
        assert_eq!(Bw(*tar), out);
        if i % 2 == 0 {
            assert_eq!(*bw, out.bw_fsk());
        }
    }
}