From 496579b48b985391be4191505de37228c0e74b5e Mon Sep 17 00:00:00 2001 From: Grant Miller Date: Mon, 6 Dec 2021 18:16:15 -0600 Subject: [PATCH] Move Word trait to mod --- embassy-stm32/src/spi/mod.rs | 5 +++++ embassy-stm32/src/spi/v1.rs | 5 +---- embassy-stm32/src/spi/v2.rs | 5 +---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs index 80a05aac6..be4061e0f 100644 --- a/embassy-stm32/src/spi/mod.rs +++ b/embassy-stm32/src/spi/mod.rs @@ -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::*; diff --git a/embassy-stm32/src/spi/v1.rs b/embassy-stm32/src/spi/v1.rs index 255bd950a..c1a9cdbfd 100644 --- a/embassy-stm32/src/spi/v1.rs +++ b/embassy-stm32/src/spi/v1.rs @@ -258,10 +258,7 @@ impl<'d, T: Instance, Tx: TxDmaChannel, Rx: RxDmaChannel> traits::FullDupl } } -trait Word {} - -impl Word for u8 {} -impl Word for u16 {} +use super::Word; fn write_word(regs: &'static crate::pac::spi::Spi, word: W) -> Result<(), Error> { loop { diff --git a/embassy-stm32/src/spi/v2.rs b/embassy-stm32/src/spi/v2.rs index b1fae4bdc..1ca90619d 100644 --- a/embassy-stm32/src/spi/v2.rs +++ b/embassy-stm32/src/spi/v2.rs @@ -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(regs: &'static crate::pac::spi::Spi, word: W) -> Result<(), Error> {