py32f0/py32f003/tim16/
bdtr.rs1pub struct R(crate::R<BDTR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BDTR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BDTR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BDTR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<BDTR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<BDTR_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<BDTR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<BDTR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type DTG_R = crate::FieldReader<u8, u8>;
39pub type DTG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BDTR_SPEC, u8, u8, 8, O>;
41pub type LOCK_R = crate::FieldReader<u8, u8>;
43pub type LOCK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BDTR_SPEC, u8, u8, 2, O>;
45pub type OSSI_R = crate::BitReader<bool>;
47pub type OSSI_W<'a, const O: u8> = crate::BitWriter<'a, u32, BDTR_SPEC, bool, O>;
49pub type OSSR_R = crate::BitReader<bool>;
51pub type OSSR_W<'a, const O: u8> = crate::BitWriter<'a, u32, BDTR_SPEC, bool, O>;
53pub type BKE_R = crate::BitReader<bool>;
55pub type BKE_W<'a, const O: u8> = crate::BitWriter<'a, u32, BDTR_SPEC, bool, O>;
57pub type BKP_R = crate::BitReader<bool>;
59pub type BKP_W<'a, const O: u8> = crate::BitWriter<'a, u32, BDTR_SPEC, bool, O>;
61pub type AOE_R = crate::BitReader<bool>;
63pub type AOE_W<'a, const O: u8> = crate::BitWriter<'a, u32, BDTR_SPEC, bool, O>;
65pub type MOE_R = crate::BitReader<bool>;
67pub type MOE_W<'a, const O: u8> = crate::BitWriter<'a, u32, BDTR_SPEC, bool, O>;
69impl R {
70 #[inline(always)]
72 pub fn dtg(&self) -> DTG_R {
73 DTG_R::new((self.bits & 0xff) as u8)
74 }
75 #[inline(always)]
77 pub fn lock(&self) -> LOCK_R {
78 LOCK_R::new(((self.bits >> 8) & 3) as u8)
79 }
80 #[inline(always)]
82 pub fn ossi(&self) -> OSSI_R {
83 OSSI_R::new(((self.bits >> 10) & 1) != 0)
84 }
85 #[inline(always)]
87 pub fn ossr(&self) -> OSSR_R {
88 OSSR_R::new(((self.bits >> 11) & 1) != 0)
89 }
90 #[inline(always)]
92 pub fn bke(&self) -> BKE_R {
93 BKE_R::new(((self.bits >> 12) & 1) != 0)
94 }
95 #[inline(always)]
97 pub fn bkp(&self) -> BKP_R {
98 BKP_R::new(((self.bits >> 13) & 1) != 0)
99 }
100 #[inline(always)]
102 pub fn aoe(&self) -> AOE_R {
103 AOE_R::new(((self.bits >> 14) & 1) != 0)
104 }
105 #[inline(always)]
107 pub fn moe(&self) -> MOE_R {
108 MOE_R::new(((self.bits >> 15) & 1) != 0)
109 }
110}
111impl W {
112 #[inline(always)]
114 #[must_use]
115 pub fn dtg(&mut self) -> DTG_W<0> {
116 DTG_W::new(self)
117 }
118 #[inline(always)]
120 #[must_use]
121 pub fn lock(&mut self) -> LOCK_W<8> {
122 LOCK_W::new(self)
123 }
124 #[inline(always)]
126 #[must_use]
127 pub fn ossi(&mut self) -> OSSI_W<10> {
128 OSSI_W::new(self)
129 }
130 #[inline(always)]
132 #[must_use]
133 pub fn ossr(&mut self) -> OSSR_W<11> {
134 OSSR_W::new(self)
135 }
136 #[inline(always)]
138 #[must_use]
139 pub fn bke(&mut self) -> BKE_W<12> {
140 BKE_W::new(self)
141 }
142 #[inline(always)]
144 #[must_use]
145 pub fn bkp(&mut self) -> BKP_W<13> {
146 BKP_W::new(self)
147 }
148 #[inline(always)]
150 #[must_use]
151 pub fn aoe(&mut self) -> AOE_W<14> {
152 AOE_W::new(self)
153 }
154 #[inline(always)]
156 #[must_use]
157 pub fn moe(&mut self) -> MOE_W<15> {
158 MOE_W::new(self)
159 }
160 #[inline(always)]
162 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
163 self.0.bits(bits);
164 self
165 }
166}
167pub struct BDTR_SPEC;
173impl crate::RegisterSpec for BDTR_SPEC {
174 type Ux = u32;
175}
176impl crate::Readable for BDTR_SPEC {
178 type Reader = R;
179}
180impl crate::Writable for BDTR_SPEC {
182 type Writer = W;
183 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
184 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
185}
186impl crate::Resettable for BDTR_SPEC {
188 const RESET_VALUE: Self::Ux = 0;
189}