mcxa_pac/trng0/
scr6pl.rs

1#[doc = "Register `SCR6PL` reader"]
2pub type R = crate::R<Scr6plSpec>;
3#[doc = "Register `SCR6PL` writer"]
4pub type W = crate::W<Scr6plSpec>;
5#[doc = "Field `RUN6P_MAX` reader - Run Length 6+ Maximum Limit"]
6pub type Run6pMaxR = crate::FieldReader<u16>;
7#[doc = "Field `RUN6P_MAX` writer - Run Length 6+ Maximum Limit"]
8pub type Run6pMaxW<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
9#[doc = "Field `RUN6P_RNG` reader - Run Length 6+ Range"]
10pub type Run6pRngR = crate::FieldReader<u16>;
11#[doc = "Field `RUN6P_RNG` writer - Run Length 6+ Range"]
12pub type Run6pRngW<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
13impl R {
14    #[doc = "Bits 0:10 - Run Length 6+ Maximum Limit"]
15    #[inline(always)]
16    pub fn run6p_max(&self) -> Run6pMaxR {
17        Run6pMaxR::new((self.bits & 0x07ff) as u16)
18    }
19    #[doc = "Bits 16:26 - Run Length 6+ Range"]
20    #[inline(always)]
21    pub fn run6p_rng(&self) -> Run6pRngR {
22        Run6pRngR::new(((self.bits >> 16) & 0x07ff) as u16)
23    }
24}
25#[cfg(feature = "debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("SCR6PL")
29            .field("run6p_max", &self.run6p_max())
30            .field("run6p_rng", &self.run6p_rng())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:10 - Run Length 6+ Maximum Limit"]
36    #[inline(always)]
37    pub fn run6p_max(&mut self) -> Run6pMaxW<'_, Scr6plSpec> {
38        Run6pMaxW::new(self, 0)
39    }
40    #[doc = "Bits 16:26 - Run Length 6+ Range"]
41    #[inline(always)]
42    pub fn run6p_rng(&mut self) -> Run6pRngW<'_, Scr6plSpec> {
43        Run6pRngW::new(self, 16)
44    }
45}
46#[doc = "Statistical Check Run Length 6+ Limit Register\n\nYou can [`read`](crate::Reg::read) this register and get [`scr6pl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`scr6pl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct Scr6plSpec;
48impl crate::RegisterSpec for Scr6plSpec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`scr6pl::R`](R) reader structure"]
52impl crate::Readable for Scr6plSpec {}
53#[doc = "`write(|w| ..)` method takes [`scr6pl::W`](W) writer structure"]
54impl crate::Writable for Scr6plSpec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets SCR6PL to value 0x0012_0011"]
58impl crate::Resettable for Scr6plSpec {
59    const RESET_VALUE: u32 = 0x0012_0011;
60}