mcxa_pac/crc0/
gpoly.rs

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