ht32f523x2/mctm0/
cntcfr.rs

1#[doc = "Register `CNTCFR` reader"]
2pub type R = crate::R<CntcfrSpec>;
3#[doc = "Register `CNTCFR` writer"]
4pub type W = crate::W<CntcfrSpec>;
5#[doc = "Field `UEV1DIS` reader - UEV1DIS"]
6pub type Uev1disR = crate::BitReader;
7#[doc = "Field `UEV1DIS` writer - UEV1DIS"]
8pub type Uev1disW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `UGDIS` reader - UGDIS"]
10pub type UgdisR = crate::BitReader;
11#[doc = "Field `UGDIS` writer - UGDIS"]
12pub type UgdisW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CKDIV` reader - CKDIV"]
14pub type CkdivR = crate::FieldReader;
15#[doc = "Field `CKDIV` writer - CKDIV"]
16pub type CkdivW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17#[doc = "Field `CMSEL` reader - CMSEL"]
18pub type CmselR = crate::FieldReader;
19#[doc = "Field `CMSEL` writer - CMSEL"]
20pub type CmselW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
21#[doc = "Field `DIR` reader - DIR"]
22pub type DirR = crate::BitReader;
23#[doc = "Field `DIR` writer - DIR"]
24pub type DirW<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 0 - UEV1DIS"]
27    #[inline(always)]
28    pub fn uev1dis(&self) -> Uev1disR {
29        Uev1disR::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1 - UGDIS"]
32    #[inline(always)]
33    pub fn ugdis(&self) -> UgdisR {
34        UgdisR::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bits 8:9 - CKDIV"]
37    #[inline(always)]
38    pub fn ckdiv(&self) -> CkdivR {
39        CkdivR::new(((self.bits >> 8) & 3) as u8)
40    }
41    #[doc = "Bits 16:17 - CMSEL"]
42    #[inline(always)]
43    pub fn cmsel(&self) -> CmselR {
44        CmselR::new(((self.bits >> 16) & 3) as u8)
45    }
46    #[doc = "Bit 24 - DIR"]
47    #[inline(always)]
48    pub fn dir(&self) -> DirR {
49        DirR::new(((self.bits >> 24) & 1) != 0)
50    }
51}
52impl W {
53    #[doc = "Bit 0 - UEV1DIS"]
54    #[inline(always)]
55    #[must_use]
56    pub fn uev1dis(&mut self) -> Uev1disW<CntcfrSpec> {
57        Uev1disW::new(self, 0)
58    }
59    #[doc = "Bit 1 - UGDIS"]
60    #[inline(always)]
61    #[must_use]
62    pub fn ugdis(&mut self) -> UgdisW<CntcfrSpec> {
63        UgdisW::new(self, 1)
64    }
65    #[doc = "Bits 8:9 - CKDIV"]
66    #[inline(always)]
67    #[must_use]
68    pub fn ckdiv(&mut self) -> CkdivW<CntcfrSpec> {
69        CkdivW::new(self, 8)
70    }
71    #[doc = "Bits 16:17 - CMSEL"]
72    #[inline(always)]
73    #[must_use]
74    pub fn cmsel(&mut self) -> CmselW<CntcfrSpec> {
75        CmselW::new(self, 16)
76    }
77    #[doc = "Bit 24 - DIR"]
78    #[inline(always)]
79    #[must_use]
80    pub fn dir(&mut self) -> DirW<CntcfrSpec> {
81        DirW::new(self, 24)
82    }
83}
84#[doc = "CNTCFR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cntcfr::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 [`cntcfr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
85pub struct CntcfrSpec;
86impl crate::RegisterSpec for CntcfrSpec {
87    type Ux = u32;
88}
89#[doc = "`read()` method returns [`cntcfr::R`](R) reader structure"]
90impl crate::Readable for CntcfrSpec {}
91#[doc = "`write(|w| ..)` method takes [`cntcfr::W`](W) writer structure"]
92impl crate::Writable for CntcfrSpec {
93    type Safety = crate::Unsafe;
94    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
95    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
96}
97#[doc = "`reset()` method sets CNTCFR to value 0"]
98impl crate::Resettable for CntcfrSpec {
99    const RESET_VALUE: u32 = 0;
100}