Skip to main content

mcxa_pac/trng0/
scml.rs

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