mcxa_pac/flexpwm0/
sm2captcompx.rs1#[doc = "Register `SM2CAPTCOMPX` reader"]
2pub type R = crate::R<Sm2captcompxSpec>;
3#[doc = "Register `SM2CAPTCOMPX` writer"]
4pub type W = crate::W<Sm2captcompxSpec>;
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("SM2CAPTCOMPX")
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<'_, Sm2captcompxSpec> {
36 EdgcmpxW::new(self, 0)
37 }
38}
39#[doc = "Capture Compare X Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sm2captcompx::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sm2captcompx::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct Sm2captcompxSpec;
41impl crate::RegisterSpec for Sm2captcompxSpec {
42 type Ux = u16;
43}
44#[doc = "`read()` method returns [`sm2captcompx::R`](R) reader structure"]
45impl crate::Readable for Sm2captcompxSpec {}
46#[doc = "`write(|w| ..)` method takes [`sm2captcompx::W`](W) writer structure"]
47impl crate::Writable for Sm2captcompxSpec {
48 type Safety = crate::Unsafe;
49}
50#[doc = "`reset()` method sets SM2CAPTCOMPX to value 0"]
51impl crate::Resettable for Sm2captcompxSpec {}