aboutsummaryrefslogtreecommitdiff
path: root/src/register
diff options
context:
space:
mode:
authorGravatar Dániel Buga <daniel@revolutionrobotics.org> 2020-05-27 23:24:07 +0200
committerGravatar Dániel Buga <daniel@revolutionrobotics.org> 2020-05-27 23:24:07 +0200
commit088972af32d85abea570339d8b143649998aa96c (patch)
tree86b908bac72c9400ddd45ce70c2054ab60ec522c /src/register
parent653a4407cb221fbbc8bb06c518fd599d18f90111 (diff)
downloadcortex-m-088972af32d85abea570339d8b143649998aa96c.tar.gz
cortex-m-088972af32d85abea570339d8b143649998aa96c.tar.zst
cortex-m-088972af32d85abea570339d8b143649998aa96c.zip
Add doc comments
Diffstat (limited to 'src/register')
-rw-r--r--src/register/fpscr.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/register/fpscr.rs b/src/register/fpscr.rs
index 22f6ce1..3ae6248 100644
--- a/src/register/fpscr.rs
+++ b/src/register/fpscr.rs
@@ -1,11 +1,13 @@
//! Floating-point Status Control Register
+/// Floating-point Status Control Register
#[allow(clippy::missing_inline_in_public_items)]
#[derive(Clone, Copy, Debug)]
pub struct Fpscr {
bits: u32,
}
+//! Rounding mode
#[derive(Clone, Copy, Debug)]
pub enum RMode {
Nearest,
@@ -45,21 +47,25 @@ impl Fpscr {
self.bits & (1 << 28) != 0
}
+ //! Read the Alternative Half Precision bit
#[inline]
pub fn ahp(self) -> bool {
if self.bits & (1 << 26) != 0
}
+ //! Read the Default NaN mode bit
#[inline]
pub fn dn(self) -> bool {
if self.bits & (1 << 25) != 0
}
+ //! Read the Flush to Zero mode bit
#[inline]
pub fn fz(self) -> bool {
if self.bits & (1 << 24) != 0
}
+ //! Read the Rounding Mode control field
#[inline]
pub fn rmode(self) -> RMode {
match self.bits & (3 << 22) {
@@ -70,31 +76,37 @@ impl Fpscr {
}
}
+ //! Read the Input Denormal cumulative exception bit
#[inline]
pub fn idc(self) -> bool {
if self.bits & (1 << 7) != 0
}
+ //! Read the Inexact cumulative exception bit
#[inline]
pub fn ixc(self) -> bool {
if self.bits & (1 << 4) != 0
}
+ //! Read the Underflow cumulative exception bit
#[inline]
pub fn ufc(self) -> bool {
if self.bits & (1 << 3) != 0
}
+ //! Read the Overflow cumulative exception bit
#[inline]
pub fn ofc(self) -> bool {
if self.bits & (1 << 2) != 0
}
+ //! Read the Division by Zero cumulative exception bit
#[inline]
pub fn dzc(self) -> bool {
if self.bits & (1 << 1) != 0
}
+ //! Read the Invalid Operation cumulative exception bit
#[inline]
pub fn ioc(self) -> bool {
if self.bits & (1 << 0) != 0