PY32f071cxx_pac/tim14/
cr1.rs1#[doc = "Register `CR1` reader"]
2pub struct R(crate::R<CR1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CR1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CR1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CR1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CR1` writer"]
17pub struct W(crate::W<CR1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CR1_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<CR1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CR1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CEN` reader - desc CEN"]
38pub type CEN_R = crate::BitReader<bool>;
39#[doc = "Field `CEN` writer - desc CEN"]
40pub type CEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
41#[doc = "Field `UDIS` reader - desc UDIS"]
42pub type UDIS_R = crate::BitReader<bool>;
43#[doc = "Field `UDIS` writer - desc UDIS"]
44pub type UDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
45#[doc = "Field `URS` reader - desc URS"]
46pub type URS_R = crate::BitReader<bool>;
47#[doc = "Field `URS` writer - desc URS"]
48pub type URS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
49#[doc = "Field `OPM` reader - desc OPM"]
50pub type OPM_R = crate::BitReader<bool>;
51#[doc = "Field `OPM` writer - desc OPM"]
52pub type OPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
53#[doc = "Field `DIR` reader - desc DIR"]
54pub type DIR_R = crate::BitReader<bool>;
55#[doc = "Field `DIR` writer - desc DIR"]
56pub type DIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
57#[doc = "Field `CMS` reader - desc CMS"]
58pub type CMS_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `CMS` writer - desc CMS"]
60pub type CMS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR1_SPEC, u8, u8, 2, O>;
61#[doc = "Field `ARPE` reader - desc ARPE"]
62pub type ARPE_R = crate::BitReader<bool>;
63#[doc = "Field `ARPE` writer - desc ARPE"]
64pub type ARPE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR1_SPEC, bool, O>;
65#[doc = "Field `CKD` reader - desc CKD"]
66pub type CKD_R = crate::FieldReader<u8, u8>;
67#[doc = "Field `CKD` writer - desc CKD"]
68pub type CKD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR1_SPEC, u8, u8, 2, O>;
69impl R {
70    #[doc = "Bit 0 - desc CEN"]
71    #[inline(always)]
72    pub fn cen(&self) -> CEN_R {
73        CEN_R::new((self.bits & 1) != 0)
74    }
75    #[doc = "Bit 1 - desc UDIS"]
76    #[inline(always)]
77    pub fn udis(&self) -> UDIS_R {
78        UDIS_R::new(((self.bits >> 1) & 1) != 0)
79    }
80    #[doc = "Bit 2 - desc URS"]
81    #[inline(always)]
82    pub fn urs(&self) -> URS_R {
83        URS_R::new(((self.bits >> 2) & 1) != 0)
84    }
85    #[doc = "Bit 3 - desc OPM"]
86    #[inline(always)]
87    pub fn opm(&self) -> OPM_R {
88        OPM_R::new(((self.bits >> 3) & 1) != 0)
89    }
90    #[doc = "Bit 4 - desc DIR"]
91    #[inline(always)]
92    pub fn dir(&self) -> DIR_R {
93        DIR_R::new(((self.bits >> 4) & 1) != 0)
94    }
95    #[doc = "Bits 5:6 - desc CMS"]
96    #[inline(always)]
97    pub fn cms(&self) -> CMS_R {
98        CMS_R::new(((self.bits >> 5) & 3) as u8)
99    }
100    #[doc = "Bit 7 - desc ARPE"]
101    #[inline(always)]
102    pub fn arpe(&self) -> ARPE_R {
103        ARPE_R::new(((self.bits >> 7) & 1) != 0)
104    }
105    #[doc = "Bits 8:9 - desc CKD"]
106    #[inline(always)]
107    pub fn ckd(&self) -> CKD_R {
108        CKD_R::new(((self.bits >> 8) & 3) as u8)
109    }
110}
111impl W {
112    #[doc = "Bit 0 - desc CEN"]
113    #[inline(always)]
114    pub fn cen(&mut self) -> CEN_W<0> {
115        CEN_W::new(self)
116    }
117    #[doc = "Bit 1 - desc UDIS"]
118    #[inline(always)]
119    pub fn udis(&mut self) -> UDIS_W<1> {
120        UDIS_W::new(self)
121    }
122    #[doc = "Bit 2 - desc URS"]
123    #[inline(always)]
124    pub fn urs(&mut self) -> URS_W<2> {
125        URS_W::new(self)
126    }
127    #[doc = "Bit 3 - desc OPM"]
128    #[inline(always)]
129    pub fn opm(&mut self) -> OPM_W<3> {
130        OPM_W::new(self)
131    }
132    #[doc = "Bit 4 - desc DIR"]
133    #[inline(always)]
134    pub fn dir(&mut self) -> DIR_W<4> {
135        DIR_W::new(self)
136    }
137    #[doc = "Bits 5:6 - desc CMS"]
138    #[inline(always)]
139    pub fn cms(&mut self) -> CMS_W<5> {
140        CMS_W::new(self)
141    }
142    #[doc = "Bit 7 - desc ARPE"]
143    #[inline(always)]
144    pub fn arpe(&mut self) -> ARPE_W<7> {
145        ARPE_W::new(self)
146    }
147    #[doc = "Bits 8:9 - desc CKD"]
148    #[inline(always)]
149    pub fn ckd(&mut self) -> CKD_W<8> {
150        CKD_W::new(self)
151    }
152    #[doc = "Writes raw bits to the register."]
153    #[inline(always)]
154    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
155        self.0.bits(bits);
156        self
157    }
158}
159#[doc = "desc CR1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr1](index.html) module"]
160pub struct CR1_SPEC;
161impl crate::RegisterSpec for CR1_SPEC {
162    type Ux = u32;
163}
164#[doc = "`read()` method returns [cr1::R](R) reader structure"]
165impl crate::Readable for CR1_SPEC {
166    type Reader = R;
167}
168#[doc = "`write(|w| ..)` method takes [cr1::W](W) writer structure"]
169impl crate::Writable for CR1_SPEC {
170    type Writer = W;
171}
172#[doc = "`reset()` method sets CR1 to value 0"]
173impl crate::Resettable for CR1_SPEC {
174    #[inline(always)]
175    fn reset_value() -> Self::Ux {
176        0
177    }
178}