aboutsummaryrefslogtreecommitdiff
path: root/src/peripheral/mod.rs
diff options
context:
space:
mode:
authorGravatar Hugues de Valon <hugues.devalon@arm.com> 2019-12-22 17:45:48 +0000
committerGravatar Hugues de Valon <hugues.devalon@arm.com> 2020-04-10 17:46:56 +0100
commit9c1a46749c4a2f7b88581a69cd405b712d227343 (patch)
tree40d9e113e59b90fd40b8e0dd9e0934a3969b2c48 /src/peripheral/mod.rs
parent6a0432a038addf78cfe2fc7ab958b171b2134377 (diff)
downloadcortex-m-9c1a46749c4a2f7b88581a69cd405b712d227343.tar.gz
cortex-m-9c1a46749c4a2f7b88581a69cd405b712d227343.tar.zst
cortex-m-9c1a46749c4a2f7b88581a69cd405b712d227343.zip
Update cfg gates with Armv8-M
Update cfg attributes and code documentation to take into consideration the new Armv8-M architecture profiles. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
Diffstat (limited to 'src/peripheral/mod.rs')
-rw-r--r--src/peripheral/mod.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs
index c84003f..14ae7f7 100644
--- a/src/peripheral/mod.rs
+++ b/src/peripheral/mod.rs
@@ -73,7 +73,7 @@ pub mod fpb;
// NOTE(target_arch) is for documentation purposes
#[cfg(any(has_fpu, target_arch = "x86_64"))]
pub mod fpu;
-#[cfg(not(armv6m))]
+#[cfg(all(not(armv6m), not(armv8m_base)))]
pub mod itm;
pub mod mpu;
pub mod nvic;
@@ -90,7 +90,8 @@ mod test;
/// Core peripherals
#[allow(non_snake_case)]
pub struct Peripherals {
- /// Cache and branch predictor maintenance operations (not present on Cortex-M0 variants)
+ /// Cache and branch predictor maintenance operations.
+ /// Not available on Armv6-M.
pub CBP: CBP,
/// CPUID
@@ -102,13 +103,15 @@ pub struct Peripherals {
/// Data Watchpoint and Trace unit
pub DWT: DWT,
- /// Flash Patch and Breakpoint unit (not present on Cortex-M0 variants)
+ /// Flash Patch and Breakpoint unit.
+ /// Not available on Armv6-M.
pub FPB: FPB,
- /// Floating Point Unit (only present on `thumbv7em-none-eabihf`)
+ /// Floating Point Unit.
pub FPU: FPU,
- /// Instrumentation Trace Macrocell (not present on Cortex-M0 variants)
+ /// Instrumentation Trace Macrocell.
+ /// Not available on Armv6-M and Armv8-M Baseline.
pub ITM: ITM,
/// Memory Protection Unit
@@ -123,7 +126,8 @@ pub struct Peripherals {
/// SysTick: System Timer
pub SYST: SYST,
- /// Trace Port Interface Unit (not present on Cortex-M0 variants)
+ /// Trace Port Interface Unit.
+ /// Not available on Armv6-M.
pub TPIU: TPIU,
// Private field making `Peripherals` non-exhaustive. We don't use `#[non_exhaustive]` so we
@@ -360,7 +364,7 @@ pub struct ITM {
unsafe impl Send for ITM {}
-#[cfg(not(armv6m))]
+#[cfg(all(not(armv6m), not(armv8m_base)))]
impl ITM {
/// Returns a pointer to the register block
#[inline(always)]
@@ -369,7 +373,7 @@ impl ITM {
}
}
-#[cfg(not(armv6m))]
+#[cfg(all(not(armv6m), not(armv8m_base)))]
impl ops::Deref for ITM {
type Target = self::itm::RegisterBlock;
@@ -379,7 +383,7 @@ impl ops::Deref for ITM {
}
}
-#[cfg(not(armv6m))]
+#[cfg(all(not(armv6m), not(armv8m_base)))]
impl ops::DerefMut for ITM {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {