Skip to main content

mcxa_pac/flexpwm0/
sm3captcompx.rs

1#[doc = "Register `SM3CAPTCOMPX` reader"]
2pub type R = crate::R<Sm3captcompxSpec>;
3#[doc = "Register `SM3CAPTCOMPX` writer"]
4pub type W = crate::W<Sm3captcompxSpec>;
5#[doc = "Field `EDGCMPX` reader - Edge Compare X"]
6pub type EdgcmpxR = crate::FieldReader;
7#[doc = "Field `EDGCMPX` writer - Edge Compare X"]
8pub type EdgcmpxW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `EDGCNTX` reader - Edge Counter X"]
10pub type EdgcntxR = crate::FieldReader;
11impl R {
12    #[doc = "Bits 0:7 - Edge Compare X"]
13    #[inline(always)]
14    pub fn edgcmpx(&self) -> EdgcmpxR {
15        EdgcmpxR::new((self.bits & 0xff) as u8)
16    }
17    #[doc = "Bits 8:15 - Edge Counter X"]
18    #[inline(always)]
19    pub fn edgcntx(&self) -> EdgcntxR {
20        EdgcntxR::new(((self.bits >> 8) & 0xff) as u8)
21    }
22}
23#[cfg(feature = "debug")]
24impl core::fmt::Debug for R {
25    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
26        f.debug_struct("SM3CAPTCOMPX")
27            .field("edgcmpx", &self.edgcmpx())
28            .field("edgcntx", &self.edgcntx())
29            .finish()
30    }
31}
32impl W {
33    #[doc = "Bits 0:7 - Edge Compare X"]
34    #[inline(always)]
35    pub fn edgcmpx(&mut self) -> EdgcmpxW<'_, Sm3captcompxSpec> {
36        EdgcmpxW::new(self, 0)
37    }
38}
39#[doc = "Capture Compare X Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sm3captcompx::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sm3captcompx::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct Sm3captcompxSpec;
41impl crate::RegisterSpec for Sm3captcompxSpec {
42    type Ux = u16;
43}
44#[doc = "`read()` method returns [`sm3captcompx::R`](R) reader structure"]
45impl crate::Readable for Sm3captcompxSpec {}
46#[doc = "`write(|w| ..)` method takes [`sm3captcompx::W`](W) writer structure"]
47impl crate::Writable for Sm3captcompxSpec {
48    type Safety = crate::Unsafe;
49}
50#[doc = "`reset()` method sets SM3CAPTCOMPX to value 0"]
51impl crate::Resettable for Sm3captcompxSpec {}