diff --git a/hal/src/lib.rs b/hal/src/lib.rs index 9856b75ef5d0..8fceed3d3327 100644 --- a/hal/src/lib.rs +++ b/hal/src/lib.rs @@ -150,6 +150,7 @@ pub mod common { pub use crate::sercom; pub use crate::sleeping_delay; #[cfg(feature = "device")] + #[allow(deprecated)] pub use crate::spi_common; pub use crate::time; pub use crate::timer_params; diff --git a/hal/src/prelude.rs b/hal/src/prelude.rs index c4d1976d1293..bc8567dab728 100644 --- a/hal/src/prelude.rs +++ b/hal/src/prelude.rs @@ -2,6 +2,7 @@ pub use crate::eic::pin::EicPin; #[allow(deprecated)] pub use crate::gpio::v1::GpioExt as _atsamd21_hal_gpio_GpioExt; +#[allow(deprecated)] pub use crate::spi_common::CommonSpi as _atsamd_hal_spi_common_CommonSpi; pub use crate::time::U32Ext as _atsamd21_hal_time_U32Ext; pub use crate::timer_traits::InterruptDrivenTimer as _atsamd_hal_timer_traits_InterruptDrivenTimer; diff --git a/hal/src/spi_common.rs b/hal/src/spi_common.rs index 369d524673e0..26480ce87396 100644 --- a/hal/src/spi_common.rs +++ b/hal/src/spi_common.rs @@ -1,4 +1,9 @@ -/// Consolidated common logic for dealing with ATSAMD SPI peripherals. +#![deprecated( + since = "0.13.0", + note = "The `spi_common` module is deprecated, and will be removed in a subsequent release. + Please use the `sercom::v2::spi::AnySpi` trait instead." +)] + use crate::hal::spi::{Mode, Phase, Polarity}; use crate::time::{Hertz, U32Ext}; @@ -13,6 +18,7 @@ use crate::target_device::sercom0::SPI; ))] use crate::target_device::sercom0::SPIM as SPI; +/// Consolidated common logic for dealing with ATSAMD SPI peripherals. pub trait CommonSpi { /// Helper for accessing the spi member of the sercom instance fn spi(&self) -> &SPI; diff --git a/hal/src/thumbv6m/sercom/v1/spi.rs b/hal/src/thumbv6m/sercom/v1/spi.rs index 7483a73f90aa..9ec9adf514e9 100644 --- a/hal/src/thumbv6m/sercom/v1/spi.rs +++ b/hal/src/thumbv6m/sercom/v1/spi.rs @@ -10,6 +10,7 @@ use crate::clock; use crate::hal::spi::{FullDuplex, Mode, Phase, Polarity}; use crate::sercom::v1::pads::CompatiblePad; use crate::sercom::v2::*; +#[allow(deprecated)] use crate::spi_common::CommonSpi; use crate::target_device::sercom0::SPI; use crate::target_device::{PM, SERCOM0, SERCOM1}; @@ -126,6 +127,7 @@ macro_rules! spi_master { sercom: $SERCOM, } + #[allow(deprecated)] impl CommonSpi for $Type { /// Helper for accessing the spi member of the sercom instance fn spi(&self) -> &SPI { @@ -138,6 +140,7 @@ macro_rules! spi_master { } } + #[allow(deprecated)] impl $Type { /// Power on and configure SERCOMX to work as an SPI Master operating /// with the specified frequency and SPI Mode. The padout specifies @@ -232,6 +235,7 @@ macro_rules! spi_master { } } + #[allow(deprecated)] impl FullDuplex for $Type { type Error = Error; diff --git a/hal/src/thumbv7em/sercom/v1/spi.rs b/hal/src/thumbv7em/sercom/v1/spi.rs index 5a1f081eeffc..388aac2581bc 100644 --- a/hal/src/thumbv7em/sercom/v1/spi.rs +++ b/hal/src/thumbv7em/sercom/v1/spi.rs @@ -10,6 +10,7 @@ use crate::clock; use crate::hal::spi::{FullDuplex, Mode, Phase, Polarity}; use crate::sercom::v1::pads::CompatiblePad; use crate::sercom::v2::*; +#[allow(deprecated)] use crate::spi_common::CommonSpi; use crate::target_device::sercom0::SPIM; use crate::target_device::{MCLK, SERCOM0, SERCOM1, SERCOM2, SERCOM3, SERCOM4, SERCOM5}; @@ -127,6 +128,7 @@ macro_rules! spi_master { sercom: $SERCOM, } + #[allow(deprecated)] impl CommonSpi for $Type { /// Helper for accessing the spi member of the sercom instance fn spi(&self) -> &SPIM { @@ -139,6 +141,7 @@ macro_rules! spi_master { } } + #[allow(deprecated)] impl $Type { /// Power on and configure SERCOMX to work as an SPI Master operating /// with the specified frequency and SPI Mode. The pinout specifies @@ -229,6 +232,7 @@ macro_rules! spi_master { } } + #[allow(deprecated)] impl FullDuplex for $Type { type Error = Error;