mimxrt685s_pac/powerquad/
tmpformat.rs1#[doc = "Register `TMPFORMAT` reader"]
2pub type R = crate::R<TmpformatSpec>;
3#[doc = "Register `TMPFORMAT` writer"]
4pub type W = crate::W<TmpformatSpec>;
5#[doc = "Field `tmp_formatint` reader - Temp Internal format (00: q15; 01:q31; 10:float)"]
6pub type TmpFormatintR = crate::FieldReader;
7#[doc = "Field `tmp_formatint` writer - Temp Internal format (00: q15; 01:q31; 10:float)"]
8pub type TmpFormatintW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `tmp_formatext` reader - Temp External format (00: q15; 01:q31; 10:float)"]
10pub type TmpFormatextR = crate::FieldReader;
11#[doc = "Field `tmp_formatext` writer - Temp External format (00: q15; 01:q31; 10:float)"]
12pub type TmpFormatextW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `tmp_scaler` reader - Temp Scaler value (for scaled 'q31' formats)"]
14pub type TmpScalerR = crate::FieldReader;
15#[doc = "Field `tmp_scaler` writer - Temp Scaler value (for scaled 'q31' formats)"]
16pub type TmpScalerW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17impl R {
18 #[doc = "Bits 0:1 - Temp Internal format (00: q15; 01:q31; 10:float)"]
19 #[inline(always)]
20 pub fn tmp_formatint(&self) -> TmpFormatintR {
21 TmpFormatintR::new((self.bits & 3) as u8)
22 }
23 #[doc = "Bits 4:5 - Temp External format (00: q15; 01:q31; 10:float)"]
24 #[inline(always)]
25 pub fn tmp_formatext(&self) -> TmpFormatextR {
26 TmpFormatextR::new(((self.bits >> 4) & 3) as u8)
27 }
28 #[doc = "Bits 8:15 - Temp Scaler value (for scaled 'q31' formats)"]
29 #[inline(always)]
30 pub fn tmp_scaler(&self) -> TmpScalerR {
31 TmpScalerR::new(((self.bits >> 8) & 0xff) as u8)
32 }
33}
34#[cfg(feature = "debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("TMPFORMAT")
38 .field("tmp_formatint", &self.tmp_formatint())
39 .field("tmp_formatext", &self.tmp_formatext())
40 .field("tmp_scaler", &self.tmp_scaler())
41 .finish()
42 }
43}
44impl W {
45 #[doc = "Bits 0:1 - Temp Internal format (00: q15; 01:q31; 10:float)"]
46 #[inline(always)]
47 pub fn tmp_formatint(&mut self) -> TmpFormatintW<TmpformatSpec> {
48 TmpFormatintW::new(self, 0)
49 }
50 #[doc = "Bits 4:5 - Temp External format (00: q15; 01:q31; 10:float)"]
51 #[inline(always)]
52 pub fn tmp_formatext(&mut self) -> TmpFormatextW<TmpformatSpec> {
53 TmpFormatextW::new(self, 4)
54 }
55 #[doc = "Bits 8:15 - Temp Scaler value (for scaled 'q31' formats)"]
56 #[inline(always)]
57 pub fn tmp_scaler(&mut self) -> TmpScalerW<TmpformatSpec> {
58 TmpScalerW::new(self, 8)
59 }
60}
61#[doc = "Temp format\n\nYou can [`read`](crate::Reg::read) this register and get [`tmpformat::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tmpformat::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct TmpformatSpec;
63impl crate::RegisterSpec for TmpformatSpec {
64 type Ux = u32;
65}
66#[doc = "`read()` method returns [`tmpformat::R`](R) reader structure"]
67impl crate::Readable for TmpformatSpec {}
68#[doc = "`write(|w| ..)` method takes [`tmpformat::W`](W) writer structure"]
69impl crate::Writable for TmpformatSpec {
70 type Safety = crate::Unsafe;
71 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
72 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73}
74#[doc = "`reset()` method sets TMPFORMAT to value 0"]
75impl crate::Resettable for TmpformatSpec {
76 const RESET_VALUE: u32 = 0;
77}