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 {
use super::*;

View File

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

View File

@ -174,10 +174,7 @@ impl<'d, T: Instance, Tx, Rx> Spi<'d, T, Tx, Rx> {
}
}
trait Word {}
impl Word for u8 {}
impl Word for u16 {}
use super::Word;
/// 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> {