lfsr_base/lib.rs
1#![no_std]
2
3/// An object-safe part of the LFSR trait that allows to count up, down and get a current state
4pub trait LFSR {
5 /** Retrieves the current state of the LFSR */
6 fn get_state(&self) -> u32;
7 /** Count up */
8 fn inc(&mut self);
9 /** Count down */
10 fn dec(&mut self);
11 /** Sequence length of this LFSR */
12 fn sequence_length(&self) -> u32;
13}
14
15/// A non-object-safe part of an LFSR
16pub trait LFSRStatic {
17 /** Sequence length of this LFSR */
18 fn sequence_length() -> u32;
19}