Skip to main content

mcxa_pac/trng0/
scr1l.rs

1#[doc = "Register `SCR1L` reader"]
2pub type R = crate::R<Scr1lSpec>;
3#[doc = "Register `SCR1L` writer"]
4pub type W = crate::W<Scr1lSpec>;
5#[doc = "Field `RUN1_MAX` reader - Run Length 1 Maximum Limit"]
6pub type Run1MaxR = crate::FieldReader<u16>;
7#[doc = "Field `RUN1_MAX` writer - Run Length 1 Maximum Limit"]
8pub type Run1MaxW<'a, REG> = crate::FieldWriter<'a, REG, 15, u16>;
9#[doc = "Field `RUN1_RNG` reader - Run Length 1 Range"]
10pub type Run1RngR = crate::FieldReader<u16>;
11#[doc = "Field `RUN1_RNG` writer - Run Length 1 Range"]
12pub type Run1RngW<'a, REG> = crate::FieldWriter<'a, REG, 15, u16>;
13impl R {
14    #[doc = "Bits 0:14 - Run Length 1 Maximum Limit"]
15    #[inline(always)]
16    pub fn run1_max(&self) -> Run1MaxR {
17        Run1MaxR::new((self.bits & 0x7fff) as u16)
18    }
19    #[doc = "Bits 16:30 - Run Length 1 Range"]
20    #[inline(always)]
21    pub fn run1_rng(&self) -> Run1RngR {
22        Run1RngR::new(((self.bits >> 16) & 0x7fff) 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("SCR1L")
29            .field("run1_max", &self.run1_max())
30            .field("run1_rng", &self.run1_rng())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:14 - Run Length 1 Maximum Limit"]
36    #[inline(always)]
37    pub fn run1_max(&mut self) -> Run1MaxW<'_, Scr1lSpec> {
38        Run1MaxW::new(self, 0)
39    }
40    #[doc = "Bits 16:30 - Run Length 1 Range"]
41    #[inline(always)]
42    pub fn run1_rng(&mut self) -> Run1RngW<'_, Scr1lSpec> {
43        Run1RngW::new(self, 16)
44    }
45}
46#[doc = "Statistical Check Run Length 1 Limit Register\n\nYou can [`read`](crate::Reg::read) this register and get [`scr1l::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`scr1l::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct Scr1lSpec;
48impl crate::RegisterSpec for Scr1lSpec {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`scr1l::R`](R) reader structure"]
52impl crate::Readable for Scr1lSpec {}
53#[doc = "`write(|w| ..)` method takes [`scr1l::W`](W) writer structure"]
54impl crate::Writable for Scr1lSpec {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets SCR1L to value 0x004f_006b"]
58impl crate::Resettable for Scr1lSpec {
59    const RESET_VALUE: u32 = 0x004f_006b;
60}