Add SPIv1, use cfg_attr to pick correct impl.

Add IRQ to impl_rng!() to accomodate RNG vs HASH_RNG split.
This commit is contained in:
Bob McWhirter
2021-05-13 14:28:53 -04:00
parent 07db3ed7c1
commit 9e93a0999f
299 changed files with 14196 additions and 8867 deletions

View File

@ -0,0 +1,34 @@
#![macro_use]
#[cfg_attr(feature = "_spi_v1", path = "spi_v1.rs")]
#[cfg_attr(feature = "_spi_v2", path = "spi_v2.rs")]
mod spi;
pub use spi::*;
// TODO move upwards in the tree
pub enum ByteOrder {
LsbFirst,
MsbFirst,
}
#[derive(Copy, Clone, PartialOrd, PartialEq)]
enum WordSize {
EightBit,
SixteenBit,
}
#[non_exhaustive]
pub struct Config {
pub mode: Mode,
pub byte_order: ByteOrder,
}
impl Default for Config {
fn default() -> Self {
Self {
mode: MODE_0,
byte_order: ByteOrder::MsbFirst,
}
}
}