From 9d7765d5fb91aa6f1b6ec54e15978c0bcbca248e Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Sat, 4 Mar 2023 12:28:52 -0500 Subject: [PATCH] Remove deprecated APIs for 0.6 release See the changelog for details. --- CHANGELOG.md | 6 ++++++ src/chip/imxrt10xx/imxrt1010.rs | 12 ----------- src/common/lpspi.rs | 35 +++------------------------------ src/common/timer.rs | 34 -------------------------------- tests/1010_trace_clk_rename.rs | 15 -------------- 5 files changed, 9 insertions(+), 93 deletions(-) delete mode 100644 tests/1010_trace_clk_rename.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e9be5f7..44eaf318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ **BREAKING** Update `imxrt-usbd` to 0.3. Users are required to update to `usb-device` 0.3 and its compatible dependencies. +**BREAKING** Remove deprecated APIs + +- `clko2::Selection::TracClk` +- `timer::*PitChan` +- `lpspi::Disabled::{set_mode, set_watermark}` + ## [0.5.6] 2024-07-05 - Add LPSPI low-level clock configuration APIs. diff --git a/src/chip/imxrt10xx/imxrt1010.rs b/src/chip/imxrt10xx/imxrt1010.rs index bb793e63..57a3d6f2 100644 --- a/src/chip/imxrt10xx/imxrt1010.rs +++ b/src/chip/imxrt10xx/imxrt1010.rs @@ -117,18 +117,6 @@ pub(crate) mod ccm { /// SPDIF0 clock root. Spdif0Clk = 0b11101, } - - impl Clko2Selection { - /// Trace clock root. - /// - /// Prefer [`TraceClk`](Self::TraceClk), which is correctly spelled. - #[deprecated( - since = "0.5.1", - note = "Use the correctly-spelled 'TraceClk' variant." - )] - #[allow(non_upper_case_globals)] - pub const TracClk: Clko2Selection = Clko2Selection::TraceClk; - } } ccm_flexio!( diff --git a/src/common/lpspi.rs b/src/common/lpspi.rs index f0ccc0f0..0d44d054 100644 --- a/src/common/lpspi.rs +++ b/src/common/lpspi.rs @@ -556,7 +556,7 @@ impl Lpspi { /// The handle to a [`Disabled`](crate::lpspi::Disabled) driver lets you modify /// LPSPI settings that require a fully disabled peripheral. pub fn disabled(&mut self, func: impl FnOnce(&mut Disabled) -> R) -> R { - let mut disabled = Disabled::new(&mut self.lpspi, &mut self.mode); + let mut disabled = Disabled::new(&mut self.lpspi); func(&mut disabled) } @@ -1134,12 +1134,11 @@ fn set_watermark(lpspi: &ral::lpspi::RegisterBlock, direction: Direction, waterm /// An LPSPI peripheral which is temporarily disabled. pub struct Disabled<'a, const N: u8> { lpspi: &'a ral::lpspi::Instance, - mode: &'a mut Mode, men: bool, } impl<'a, const N: u8> Disabled<'a, N> { - fn new(lpspi: &'a mut ral::lpspi::Instance, mode: &'a mut Mode) -> Self { + fn new(lpspi: &'a mut ral::lpspi::Instance) -> Self { let men = ral::read_reg!(ral::lpspi, lpspi, CR, MEN == MEN_1); // Request disable @@ -1147,16 +1146,7 @@ impl<'a, const N: u8> Disabled<'a, N> { // Wait for the driver to finish its current transfer // and enter disabled state while ral::read_reg!(ral::lpspi, lpspi, CR, MEN == MEN_1) {} - Self { lpspi, mode, men } - } - - /// Set the SPI mode for the peripheral - #[deprecated( - since = "0.5.5", - note = "Use Lpspi::set_mode to change modes while enabled." - )] - pub fn set_mode(&mut self, mode: Mode) { - *self.mode = mode; + Self { lpspi, men } } /// Set the LPSPI clock speed (Hz). @@ -1180,25 +1170,6 @@ impl<'a, const N: u8> Disabled<'a, N> { ); } - /// Set the watermark level for a given direction. - /// - /// Returns the watermark level committed to the hardware. This may be different - /// than the supplied `watermark`, since it's limited by the hardware. - /// - /// When `direction == Direction::Rx`, the receive data flag is set whenever the - /// number of words in the receive FIFO is greater than `watermark`. - /// - /// When `direction == Direction::Tx`, the transmit data flag is set whenever the - /// the number of words in the transmit FIFO is less than, or equal, to `watermark`. - #[inline] - #[deprecated( - since = "0.5.5", - note = "Use Lpspi::set_watermark to change watermark while enabled" - )] - pub fn set_watermark(&mut self, direction: Direction, watermark: u8) -> u8 { - set_watermark(self.lpspi, direction, watermark) - } - /// Set the sampling point of the LPSPI peripheral. /// /// When set to `SamplePoint::DelayedEdge`, the LPSPI will sample the input data diff --git a/src/common/timer.rs b/src/common/timer.rs index 6766e041..37dbddb1 100644 --- a/src/common/timer.rs +++ b/src/common/timer.rs @@ -383,29 +383,12 @@ fn prepare_gpt(gpt: &mut gpt::Gpt) { /// A single PIT channel that acts as a blocking timer. pub type BlockingPit = Blocking, HZ>; -/// A single PIT channel that acts as a blocking timer. -/// -/// Prefer [`BlockingPit`], which is easier to type. It is also more -/// distinct than [`BlockingPitChain`], which varies from `BlockingPitChan` -/// by only one letter. -#[deprecated(since = "0.5.1", note = "Use BlockingPit")] -pub type BlockingPitChan = BlockingPit; - impl BlockingPit { /// Create a blocking adapter from a PIT channel. pub fn from_pit(mut pit: pit::Pit) -> Self { prepare_pit(&mut pit); Self::new(pit) } - - /// Create a blocking adapter from a PIT channel. - /// - /// Prefer [`from_pit`](Self::from_pit), which is easier to type - /// and matches the name of the type we're converting. - #[deprecated(since = "0.5.1", note = "Use from_pit")] - pub fn from_pit_channel(pit: pit::Pit) -> Self { - Self::from_pit(pit) - } } /// A chain of PIT channels that act as a blocking timer. @@ -529,29 +512,12 @@ where /// A count down timer over a PIT channel. pub type RawCountDownPit = RawCountDown>; -/// A count down timer over a PIT channel. -/// -/// Prefer [`RawCountDownPit`], which is easier to type. It is also more -/// distinct than [`RawCountDownPitChain`], which varies from `RawCountDownPitChan` -/// by only one letter. -#[deprecated(since = "0.5.1", note = "Use RawCountDownPit")] -pub type RawCountDownPitChan = RawCountDownPit; - impl RawCountDownPit { /// Create a count down timer from a PIT channel. pub fn from_pit(mut pit: pit::Pit) -> Self { prepare_pit(&mut pit); Self::new(pit) } - - /// Create a count down timer from a PIT channel. - /// - /// Prefer [`from_pit`](Self::from_pit), which is easier to type - /// and matches the name of the type we're converting. - #[deprecated(since = "0.5.1", note = "Use from_pit")] - pub fn from_pit_channel(pit: pit::Pit) -> Self { - Self::from_pit(pit) - } } /// A count down timer over two chained PIT channels. diff --git a/tests/1010_trace_clk_rename.rs b/tests/1010_trace_clk_rename.rs deleted file mode 100644 index c3ebc982..00000000 --- a/tests/1010_trace_clk_rename.rs +++ /dev/null @@ -1,15 +0,0 @@ -//! Tests backwards compatibility of a typo correction. - -#![cfg(chip = "imxrt1010")] -#![allow(deprecated)] - -use hal::ccm::output_source::clko2::Selection; -use imxrt_hal as hal; - -const USER_CONSTANT: Selection = Selection::TracClk; - -#[test] -fn trace_clk_match() { - assert!(matches!(USER_CONSTANT, Selection::TracClk)); - assert!(matches!(USER_CONSTANT, Selection::TraceClk)); -}