Skip to main content

rsl10_pac/bb/
bb_finetimecnt.rs

1#[doc = "Reader of register BB_FINETIMECNT"]
2pub type R = crate::R<u32, super::BB_FINETIMECNT>;
3#[doc = "Value of the current us fine time reference counter\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq)]
5#[repr(u16)]
6pub enum FINECNT_A {
7    #[doc = "0: `0`"]
8    FINECNT_0 = 0,
9}
10impl From<FINECNT_A> for u16 {
11    #[inline(always)]
12    fn from(variant: FINECNT_A) -> Self {
13        variant as _
14    }
15}
16#[doc = "Reader of field `FINECNT`"]
17pub type FINECNT_R = crate::R<u16, FINECNT_A>;
18impl FINECNT_R {
19    #[doc = r"Get enumerated values variant"]
20    #[inline(always)]
21    pub fn variant(&self) -> crate::Variant<u16, FINECNT_A> {
22        use crate::Variant::*;
23        match self.bits {
24            0 => Val(FINECNT_A::FINECNT_0),
25            i => Res(i),
26        }
27    }
28    #[doc = "Checks if the value of the field is `FINECNT_0`"]
29    #[inline(always)]
30    pub fn is_finecnt_0(&self) -> bool {
31        *self == FINECNT_A::FINECNT_0
32    }
33}
34impl R {
35    #[doc = "Bits 0:9 - Value of the current us fine time reference counter"]
36    #[inline(always)]
37    pub fn finecnt(&self) -> FINECNT_R {
38        FINECNT_R::new((self.bits & 0x03ff) as u16)
39    }
40}