Skip to main content

mcxa_pac/trng0/
scr2c.rs

1#[doc = "Register `SCR2C` reader"]
2pub type R = crate::R<Scr2cSpec>;
3#[doc = "Field `R2_0_CT` reader - Runs of Zero, Length 2 Count"]
4pub type R2_0CtR = crate::FieldReader<u16>;
5#[doc = "Field `R2_1_CT` reader - Runs of One, Length 2 Count"]
6pub type R2_1CtR = crate::FieldReader<u16>;
7impl R {
8    #[doc = "Bits 0:13 - Runs of Zero, Length 2 Count"]
9    #[inline(always)]
10    pub fn r2_0_ct(&self) -> R2_0CtR {
11        R2_0CtR::new((self.bits & 0x3fff) as u16)
12    }
13    #[doc = "Bits 16:29 - Runs of One, Length 2 Count"]
14    #[inline(always)]
15    pub fn r2_1_ct(&self) -> R2_1CtR {
16        R2_1CtR::new(((self.bits >> 16) & 0x3fff) as u16)
17    }
18}
19#[cfg(feature = "debug")]
20impl core::fmt::Debug for R {
21    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
22        f.debug_struct("SCR2C")
23            .field("r2_0_ct", &self.r2_0_ct())
24            .field("r2_1_ct", &self.r2_1_ct())
25            .finish()
26    }
27}
28#[doc = "Statistical Check Run Length 2 Count Register\n\nYou can [`read`](crate::Reg::read) this register and get [`scr2c::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
29pub struct Scr2cSpec;
30impl crate::RegisterSpec for Scr2cSpec {
31    type Ux = u32;
32}
33#[doc = "`read()` method returns [`scr2c::R`](R) reader structure"]
34impl crate::Readable for Scr2cSpec {}
35#[doc = "`reset()` method sets SCR2C to value 0"]
36impl crate::Resettable for Scr2cSpec {}