1#[doc = "Register `CMPM7` reader"]
2pub type R = crate::R<Cmpm7Spec>;
3#[doc = "Register `CMPM7` writer"]
4pub type W = crate::W<Cmpm7Spec>;
5#[doc = "Field `CEN` reader - Comparison x Enable"]
6pub type CenR = crate::BitReader;
7#[doc = "Field `CEN` writer - Comparison x Enable"]
8pub type CenW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CTR` reader - Comparison x Trigger"]
10pub type CtrR = crate::FieldReader;
11#[doc = "Field `CTR` writer - Comparison x Trigger"]
12pub type CtrW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `CPR` reader - Comparison x Period"]
14pub type CprR = crate::FieldReader;
15#[doc = "Field `CPR` writer - Comparison x Period"]
16pub type CprW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
17#[doc = "Field `CPRCNT` reader - Comparison x Period Counter"]
18pub type CprcntR = crate::FieldReader;
19#[doc = "Field `CPRCNT` writer - Comparison x Period Counter"]
20pub type CprcntW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
21#[doc = "Field `CUPR` reader - Comparison x Update Period"]
22pub type CuprR = crate::FieldReader;
23#[doc = "Field `CUPR` writer - Comparison x Update Period"]
24pub type CuprW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
25#[doc = "Field `CUPRCNT` reader - Comparison x Update Period Counter"]
26pub type CuprcntR = crate::FieldReader;
27#[doc = "Field `CUPRCNT` writer - Comparison x Update Period Counter"]
28pub type CuprcntW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
29impl R {
30 #[doc = "Bit 0 - Comparison x Enable"]
31 #[inline(always)]
32 pub fn cen(&self) -> CenR {
33 CenR::new((self.bits & 1) != 0)
34 }
35 #[doc = "Bits 4:7 - Comparison x Trigger"]
36 #[inline(always)]
37 pub fn ctr(&self) -> CtrR {
38 CtrR::new(((self.bits >> 4) & 0x0f) as u8)
39 }
40 #[doc = "Bits 8:11 - Comparison x Period"]
41 #[inline(always)]
42 pub fn cpr(&self) -> CprR {
43 CprR::new(((self.bits >> 8) & 0x0f) as u8)
44 }
45 #[doc = "Bits 12:15 - Comparison x Period Counter"]
46 #[inline(always)]
47 pub fn cprcnt(&self) -> CprcntR {
48 CprcntR::new(((self.bits >> 12) & 0x0f) as u8)
49 }
50 #[doc = "Bits 16:19 - Comparison x Update Period"]
51 #[inline(always)]
52 pub fn cupr(&self) -> CuprR {
53 CuprR::new(((self.bits >> 16) & 0x0f) as u8)
54 }
55 #[doc = "Bits 20:23 - Comparison x Update Period Counter"]
56 #[inline(always)]
57 pub fn cuprcnt(&self) -> CuprcntR {
58 CuprcntR::new(((self.bits >> 20) & 0x0f) as u8)
59 }
60}
61impl W {
62 #[doc = "Bit 0 - Comparison x Enable"]
63 #[inline(always)]
64 #[must_use]
65 pub fn cen(&mut self) -> CenW<Cmpm7Spec> {
66 CenW::new(self, 0)
67 }
68 #[doc = "Bits 4:7 - Comparison x Trigger"]
69 #[inline(always)]
70 #[must_use]
71 pub fn ctr(&mut self) -> CtrW<Cmpm7Spec> {
72 CtrW::new(self, 4)
73 }
74 #[doc = "Bits 8:11 - Comparison x Period"]
75 #[inline(always)]
76 #[must_use]
77 pub fn cpr(&mut self) -> CprW<Cmpm7Spec> {
78 CprW::new(self, 8)
79 }
80 #[doc = "Bits 12:15 - Comparison x Period Counter"]
81 #[inline(always)]
82 #[must_use]
83 pub fn cprcnt(&mut self) -> CprcntW<Cmpm7Spec> {
84 CprcntW::new(self, 12)
85 }
86 #[doc = "Bits 16:19 - Comparison x Update Period"]
87 #[inline(always)]
88 #[must_use]
89 pub fn cupr(&mut self) -> CuprW<Cmpm7Spec> {
90 CuprW::new(self, 16)
91 }
92 #[doc = "Bits 20:23 - Comparison x Update Period Counter"]
93 #[inline(always)]
94 #[must_use]
95 pub fn cuprcnt(&mut self) -> CuprcntW<Cmpm7Spec> {
96 CuprcntW::new(self, 20)
97 }
98}
99#[doc = "PWM Comparison 7 Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmpm7::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmpm7::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct Cmpm7Spec;
101impl crate::RegisterSpec for Cmpm7Spec {
102 type Ux = u32;
103}
104#[doc = "`read()` method returns [`cmpm7::R`](R) reader structure"]
105impl crate::Readable for Cmpm7Spec {}
106#[doc = "`write(|w| ..)` method takes [`cmpm7::W`](W) writer structure"]
107impl crate::Writable for Cmpm7Spec {
108 type Safety = crate::Unsafe;
109 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
110 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111}
112#[doc = "`reset()` method sets CMPM7 to value 0"]
113impl crate::Resettable for Cmpm7Spec {
114 const RESET_VALUE: u32 = 0;
115}