Skip to main content

mcxa_pac/syscon/
gray_code_msb.rs

1#[doc = "Register `GRAY_CODE_MSB` reader"]
2pub type R = crate::R<GrayCodeMsbSpec>;
3#[doc = "Register `GRAY_CODE_MSB` writer"]
4pub type W = crate::W<GrayCodeMsbSpec>;
5#[doc = "Field `code_gray_41_32` reader - Gray code \\[41:32\\]"]
6pub type CodeGray41_32R = crate::FieldReader<u16>;
7#[doc = "Field `code_gray_41_32` writer - Gray code \\[41:32\\]"]
8pub type CodeGray41_32W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
9impl R {
10    #[doc = "Bits 0:9 - Gray code \\[41:32\\]"]
11    #[inline(always)]
12    pub fn code_gray_41_32(&self) -> CodeGray41_32R {
13        CodeGray41_32R::new((self.bits & 0x03ff) as u16)
14    }
15}
16#[cfg(feature = "debug")]
17impl core::fmt::Debug for R {
18    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
19        f.debug_struct("GRAY_CODE_MSB")
20            .field("code_gray_41_32", &self.code_gray_41_32())
21            .finish()
22    }
23}
24impl W {
25    #[doc = "Bits 0:9 - Gray code \\[41:32\\]"]
26    #[inline(always)]
27    pub fn code_gray_41_32(&mut self) -> CodeGray41_32W<'_, GrayCodeMsbSpec> {
28        CodeGray41_32W::new(self, 0)
29    }
30}
31#[doc = "Gray to Binary Converter Gray Code \\[41:32\\]\n\nYou can [`read`](crate::Reg::read) this register and get [`gray_code_msb::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gray_code_msb::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
32pub struct GrayCodeMsbSpec;
33impl crate::RegisterSpec for GrayCodeMsbSpec {
34    type Ux = u32;
35}
36#[doc = "`read()` method returns [`gray_code_msb::R`](R) reader structure"]
37impl crate::Readable for GrayCodeMsbSpec {}
38#[doc = "`write(|w| ..)` method takes [`gray_code_msb::W`](W) writer structure"]
39impl crate::Writable for GrayCodeMsbSpec {
40    type Safety = crate::Unsafe;
41}
42#[doc = "`reset()` method sets GRAY_CODE_MSB to value 0"]
43impl crate::Resettable for GrayCodeMsbSpec {}