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