Move Word trait to mod
This commit is contained in:
parent
2e6c3b22b8
commit
496579b48b
3 changed files with 7 additions and 8 deletions
|
@ -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::*;
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue