From 0cf8a88f12cdc9ac1648e462f0de34bac335f269 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Sun, 22 Nov 2020 04:56:08 +0200 Subject: [PATCH] [del] tock-registers: Implement mask() accessor for Field --- crates/tock-registers/src/registers.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/tock-registers/src/registers.rs b/crates/tock-registers/src/registers.rs index 100cf4f..60eddaa 100644 --- a/crates/tock-registers/src/registers.rs +++ b/crates/tock-registers/src/registers.rs @@ -514,6 +514,11 @@ pub struct Field { } impl Field { + /// Get the raw bitmask used by this Field. + pub fn mask(&self) -> T { + (self.mask as T) << self.shift + } + #[inline] pub fn read(self, val: T) -> T { (val & (self.mask << self.shift)) >> self.shift