mcxa_pac/trng0/
scr5l.rs

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