1pub type R = crate::R<CTRLrs>;
3pub type W = crate::W<CTRLrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10#[repr(u8)]
11pub enum REPMODE {
12 Free = 0,
14 Oneshot = 1,
16 Buffered = 2,
18 Double = 3,
20}
21impl From<REPMODE> for u8 {
22 #[inline(always)]
23 fn from(variant: REPMODE) -> Self {
24 variant as _
25 }
26}
27impl crate::FieldSpec for REPMODE {
28 type Ux = u8;
29}
30impl crate::IsEnum for REPMODE {}
31pub type RepmodeR = crate::FieldReader<REPMODE>;
33impl RepmodeR {
34 #[inline(always)]
36 pub const fn variant(&self) -> REPMODE {
37 match self.bits {
38 0 => REPMODE::Free,
39 1 => REPMODE::Oneshot,
40 2 => REPMODE::Buffered,
41 3 => REPMODE::Double,
42 _ => unreachable!(),
43 }
44 }
45 #[inline(always)]
47 pub fn is_free(&self) -> bool {
48 *self == REPMODE::Free
49 }
50 #[inline(always)]
52 pub fn is_oneshot(&self) -> bool {
53 *self == REPMODE::Oneshot
54 }
55 #[inline(always)]
57 pub fn is_buffered(&self) -> bool {
58 *self == REPMODE::Buffered
59 }
60 #[inline(always)]
62 pub fn is_double(&self) -> bool {
63 *self == REPMODE::Double
64 }
65}
66pub type RepmodeW<'a, REG> = crate::FieldWriter<'a, REG, 2, REPMODE, crate::Safe>;
68impl<'a, REG> RepmodeW<'a, REG>
69where
70 REG: crate::Writable + crate::RegisterSpec,
71 REG::Ux: From<u8>,
72{
73 #[inline(always)]
75 pub fn free(self) -> &'a mut crate::W<REG> {
76 self.variant(REPMODE::Free)
77 }
78 #[inline(always)]
80 pub fn oneshot(self) -> &'a mut crate::W<REG> {
81 self.variant(REPMODE::Oneshot)
82 }
83 #[inline(always)]
85 pub fn buffered(self) -> &'a mut crate::W<REG> {
86 self.variant(REPMODE::Buffered)
87 }
88 #[inline(always)]
90 pub fn double(self) -> &'a mut crate::W<REG> {
91 self.variant(REPMODE::Double)
92 }
93}
94#[cfg_attr(feature = "defmt", derive(defmt::Format))]
98#[derive(Clone, Copy, Debug, PartialEq, Eq)]
99#[repr(u8)]
100pub enum UFOA0 {
101 None = 0,
103 Toggle = 1,
105 Pulse = 2,
107 Pwm = 3,
109}
110impl From<UFOA0> for u8 {
111 #[inline(always)]
112 fn from(variant: UFOA0) -> Self {
113 variant as _
114 }
115}
116impl crate::FieldSpec for UFOA0 {
117 type Ux = u8;
118}
119impl crate::IsEnum for UFOA0 {}
120pub type Ufoa0R = crate::FieldReader<UFOA0>;
122impl Ufoa0R {
123 #[inline(always)]
125 pub const fn variant(&self) -> UFOA0 {
126 match self.bits {
127 0 => UFOA0::None,
128 1 => UFOA0::Toggle,
129 2 => UFOA0::Pulse,
130 3 => UFOA0::Pwm,
131 _ => unreachable!(),
132 }
133 }
134 #[inline(always)]
136 pub fn is_none(&self) -> bool {
137 *self == UFOA0::None
138 }
139 #[inline(always)]
141 pub fn is_toggle(&self) -> bool {
142 *self == UFOA0::Toggle
143 }
144 #[inline(always)]
146 pub fn is_pulse(&self) -> bool {
147 *self == UFOA0::Pulse
148 }
149 #[inline(always)]
151 pub fn is_pwm(&self) -> bool {
152 *self == UFOA0::Pwm
153 }
154}
155pub type Ufoa0W<'a, REG> = crate::FieldWriter<'a, REG, 2, UFOA0, crate::Safe>;
157impl<'a, REG> Ufoa0W<'a, REG>
158where
159 REG: crate::Writable + crate::RegisterSpec,
160 REG::Ux: From<u8>,
161{
162 #[inline(always)]
164 pub fn none(self) -> &'a mut crate::W<REG> {
165 self.variant(UFOA0::None)
166 }
167 #[inline(always)]
169 pub fn toggle(self) -> &'a mut crate::W<REG> {
170 self.variant(UFOA0::Toggle)
171 }
172 #[inline(always)]
174 pub fn pulse(self) -> &'a mut crate::W<REG> {
175 self.variant(UFOA0::Pulse)
176 }
177 #[inline(always)]
179 pub fn pwm(self) -> &'a mut crate::W<REG> {
180 self.variant(UFOA0::Pwm)
181 }
182}
183#[cfg_attr(feature = "defmt", derive(defmt::Format))]
187#[derive(Clone, Copy, Debug, PartialEq, Eq)]
188#[repr(u8)]
189pub enum UFOA1 {
190 None = 0,
192 Toggle = 1,
194 Pulse = 2,
196 Pwm = 3,
198}
199impl From<UFOA1> for u8 {
200 #[inline(always)]
201 fn from(variant: UFOA1) -> Self {
202 variant as _
203 }
204}
205impl crate::FieldSpec for UFOA1 {
206 type Ux = u8;
207}
208impl crate::IsEnum for UFOA1 {}
209pub type Ufoa1R = crate::FieldReader<UFOA1>;
211impl Ufoa1R {
212 #[inline(always)]
214 pub const fn variant(&self) -> UFOA1 {
215 match self.bits {
216 0 => UFOA1::None,
217 1 => UFOA1::Toggle,
218 2 => UFOA1::Pulse,
219 3 => UFOA1::Pwm,
220 _ => unreachable!(),
221 }
222 }
223 #[inline(always)]
225 pub fn is_none(&self) -> bool {
226 *self == UFOA1::None
227 }
228 #[inline(always)]
230 pub fn is_toggle(&self) -> bool {
231 *self == UFOA1::Toggle
232 }
233 #[inline(always)]
235 pub fn is_pulse(&self) -> bool {
236 *self == UFOA1::Pulse
237 }
238 #[inline(always)]
240 pub fn is_pwm(&self) -> bool {
241 *self == UFOA1::Pwm
242 }
243}
244pub type Ufoa1W<'a, REG> = crate::FieldWriter<'a, REG, 2, UFOA1, crate::Safe>;
246impl<'a, REG> Ufoa1W<'a, REG>
247where
248 REG: crate::Writable + crate::RegisterSpec,
249 REG::Ux: From<u8>,
250{
251 #[inline(always)]
253 pub fn none(self) -> &'a mut crate::W<REG> {
254 self.variant(UFOA1::None)
255 }
256 #[inline(always)]
258 pub fn toggle(self) -> &'a mut crate::W<REG> {
259 self.variant(UFOA1::Toggle)
260 }
261 #[inline(always)]
263 pub fn pulse(self) -> &'a mut crate::W<REG> {
264 self.variant(UFOA1::Pulse)
265 }
266 #[inline(always)]
268 pub fn pwm(self) -> &'a mut crate::W<REG> {
269 self.variant(UFOA1::Pwm)
270 }
271}
272pub type Opol0R = crate::BitReader;
274pub type Opol0W<'a, REG> = crate::BitWriter<'a, REG>;
276pub type Opol1R = crate::BitReader;
278pub type Opol1W<'a, REG> = crate::BitWriter<'a, REG>;
280pub type BuftopR = crate::BitReader;
282pub type BuftopW<'a, REG> = crate::BitWriter<'a, REG>;
284pub type Comp0topR = crate::BitReader;
286pub type Comp0topW<'a, REG> = crate::BitWriter<'a, REG>;
288pub type DebugrunR = crate::BitReader;
290pub type DebugrunW<'a, REG> = crate::BitWriter<'a, REG>;
292impl R {
293 #[inline(always)]
295 pub fn repmode(&self) -> RepmodeR {
296 RepmodeR::new((self.bits & 3) as u8)
297 }
298 #[inline(always)]
300 pub fn ufoa0(&self) -> Ufoa0R {
301 Ufoa0R::new(((self.bits >> 2) & 3) as u8)
302 }
303 #[inline(always)]
305 pub fn ufoa1(&self) -> Ufoa1R {
306 Ufoa1R::new(((self.bits >> 4) & 3) as u8)
307 }
308 #[inline(always)]
310 pub fn opol0(&self) -> Opol0R {
311 Opol0R::new(((self.bits >> 6) & 1) != 0)
312 }
313 #[inline(always)]
315 pub fn opol1(&self) -> Opol1R {
316 Opol1R::new(((self.bits >> 7) & 1) != 0)
317 }
318 #[inline(always)]
320 pub fn buftop(&self) -> BuftopR {
321 BuftopR::new(((self.bits >> 8) & 1) != 0)
322 }
323 #[inline(always)]
325 pub fn comp0top(&self) -> Comp0topR {
326 Comp0topR::new(((self.bits >> 9) & 1) != 0)
327 }
328 #[inline(always)]
330 pub fn debugrun(&self) -> DebugrunR {
331 DebugrunR::new(((self.bits >> 12) & 1) != 0)
332 }
333}
334impl core::fmt::Debug for R {
335 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
336 f.debug_struct("CTRL")
337 .field("repmode", &self.repmode())
338 .field("ufoa0", &self.ufoa0())
339 .field("ufoa1", &self.ufoa1())
340 .field("opol0", &self.opol0())
341 .field("opol1", &self.opol1())
342 .field("buftop", &self.buftop())
343 .field("comp0top", &self.comp0top())
344 .field("debugrun", &self.debugrun())
345 .finish()
346 }
347}
348impl W {
349 #[inline(always)]
351 pub fn repmode(&mut self) -> RepmodeW<'_, CTRLrs> {
352 RepmodeW::new(self, 0)
353 }
354 #[inline(always)]
356 pub fn ufoa0(&mut self) -> Ufoa0W<'_, CTRLrs> {
357 Ufoa0W::new(self, 2)
358 }
359 #[inline(always)]
361 pub fn ufoa1(&mut self) -> Ufoa1W<'_, CTRLrs> {
362 Ufoa1W::new(self, 4)
363 }
364 #[inline(always)]
366 pub fn opol0(&mut self) -> Opol0W<'_, CTRLrs> {
367 Opol0W::new(self, 6)
368 }
369 #[inline(always)]
371 pub fn opol1(&mut self) -> Opol1W<'_, CTRLrs> {
372 Opol1W::new(self, 7)
373 }
374 #[inline(always)]
376 pub fn buftop(&mut self) -> BuftopW<'_, CTRLrs> {
377 BuftopW::new(self, 8)
378 }
379 #[inline(always)]
381 pub fn comp0top(&mut self) -> Comp0topW<'_, CTRLrs> {
382 Comp0topW::new(self, 9)
383 }
384 #[inline(always)]
386 pub fn debugrun(&mut self) -> DebugrunW<'_, CTRLrs> {
387 DebugrunW::new(self, 12)
388 }
389}
390pub struct CTRLrs;
394impl crate::RegisterSpec for CTRLrs {
395 type Ux = u32;
396}
397impl crate::Readable for CTRLrs {}
399impl crate::Writable for CTRLrs {
401 type Safety = crate::Unsafe;
402}
403impl crate::Resettable for CTRLrs {}