diff options
author | 2022-01-06 14:14:30 -0800 | |
---|---|---|
committer | 2022-01-06 14:17:56 -0800 | |
commit | 2785022ab5fadaaccbdb60b544f4a43b650f146c (patch) | |
tree | 859edefe3af118159f337ffac7812e6c7522637d /src/peripheral/mod.rs | |
parent | 2e2cb78a842f702f78f74e470216eb5139b4a264 (diff) | |
download | cortex-m-2785022ab5fadaaccbdb60b544f4a43b650f146c.tar.gz cortex-m-2785022ab5fadaaccbdb60b544f4a43b650f146c.tar.zst cortex-m-2785022ab5fadaaccbdb60b544f4a43b650f146c.zip |
deprecate `ptr()` function for the 7.x series
Diffstat (limited to 'src/peripheral/mod.rs')
-rw-r--r-- | src/peripheral/mod.rs | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index 3756553..d8fd2d4 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -50,7 +50,7 @@ //! } // all the peripheral singletons are destroyed here //! //! // actually safe because this is an atomic read with no side effects -//! let cyccnt = unsafe { (*DWT::ptr()).cyccnt.read() }; +//! let cyccnt = unsafe { (*DWT::PTR).cyccnt.read() }; //! ``` //! //! # References @@ -245,8 +245,9 @@ impl AC { /// Pointer to the register block pub const PTR: *const self::ac::RegisterBlock = 0xE000_EF90 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const self::ac::RegisterBlock { Self::PTR } @@ -271,8 +272,9 @@ impl CBP { /// Pointer to the register block pub const PTR: *const self::cbp::RegisterBlock = 0xE000_EF50 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const self::cbp::RegisterBlock { Self::PTR } @@ -299,8 +301,9 @@ impl CPUID { /// Pointer to the register block pub const PTR: *const self::cpuid::RegisterBlock = 0xE000_ED00 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const self::cpuid::RegisterBlock { Self::PTR } @@ -326,8 +329,9 @@ impl DCB { /// Pointer to the register block pub const PTR: *const dcb::RegisterBlock = 0xE000_EDF0 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const dcb::RegisterBlock { Self::PTR } @@ -353,8 +357,9 @@ impl DWT { /// Pointer to the register block pub const PTR: *const dwt::RegisterBlock = 0xE000_1000 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const dwt::RegisterBlock { Self::PTR } @@ -381,8 +386,9 @@ impl FPB { /// Pointer to the register block pub const PTR: *const fpb::RegisterBlock = 0xE000_2000 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const fpb::RegisterBlock { Self::PTR } @@ -410,8 +416,9 @@ impl FPU { /// Pointer to the register block pub const PTR: *const fpu::RegisterBlock = 0xE000_EF30 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const fpu::RegisterBlock { Self::PTR } @@ -443,8 +450,9 @@ impl ICB { /// Pointer to the register block pub const PTR: *mut icb::RegisterBlock = 0xE000_E004 as *mut _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *mut icb::RegisterBlock { Self::PTR } @@ -478,8 +486,9 @@ impl ITM { /// Pointer to the register block pub const PTR: *mut itm::RegisterBlock = 0xE000_0000 as *mut _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *mut itm::RegisterBlock { Self::PTR } @@ -514,8 +523,9 @@ impl MPU { /// Pointer to the register block pub const PTR: *const mpu::RegisterBlock = 0xE000_ED90 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const mpu::RegisterBlock { Self::PTR } @@ -541,8 +551,9 @@ impl NVIC { /// Pointer to the register block pub const PTR: *const nvic::RegisterBlock = 0xE000_E100 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const nvic::RegisterBlock { Self::PTR } @@ -569,8 +580,9 @@ impl SAU { /// Pointer to the register block pub const PTR: *const sau::RegisterBlock = 0xE000_EDD0 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const sau::RegisterBlock { Self::PTR } @@ -597,8 +609,9 @@ impl SCB { /// Pointer to the register block pub const PTR: *const scb::RegisterBlock = 0xE000_ED04 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const scb::RegisterBlock { Self::PTR } @@ -624,8 +637,9 @@ impl SYST { /// Pointer to the register block pub const PTR: *const syst::RegisterBlock = 0xE000_E010 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const syst::RegisterBlock { Self::PTR } @@ -652,8 +666,9 @@ impl TPIU { /// Pointer to the register block pub const PTR: *const tpiu::RegisterBlock = 0xE004_0000 as *const _; - /// Returns a pointer to the register block (to be deprecated in 0.7) + /// Returns a pointer to the register block #[inline(always)] + #[deprecated(since = "0.7.5", note = "Use the associated constant `PTR` instead")] pub const fn ptr() -> *const tpiu::RegisterBlock { Self::PTR } |