1pub type R = crate::R<CR2rs>;
3pub type W = crate::W<CR2rs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum RXDMAEN {
11 Disabled = 0,
13 Enabled = 1,
15}
16impl From<RXDMAEN> for bool {
17 #[inline(always)]
18 fn from(variant: RXDMAEN) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type RXDMAEN_R = crate::BitReader<RXDMAEN>;
24impl RXDMAEN_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> RXDMAEN {
28 match self.bits {
29 false => RXDMAEN::Disabled,
30 true => RXDMAEN::Enabled,
31 }
32 }
33 #[inline(always)]
35 pub fn is_disabled(&self) -> bool {
36 *self == RXDMAEN::Disabled
37 }
38 #[inline(always)]
40 pub fn is_enabled(&self) -> bool {
41 *self == RXDMAEN::Enabled
42 }
43}
44pub type RXDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, RXDMAEN>;
46impl<'a, REG> RXDMAEN_W<'a, REG>
47where
48 REG: crate::Writable + crate::RegisterSpec,
49{
50 #[inline(always)]
52 pub fn disabled(self) -> &'a mut crate::W<REG> {
53 self.variant(RXDMAEN::Disabled)
54 }
55 #[inline(always)]
57 pub fn enabled(self) -> &'a mut crate::W<REG> {
58 self.variant(RXDMAEN::Enabled)
59 }
60}
61#[cfg_attr(feature = "defmt", derive(defmt::Format))]
65#[derive(Clone, Copy, Debug, PartialEq, Eq)]
66pub enum TXDMAEN {
67 Disabled = 0,
69 Enabled = 1,
71}
72impl From<TXDMAEN> for bool {
73 #[inline(always)]
74 fn from(variant: TXDMAEN) -> Self {
75 variant as u8 != 0
76 }
77}
78pub type TXDMAEN_R = crate::BitReader<TXDMAEN>;
80impl TXDMAEN_R {
81 #[inline(always)]
83 pub const fn variant(&self) -> TXDMAEN {
84 match self.bits {
85 false => TXDMAEN::Disabled,
86 true => TXDMAEN::Enabled,
87 }
88 }
89 #[inline(always)]
91 pub fn is_disabled(&self) -> bool {
92 *self == TXDMAEN::Disabled
93 }
94 #[inline(always)]
96 pub fn is_enabled(&self) -> bool {
97 *self == TXDMAEN::Enabled
98 }
99}
100pub type TXDMAEN_W<'a, REG> = crate::BitWriter<'a, REG, TXDMAEN>;
102impl<'a, REG> TXDMAEN_W<'a, REG>
103where
104 REG: crate::Writable + crate::RegisterSpec,
105{
106 #[inline(always)]
108 pub fn disabled(self) -> &'a mut crate::W<REG> {
109 self.variant(TXDMAEN::Disabled)
110 }
111 #[inline(always)]
113 pub fn enabled(self) -> &'a mut crate::W<REG> {
114 self.variant(TXDMAEN::Enabled)
115 }
116}
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
121#[derive(Clone, Copy, Debug, PartialEq, Eq)]
122pub enum SSOE {
123 Disabled = 0,
125 Enabled = 1,
127}
128impl From<SSOE> for bool {
129 #[inline(always)]
130 fn from(variant: SSOE) -> Self {
131 variant as u8 != 0
132 }
133}
134pub type SSOE_R = crate::BitReader<SSOE>;
136impl SSOE_R {
137 #[inline(always)]
139 pub const fn variant(&self) -> SSOE {
140 match self.bits {
141 false => SSOE::Disabled,
142 true => SSOE::Enabled,
143 }
144 }
145 #[inline(always)]
147 pub fn is_disabled(&self) -> bool {
148 *self == SSOE::Disabled
149 }
150 #[inline(always)]
152 pub fn is_enabled(&self) -> bool {
153 *self == SSOE::Enabled
154 }
155}
156pub type SSOE_W<'a, REG> = crate::BitWriter<'a, REG, SSOE>;
158impl<'a, REG> SSOE_W<'a, REG>
159where
160 REG: crate::Writable + crate::RegisterSpec,
161{
162 #[inline(always)]
164 pub fn disabled(self) -> &'a mut crate::W<REG> {
165 self.variant(SSOE::Disabled)
166 }
167 #[inline(always)]
169 pub fn enabled(self) -> &'a mut crate::W<REG> {
170 self.variant(SSOE::Enabled)
171 }
172}
173#[cfg_attr(feature = "defmt", derive(defmt::Format))]
177#[derive(Clone, Copy, Debug, PartialEq, Eq)]
178pub enum FRF {
179 Motorola = 0,
181 Ti = 1,
183}
184impl From<FRF> for bool {
185 #[inline(always)]
186 fn from(variant: FRF) -> Self {
187 variant as u8 != 0
188 }
189}
190pub type FRF_R = crate::BitReader<FRF>;
192impl FRF_R {
193 #[inline(always)]
195 pub const fn variant(&self) -> FRF {
196 match self.bits {
197 false => FRF::Motorola,
198 true => FRF::Ti,
199 }
200 }
201 #[inline(always)]
203 pub fn is_motorola(&self) -> bool {
204 *self == FRF::Motorola
205 }
206 #[inline(always)]
208 pub fn is_ti(&self) -> bool {
209 *self == FRF::Ti
210 }
211}
212pub type FRF_W<'a, REG> = crate::BitWriter<'a, REG, FRF>;
214impl<'a, REG> FRF_W<'a, REG>
215where
216 REG: crate::Writable + crate::RegisterSpec,
217{
218 #[inline(always)]
220 pub fn motorola(self) -> &'a mut crate::W<REG> {
221 self.variant(FRF::Motorola)
222 }
223 #[inline(always)]
225 pub fn ti(self) -> &'a mut crate::W<REG> {
226 self.variant(FRF::Ti)
227 }
228}
229#[cfg_attr(feature = "defmt", derive(defmt::Format))]
233#[derive(Clone, Copy, Debug, PartialEq, Eq)]
234pub enum ERRIE {
235 Masked = 0,
237 NotMasked = 1,
239}
240impl From<ERRIE> for bool {
241 #[inline(always)]
242 fn from(variant: ERRIE) -> Self {
243 variant as u8 != 0
244 }
245}
246pub type ERRIE_R = crate::BitReader<ERRIE>;
248impl ERRIE_R {
249 #[inline(always)]
251 pub const fn variant(&self) -> ERRIE {
252 match self.bits {
253 false => ERRIE::Masked,
254 true => ERRIE::NotMasked,
255 }
256 }
257 #[inline(always)]
259 pub fn is_masked(&self) -> bool {
260 *self == ERRIE::Masked
261 }
262 #[inline(always)]
264 pub fn is_not_masked(&self) -> bool {
265 *self == ERRIE::NotMasked
266 }
267}
268pub type ERRIE_W<'a, REG> = crate::BitWriter<'a, REG, ERRIE>;
270impl<'a, REG> ERRIE_W<'a, REG>
271where
272 REG: crate::Writable + crate::RegisterSpec,
273{
274 #[inline(always)]
276 pub fn masked(self) -> &'a mut crate::W<REG> {
277 self.variant(ERRIE::Masked)
278 }
279 #[inline(always)]
281 pub fn not_masked(self) -> &'a mut crate::W<REG> {
282 self.variant(ERRIE::NotMasked)
283 }
284}
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
289#[derive(Clone, Copy, Debug, PartialEq, Eq)]
290pub enum RXNEIE {
291 Masked = 0,
293 NotMasked = 1,
295}
296impl From<RXNEIE> for bool {
297 #[inline(always)]
298 fn from(variant: RXNEIE) -> Self {
299 variant as u8 != 0
300 }
301}
302pub type RXNEIE_R = crate::BitReader<RXNEIE>;
304impl RXNEIE_R {
305 #[inline(always)]
307 pub const fn variant(&self) -> RXNEIE {
308 match self.bits {
309 false => RXNEIE::Masked,
310 true => RXNEIE::NotMasked,
311 }
312 }
313 #[inline(always)]
315 pub fn is_masked(&self) -> bool {
316 *self == RXNEIE::Masked
317 }
318 #[inline(always)]
320 pub fn is_not_masked(&self) -> bool {
321 *self == RXNEIE::NotMasked
322 }
323}
324pub type RXNEIE_W<'a, REG> = crate::BitWriter<'a, REG, RXNEIE>;
326impl<'a, REG> RXNEIE_W<'a, REG>
327where
328 REG: crate::Writable + crate::RegisterSpec,
329{
330 #[inline(always)]
332 pub fn masked(self) -> &'a mut crate::W<REG> {
333 self.variant(RXNEIE::Masked)
334 }
335 #[inline(always)]
337 pub fn not_masked(self) -> &'a mut crate::W<REG> {
338 self.variant(RXNEIE::NotMasked)
339 }
340}
341#[cfg_attr(feature = "defmt", derive(defmt::Format))]
345#[derive(Clone, Copy, Debug, PartialEq, Eq)]
346pub enum TXEIE {
347 Masked = 0,
349 NotMasked = 1,
351}
352impl From<TXEIE> for bool {
353 #[inline(always)]
354 fn from(variant: TXEIE) -> Self {
355 variant as u8 != 0
356 }
357}
358pub type TXEIE_R = crate::BitReader<TXEIE>;
360impl TXEIE_R {
361 #[inline(always)]
363 pub const fn variant(&self) -> TXEIE {
364 match self.bits {
365 false => TXEIE::Masked,
366 true => TXEIE::NotMasked,
367 }
368 }
369 #[inline(always)]
371 pub fn is_masked(&self) -> bool {
372 *self == TXEIE::Masked
373 }
374 #[inline(always)]
376 pub fn is_not_masked(&self) -> bool {
377 *self == TXEIE::NotMasked
378 }
379}
380pub type TXEIE_W<'a, REG> = crate::BitWriter<'a, REG, TXEIE>;
382impl<'a, REG> TXEIE_W<'a, REG>
383where
384 REG: crate::Writable + crate::RegisterSpec,
385{
386 #[inline(always)]
388 pub fn masked(self) -> &'a mut crate::W<REG> {
389 self.variant(TXEIE::Masked)
390 }
391 #[inline(always)]
393 pub fn not_masked(self) -> &'a mut crate::W<REG> {
394 self.variant(TXEIE::NotMasked)
395 }
396}
397impl R {
398 #[inline(always)]
400 pub fn rxdmaen(&self) -> RXDMAEN_R {
401 RXDMAEN_R::new((self.bits & 1) != 0)
402 }
403 #[inline(always)]
405 pub fn txdmaen(&self) -> TXDMAEN_R {
406 TXDMAEN_R::new(((self.bits >> 1) & 1) != 0)
407 }
408 #[inline(always)]
410 pub fn ssoe(&self) -> SSOE_R {
411 SSOE_R::new(((self.bits >> 2) & 1) != 0)
412 }
413 #[inline(always)]
415 pub fn frf(&self) -> FRF_R {
416 FRF_R::new(((self.bits >> 4) & 1) != 0)
417 }
418 #[inline(always)]
420 pub fn errie(&self) -> ERRIE_R {
421 ERRIE_R::new(((self.bits >> 5) & 1) != 0)
422 }
423 #[inline(always)]
425 pub fn rxneie(&self) -> RXNEIE_R {
426 RXNEIE_R::new(((self.bits >> 6) & 1) != 0)
427 }
428 #[inline(always)]
430 pub fn txeie(&self) -> TXEIE_R {
431 TXEIE_R::new(((self.bits >> 7) & 1) != 0)
432 }
433}
434impl core::fmt::Debug for R {
435 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
436 f.debug_struct("CR2")
437 .field("txeie", &self.txeie())
438 .field("rxneie", &self.rxneie())
439 .field("errie", &self.errie())
440 .field("frf", &self.frf())
441 .field("ssoe", &self.ssoe())
442 .field("txdmaen", &self.txdmaen())
443 .field("rxdmaen", &self.rxdmaen())
444 .finish()
445 }
446}
447impl W {
448 #[inline(always)]
450 pub fn rxdmaen(&mut self) -> RXDMAEN_W<CR2rs> {
451 RXDMAEN_W::new(self, 0)
452 }
453 #[inline(always)]
455 pub fn txdmaen(&mut self) -> TXDMAEN_W<CR2rs> {
456 TXDMAEN_W::new(self, 1)
457 }
458 #[inline(always)]
460 pub fn ssoe(&mut self) -> SSOE_W<CR2rs> {
461 SSOE_W::new(self, 2)
462 }
463 #[inline(always)]
465 pub fn frf(&mut self) -> FRF_W<CR2rs> {
466 FRF_W::new(self, 4)
467 }
468 #[inline(always)]
470 pub fn errie(&mut self) -> ERRIE_W<CR2rs> {
471 ERRIE_W::new(self, 5)
472 }
473 #[inline(always)]
475 pub fn rxneie(&mut self) -> RXNEIE_W<CR2rs> {
476 RXNEIE_W::new(self, 6)
477 }
478 #[inline(always)]
480 pub fn txeie(&mut self) -> TXEIE_W<CR2rs> {
481 TXEIE_W::new(self, 7)
482 }
483}
484pub struct CR2rs;
490impl crate::RegisterSpec for CR2rs {
491 type Ux = u16;
492}
493impl crate::Readable for CR2rs {}
495impl crate::Writable for CR2rs {
497 type Safety = crate::Unsafe;
498}
499impl crate::Resettable for CR2rs {}