mil_std_1553b 0.2.0

MIL STD 1553B message parsing and types
Documentation

MIL STD 1553B

tests passing docs passing

This library implements a complete set of Rust structs for parsing or constructing messages that comply with the MIL STD 1553B communication protocal.

Features

The following features make this library useable in constrained embedded systems for government, commercial, or military projects that can't have virally licensed dependencies.

  • Does not use the standard library (no_std).
  • Does not allocate dynamic memory.
  • Has no dependencies.
  • MIT licensed.

Usage

Creating a message

    use mil_std_1553b::*;

    let mut message = Message::new();

    let mut command = CommandWord::new(0b0001100001100010);
    assert_eq!(command.count(),2);

    message.add_command(command);
    assert_eq!(message.data_count(),0);
    assert_eq!(message.data_expected(),2);

    // add two data words
    message.add_data(DataWord::new(0b0110100001101001)).unwrap();
    message.add_data(DataWord::new(0b0110100001101001)).unwrap();

    assert!(message.is_full());
    assert_eq!(message.word_count(),3);

Words

A "word" in the 1553B standard is made up of twenty bits, total. Three sync bits, 16 bits of data (in one of three different formats), and a trailing parity bit. This means that there are two ways of referencing a particular bit- either with a bit index offset from the beginning of the word data or as a "bit time" offset from the beginning of the word, including the sync bits.

Index Sync1 Sync2 Sync3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Parity
Time - - - 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 -
Offset - - - 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -

The bit-time reference is used in the standard, but because we're only dealing with the 16-bit data from each word in this project we'll be using a zero-indexed reference in the actual code.

References