From 31887b47bc7c7f72b707c3195c119dec58a38dce Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 20 May 2024 10:55:55 +0200 Subject: [PATCH] embassy-embedded-hal: remove Word generic for blocking SpiDeviceWithConfig. --- .../src/shared_bus/blocking/spi.rs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs index 3be1276e5..eb9c0c4f4 100644 --- a/embassy-embedded-hal/src/shared_bus/blocking/spi.rs +++ b/embassy-embedded-hal/src/shared_bus/blocking/spi.rs @@ -96,22 +96,16 @@ where /// This is like [`SpiDevice`], with an additional bus configuration that's applied /// to the bus before each use using [`SetConfig`]. This allows different /// devices on the same bus to use different communication settings. -pub struct SpiDeviceWithConfig<'a, M: RawMutex, BUS: SetConfig, CS, Word: Copy + 'static = u8> { +pub struct SpiDeviceWithConfig<'a, M: RawMutex, BUS: SetConfig, CS> { bus: &'a Mutex>, cs: CS, config: BUS::Config, - _word: core::marker::PhantomData, } impl<'a, M: RawMutex, BUS: SetConfig, CS> SpiDeviceWithConfig<'a, M, BUS, CS> { /// Create a new `SpiDeviceWithConfig`. pub fn new(bus: &'a Mutex>, cs: CS, config: BUS::Config) -> Self { - Self { - bus, - cs, - config, - _word: core::marker::PhantomData, - } + Self { bus, cs, config } } /// Change the device's config at runtime @@ -120,17 +114,16 @@ impl<'a, M: RawMutex, BUS: SetConfig, CS> SpiDeviceWithConfig<'a, M, BUS, CS> { } } -impl<'a, M, BUS, CS, Word> spi::ErrorType for SpiDeviceWithConfig<'a, M, BUS, CS, Word> +impl<'a, M, BUS, CS> spi::ErrorType for SpiDeviceWithConfig<'a, M, BUS, CS> where M: RawMutex, BUS: spi::ErrorType + SetConfig, CS: OutputPin, - Word: Copy + 'static, { type Error = SpiDeviceError; } -impl embedded_hal_1::spi::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS, Word> +impl embedded_hal_1::spi::SpiDevice for SpiDeviceWithConfig<'_, M, BUS, CS> where M: RawMutex, BUS: SpiBus + SetConfig,