mimxrt685s_pac/powerquad/
cppre.rs1#[doc = "Register `CPPRE` reader"]
2pub type R = crate::R<CppreSpec>;
3#[doc = "Register `CPPRE` writer"]
4pub type W = crate::W<CppreSpec>;
5#[doc = "Field `cppre_in` reader - co-processor scaling of input"]
6pub type CppreInR = crate::FieldReader;
7#[doc = "Field `cppre_in` writer - co-processor scaling of input"]
8pub type CppreInW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `cppre_out` reader - co-processor fixed point output"]
10pub type CppreOutR = crate::FieldReader;
11#[doc = "Field `cppre_out` writer - co-processor fixed point output"]
12pub type CppreOutW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `cppre_sat` reader - 1 : forces sub-32 bit saturation"]
14pub type CppreSatR = crate::BitReader;
15#[doc = "Field `cppre_sat` writer - 1 : forces sub-32 bit saturation"]
16pub type CppreSatW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `cppre_sat8` reader - 0 = 8bits, 1 = 16bits"]
18pub type CppreSat8R = crate::BitReader;
19#[doc = "Field `cppre_sat8` writer - 0 = 8bits, 1 = 16bits"]
20pub type CppreSat8W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[doc = "Bits 0:7 - co-processor scaling of input"]
23 #[inline(always)]
24 pub fn cppre_in(&self) -> CppreInR {
25 CppreInR::new((self.bits & 0xff) as u8)
26 }
27 #[doc = "Bits 8:15 - co-processor fixed point output"]
28 #[inline(always)]
29 pub fn cppre_out(&self) -> CppreOutR {
30 CppreOutR::new(((self.bits >> 8) & 0xff) as u8)
31 }
32 #[doc = "Bit 16 - 1 : forces sub-32 bit saturation"]
33 #[inline(always)]
34 pub fn cppre_sat(&self) -> CppreSatR {
35 CppreSatR::new(((self.bits >> 16) & 1) != 0)
36 }
37 #[doc = "Bit 17 - 0 = 8bits, 1 = 16bits"]
38 #[inline(always)]
39 pub fn cppre_sat8(&self) -> CppreSat8R {
40 CppreSat8R::new(((self.bits >> 17) & 1) != 0)
41 }
42}
43#[cfg(feature = "debug")]
44impl core::fmt::Debug for R {
45 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46 f.debug_struct("CPPRE")
47 .field("cppre_in", &self.cppre_in())
48 .field("cppre_out", &self.cppre_out())
49 .field("cppre_sat", &self.cppre_sat())
50 .field("cppre_sat8", &self.cppre_sat8())
51 .finish()
52 }
53}
54impl W {
55 #[doc = "Bits 0:7 - co-processor scaling of input"]
56 #[inline(always)]
57 pub fn cppre_in(&mut self) -> CppreInW<CppreSpec> {
58 CppreInW::new(self, 0)
59 }
60 #[doc = "Bits 8:15 - co-processor fixed point output"]
61 #[inline(always)]
62 pub fn cppre_out(&mut self) -> CppreOutW<CppreSpec> {
63 CppreOutW::new(self, 8)
64 }
65 #[doc = "Bit 16 - 1 : forces sub-32 bit saturation"]
66 #[inline(always)]
67 pub fn cppre_sat(&mut self) -> CppreSatW<CppreSpec> {
68 CppreSatW::new(self, 16)
69 }
70 #[doc = "Bit 17 - 0 = 8bits, 1 = 16bits"]
71 #[inline(always)]
72 pub fn cppre_sat8(&mut self) -> CppreSat8W<CppreSpec> {
73 CppreSat8W::new(self, 17)
74 }
75}
76#[doc = "Pre-scale register\n\nYou can [`read`](crate::Reg::read) this register and get [`cppre::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cppre::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct CppreSpec;
78impl crate::RegisterSpec for CppreSpec {
79 type Ux = u32;
80}
81#[doc = "`read()` method returns [`cppre::R`](R) reader structure"]
82impl crate::Readable for CppreSpec {}
83#[doc = "`write(|w| ..)` method takes [`cppre::W`](W) writer structure"]
84impl crate::Writable for CppreSpec {
85 type Safety = crate::Unsafe;
86 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets CPPRE to value 0"]
90impl crate::Resettable for CppreSpec {
91 const RESET_VALUE: u32 = 0;
92}