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