Move Word trait to mod

This commit is contained in:
Grant Miller 2021-12-06 18:16:15 -06:00
parent 2e6c3b22b8
commit 496579b48b
3 changed files with 7 additions and 8 deletions

View file

@ -374,6 +374,11 @@ impl RegsExt for crate::pac::spi::Spi {
} }
} }
trait Word {}
impl Word for u8 {}
impl Word for u16 {}
pub(crate) mod sealed { pub(crate) mod sealed {
use super::*; use super::*;

View file

@ -258,10 +258,7 @@ impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx: RxDmaChannel<T>> traits::FullDupl
} }
} }
trait Word {} use super::Word;
impl Word for u8 {}
impl Word for u16 {}
fn write_word<W: Word>(regs: &'static crate::pac::spi::Spi, word: W) -> Result<(), Error> { fn write_word<W: Word>(regs: &'static crate::pac::spi::Spi, word: W) -> Result<(), Error> {
loop { loop {

View file

@ -174,10 +174,7 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> {
} }
} }
trait Word {} use super::Word;
impl Word for u8 {}
impl Word for u16 {}
/// Write a single word blocking. Assumes word size have already been set. /// Write a single word blocking. Assumes word size have already been set.
fn write_word<W: Word>(regs: &'static crate::pac::spi::Spi, word: W) -> Result<(), Error> { fn write_word<W: Word>(regs: &'static crate::pac::spi::Spi, word: W) -> Result<(), Error> {