stm32g4/stm32g484/tim1/
af2.rs1pub type R = crate::R<AF2rs>;
3pub type W = crate::W<AF2rs>;
5pub type BKINE_R = crate::BitReader;
7pub type BKINE_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type BK2CMP1E_R = crate::BitReader;
11pub type BK2CMP1E_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type BK2CMP2E_R = crate::BitReader;
15pub type BK2CMP2E_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type BK2CMP3E_R = crate::BitReader;
19pub type BK2CMP3E_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type BK2CMP4E_R = crate::BitReader;
23pub type BK2CMP4E_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type BK2CMP5E_R = crate::BitReader;
27pub type BK2CMP5E_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type BK2CMP6E_R = crate::BitReader;
31pub type BK2CMP6E_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type BK2CMP7E_R = crate::BitReader;
35pub type BK2CMP7E_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type BK2INP_R = crate::BitReader;
39pub type BK2INP_W<'a, REG> = crate::BitWriter<'a, REG>;
41pub type BK2CMP1P_R = crate::BitReader;
43pub type BK2CMP1P_W<'a, REG> = crate::BitWriter<'a, REG>;
45pub type BK2CMP2P_R = crate::BitReader;
47pub type BK2CMP2P_W<'a, REG> = crate::BitWriter<'a, REG>;
49pub type BK2CMP3P_R = crate::BitReader;
51pub type BK2CMP3P_W<'a, REG> = crate::BitWriter<'a, REG>;
53pub type BK2CMP4P_R = crate::BitReader;
55pub type BK2CMP4P_W<'a, REG> = crate::BitWriter<'a, REG>;
57pub type OCRSEL_R = crate::FieldReader;
59pub type OCRSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
61impl R {
62 #[inline(always)]
64 pub fn bkine(&self) -> BKINE_R {
65 BKINE_R::new((self.bits & 1) != 0)
66 }
67 #[inline(always)]
69 pub fn bk2cmp1e(&self) -> BK2CMP1E_R {
70 BK2CMP1E_R::new(((self.bits >> 1) & 1) != 0)
71 }
72 #[inline(always)]
74 pub fn bk2cmp2e(&self) -> BK2CMP2E_R {
75 BK2CMP2E_R::new(((self.bits >> 2) & 1) != 0)
76 }
77 #[inline(always)]
79 pub fn bk2cmp3e(&self) -> BK2CMP3E_R {
80 BK2CMP3E_R::new(((self.bits >> 3) & 1) != 0)
81 }
82 #[inline(always)]
84 pub fn bk2cmp4e(&self) -> BK2CMP4E_R {
85 BK2CMP4E_R::new(((self.bits >> 4) & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn bk2cmp5e(&self) -> BK2CMP5E_R {
90 BK2CMP5E_R::new(((self.bits >> 5) & 1) != 0)
91 }
92 #[inline(always)]
94 pub fn bk2cmp6e(&self) -> BK2CMP6E_R {
95 BK2CMP6E_R::new(((self.bits >> 6) & 1) != 0)
96 }
97 #[inline(always)]
99 pub fn bk2cmp7e(&self) -> BK2CMP7E_R {
100 BK2CMP7E_R::new(((self.bits >> 7) & 1) != 0)
101 }
102 #[inline(always)]
104 pub fn bk2inp(&self) -> BK2INP_R {
105 BK2INP_R::new(((self.bits >> 9) & 1) != 0)
106 }
107 #[inline(always)]
109 pub fn bk2cmp1p(&self) -> BK2CMP1P_R {
110 BK2CMP1P_R::new(((self.bits >> 10) & 1) != 0)
111 }
112 #[inline(always)]
114 pub fn bk2cmp2p(&self) -> BK2CMP2P_R {
115 BK2CMP2P_R::new(((self.bits >> 11) & 1) != 0)
116 }
117 #[inline(always)]
119 pub fn bk2cmp3p(&self) -> BK2CMP3P_R {
120 BK2CMP3P_R::new(((self.bits >> 12) & 1) != 0)
121 }
122 #[inline(always)]
124 pub fn bk2cmp4p(&self) -> BK2CMP4P_R {
125 BK2CMP4P_R::new(((self.bits >> 13) & 1) != 0)
126 }
127 #[inline(always)]
129 pub fn ocrsel(&self) -> OCRSEL_R {
130 OCRSEL_R::new(((self.bits >> 16) & 7) as u8)
131 }
132}
133impl core::fmt::Debug for R {
134 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
135 f.debug_struct("AF2")
136 .field("ocrsel", &self.ocrsel())
137 .field("bk2cmp4p", &self.bk2cmp4p())
138 .field("bk2cmp3p", &self.bk2cmp3p())
139 .field("bk2cmp2p", &self.bk2cmp2p())
140 .field("bk2cmp1p", &self.bk2cmp1p())
141 .field("bk2inp", &self.bk2inp())
142 .field("bk2cmp7e", &self.bk2cmp7e())
143 .field("bk2cmp6e", &self.bk2cmp6e())
144 .field("bk2cmp5e", &self.bk2cmp5e())
145 .field("bk2cmp4e", &self.bk2cmp4e())
146 .field("bk2cmp3e", &self.bk2cmp3e())
147 .field("bk2cmp2e", &self.bk2cmp2e())
148 .field("bk2cmp1e", &self.bk2cmp1e())
149 .field("bkine", &self.bkine())
150 .finish()
151 }
152}
153impl W {
154 #[inline(always)]
156 pub fn bkine(&mut self) -> BKINE_W<AF2rs> {
157 BKINE_W::new(self, 0)
158 }
159 #[inline(always)]
161 pub fn bk2cmp1e(&mut self) -> BK2CMP1E_W<AF2rs> {
162 BK2CMP1E_W::new(self, 1)
163 }
164 #[inline(always)]
166 pub fn bk2cmp2e(&mut self) -> BK2CMP2E_W<AF2rs> {
167 BK2CMP2E_W::new(self, 2)
168 }
169 #[inline(always)]
171 pub fn bk2cmp3e(&mut self) -> BK2CMP3E_W<AF2rs> {
172 BK2CMP3E_W::new(self, 3)
173 }
174 #[inline(always)]
176 pub fn bk2cmp4e(&mut self) -> BK2CMP4E_W<AF2rs> {
177 BK2CMP4E_W::new(self, 4)
178 }
179 #[inline(always)]
181 pub fn bk2cmp5e(&mut self) -> BK2CMP5E_W<AF2rs> {
182 BK2CMP5E_W::new(self, 5)
183 }
184 #[inline(always)]
186 pub fn bk2cmp6e(&mut self) -> BK2CMP6E_W<AF2rs> {
187 BK2CMP6E_W::new(self, 6)
188 }
189 #[inline(always)]
191 pub fn bk2cmp7e(&mut self) -> BK2CMP7E_W<AF2rs> {
192 BK2CMP7E_W::new(self, 7)
193 }
194 #[inline(always)]
196 pub fn bk2inp(&mut self) -> BK2INP_W<AF2rs> {
197 BK2INP_W::new(self, 9)
198 }
199 #[inline(always)]
201 pub fn bk2cmp1p(&mut self) -> BK2CMP1P_W<AF2rs> {
202 BK2CMP1P_W::new(self, 10)
203 }
204 #[inline(always)]
206 pub fn bk2cmp2p(&mut self) -> BK2CMP2P_W<AF2rs> {
207 BK2CMP2P_W::new(self, 11)
208 }
209 #[inline(always)]
211 pub fn bk2cmp3p(&mut self) -> BK2CMP3P_W<AF2rs> {
212 BK2CMP3P_W::new(self, 12)
213 }
214 #[inline(always)]
216 pub fn bk2cmp4p(&mut self) -> BK2CMP4P_W<AF2rs> {
217 BK2CMP4P_W::new(self, 13)
218 }
219 #[inline(always)]
221 pub fn ocrsel(&mut self) -> OCRSEL_W<AF2rs> {
222 OCRSEL_W::new(self, 16)
223 }
224}
225pub struct AF2rs;
231impl crate::RegisterSpec for AF2rs {
232 type Ux = u32;
233}
234impl crate::Readable for AF2rs {}
236impl crate::Writable for AF2rs {
238 type Safety = crate::Unsafe;
239}
240impl crate::Resettable for AF2rs {}