1#[doc = "Register `SSR_MANC` reader"]
2pub struct R(crate::R<SSR_MANC_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SSR_MANC_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SSR_MANC_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SSR_MANC_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SSR_MANC` writer"]
17pub struct W(crate::W<SSR_MANC_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SSR_MANC_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<SSR_MANC_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SSR_MANC_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `MER` reader - Manchester Error Flag"]
38pub type MER_R = crate::BitReader<MER_A>;
39#[doc = "Manchester Error Flag\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum MER_A {
42 #[doc = "0: No Manchester error occurred"]
43 _0 = 0,
44 #[doc = "1: Manchester error has occurred"]
45 _1 = 1,
46}
47impl From<MER_A> for bool {
48 #[inline(always)]
49 fn from(variant: MER_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl MER_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> MER_A {
57 match self.bits {
58 false => MER_A::_0,
59 true => MER_A::_1,
60 }
61 }
62 #[doc = "Checks if the value of the field is `_0`"]
63 #[inline(always)]
64 pub fn is_0(&self) -> bool {
65 *self == MER_A::_0
66 }
67 #[doc = "Checks if the value of the field is `_1`"]
68 #[inline(always)]
69 pub fn is_1(&self) -> bool {
70 *self == MER_A::_1
71 }
72}
73#[doc = "Field `MER` writer - Manchester Error Flag"]
74pub type MER_W<'a, const O: u8> = crate::BitWriter<'a, u8, SSR_MANC_SPEC, MER_A, O>;
75impl<'a, const O: u8> MER_W<'a, O> {
76 #[doc = "No Manchester error occurred"]
77 #[inline(always)]
78 pub fn _0(self) -> &'a mut W {
79 self.variant(MER_A::_0)
80 }
81 #[doc = "Manchester error has occurred"]
82 #[inline(always)]
83 pub fn _1(self) -> &'a mut W {
84 self.variant(MER_A::_1)
85 }
86}
87#[doc = "Field `MPB` reader - Multi-Processor"]
88pub type MPB_R = crate::BitReader<MPB_A>;
89#[doc = "Multi-Processor\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq, Eq)]
91pub enum MPB_A {
92 #[doc = "0: Data transmission cycles"]
93 _0 = 0,
94 #[doc = "1: ID transmission cycles"]
95 _1 = 1,
96}
97impl From<MPB_A> for bool {
98 #[inline(always)]
99 fn from(variant: MPB_A) -> Self {
100 variant as u8 != 0
101 }
102}
103impl MPB_R {
104 #[doc = "Get enumerated values variant"]
105 #[inline(always)]
106 pub fn variant(&self) -> MPB_A {
107 match self.bits {
108 false => MPB_A::_0,
109 true => MPB_A::_1,
110 }
111 }
112 #[doc = "Checks if the value of the field is `_0`"]
113 #[inline(always)]
114 pub fn is_0(&self) -> bool {
115 *self == MPB_A::_0
116 }
117 #[doc = "Checks if the value of the field is `_1`"]
118 #[inline(always)]
119 pub fn is_1(&self) -> bool {
120 *self == MPB_A::_1
121 }
122}
123#[doc = "Field `TEND` reader - Transmit End Flag"]
124pub type TEND_R = crate::BitReader<TEND_A>;
125#[doc = "Transmit End Flag\n\nValue on reset: 1"]
126#[derive(Clone, Copy, Debug, PartialEq, Eq)]
127pub enum TEND_A {
128 #[doc = "0: A character is being transmitted"]
129 _0 = 0,
130 #[doc = "1: Character transfer has been completed."]
131 _1 = 1,
132}
133impl From<TEND_A> for bool {
134 #[inline(always)]
135 fn from(variant: TEND_A) -> Self {
136 variant as u8 != 0
137 }
138}
139impl TEND_R {
140 #[doc = "Get enumerated values variant"]
141 #[inline(always)]
142 pub fn variant(&self) -> TEND_A {
143 match self.bits {
144 false => TEND_A::_0,
145 true => TEND_A::_1,
146 }
147 }
148 #[doc = "Checks if the value of the field is `_0`"]
149 #[inline(always)]
150 pub fn is_0(&self) -> bool {
151 *self == TEND_A::_0
152 }
153 #[doc = "Checks if the value of the field is `_1`"]
154 #[inline(always)]
155 pub fn is_1(&self) -> bool {
156 *self == TEND_A::_1
157 }
158}
159#[doc = "Field `PER` reader - Parity Error Flag"]
160pub type PER_R = crate::BitReader<PER_A>;
161#[doc = "Parity Error Flag\n\nValue on reset: 0"]
162#[derive(Clone, Copy, Debug, PartialEq, Eq)]
163pub enum PER_A {
164 #[doc = "0: No parity error occurred"]
165 _0 = 0,
166 #[doc = "1: A parity error has occurred"]
167 _1 = 1,
168}
169impl From<PER_A> for bool {
170 #[inline(always)]
171 fn from(variant: PER_A) -> Self {
172 variant as u8 != 0
173 }
174}
175impl PER_R {
176 #[doc = "Get enumerated values variant"]
177 #[inline(always)]
178 pub fn variant(&self) -> PER_A {
179 match self.bits {
180 false => PER_A::_0,
181 true => PER_A::_1,
182 }
183 }
184 #[doc = "Checks if the value of the field is `_0`"]
185 #[inline(always)]
186 pub fn is_0(&self) -> bool {
187 *self == PER_A::_0
188 }
189 #[doc = "Checks if the value of the field is `_1`"]
190 #[inline(always)]
191 pub fn is_1(&self) -> bool {
192 *self == PER_A::_1
193 }
194}
195#[doc = "Field `PER` writer - Parity Error Flag"]
196pub type PER_W<'a, const O: u8> = crate::BitWriter<'a, u8, SSR_MANC_SPEC, PER_A, O>;
197impl<'a, const O: u8> PER_W<'a, O> {
198 #[doc = "No parity error occurred"]
199 #[inline(always)]
200 pub fn _0(self) -> &'a mut W {
201 self.variant(PER_A::_0)
202 }
203 #[doc = "A parity error has occurred"]
204 #[inline(always)]
205 pub fn _1(self) -> &'a mut W {
206 self.variant(PER_A::_1)
207 }
208}
209#[doc = "Field `FER` reader - Framing Error Flag"]
210pub type FER_R = crate::BitReader<FER_A>;
211#[doc = "Framing Error Flag\n\nValue on reset: 0"]
212#[derive(Clone, Copy, Debug, PartialEq, Eq)]
213pub enum FER_A {
214 #[doc = "0: No framing error occurred"]
215 _0 = 0,
216 #[doc = "1: A framing error has occurred"]
217 _1 = 1,
218}
219impl From<FER_A> for bool {
220 #[inline(always)]
221 fn from(variant: FER_A) -> Self {
222 variant as u8 != 0
223 }
224}
225impl FER_R {
226 #[doc = "Get enumerated values variant"]
227 #[inline(always)]
228 pub fn variant(&self) -> FER_A {
229 match self.bits {
230 false => FER_A::_0,
231 true => FER_A::_1,
232 }
233 }
234 #[doc = "Checks if the value of the field is `_0`"]
235 #[inline(always)]
236 pub fn is_0(&self) -> bool {
237 *self == FER_A::_0
238 }
239 #[doc = "Checks if the value of the field is `_1`"]
240 #[inline(always)]
241 pub fn is_1(&self) -> bool {
242 *self == FER_A::_1
243 }
244}
245#[doc = "Field `FER` writer - Framing Error Flag"]
246pub type FER_W<'a, const O: u8> = crate::BitWriter<'a, u8, SSR_MANC_SPEC, FER_A, O>;
247impl<'a, const O: u8> FER_W<'a, O> {
248 #[doc = "No framing error occurred"]
249 #[inline(always)]
250 pub fn _0(self) -> &'a mut W {
251 self.variant(FER_A::_0)
252 }
253 #[doc = "A framing error has occurred"]
254 #[inline(always)]
255 pub fn _1(self) -> &'a mut W {
256 self.variant(FER_A::_1)
257 }
258}
259#[doc = "Field `ORER` reader - Overrun Error Flag"]
260pub type ORER_R = crate::BitReader<ORER_A>;
261#[doc = "Overrun Error Flag\n\nValue on reset: 0"]
262#[derive(Clone, Copy, Debug, PartialEq, Eq)]
263pub enum ORER_A {
264 #[doc = "0: No overrun error occurred"]
265 _0 = 0,
266 #[doc = "1: An overrun error has occurred"]
267 _1 = 1,
268}
269impl From<ORER_A> for bool {
270 #[inline(always)]
271 fn from(variant: ORER_A) -> Self {
272 variant as u8 != 0
273 }
274}
275impl ORER_R {
276 #[doc = "Get enumerated values variant"]
277 #[inline(always)]
278 pub fn variant(&self) -> ORER_A {
279 match self.bits {
280 false => ORER_A::_0,
281 true => ORER_A::_1,
282 }
283 }
284 #[doc = "Checks if the value of the field is `_0`"]
285 #[inline(always)]
286 pub fn is_0(&self) -> bool {
287 *self == ORER_A::_0
288 }
289 #[doc = "Checks if the value of the field is `_1`"]
290 #[inline(always)]
291 pub fn is_1(&self) -> bool {
292 *self == ORER_A::_1
293 }
294}
295#[doc = "Field `ORER` writer - Overrun Error Flag"]
296pub type ORER_W<'a, const O: u8> = crate::BitWriter<'a, u8, SSR_MANC_SPEC, ORER_A, O>;
297impl<'a, const O: u8> ORER_W<'a, O> {
298 #[doc = "No overrun error occurred"]
299 #[inline(always)]
300 pub fn _0(self) -> &'a mut W {
301 self.variant(ORER_A::_0)
302 }
303 #[doc = "An overrun error has occurred"]
304 #[inline(always)]
305 pub fn _1(self) -> &'a mut W {
306 self.variant(ORER_A::_1)
307 }
308}
309#[doc = "Field `RDRF` reader - Receive Data Full Flag"]
310pub type RDRF_R = crate::BitReader<RDRF_A>;
311#[doc = "Receive Data Full Flag\n\nValue on reset: 0"]
312#[derive(Clone, Copy, Debug, PartialEq, Eq)]
313pub enum RDRF_A {
314 #[doc = "0: No received data is in RDR register"]
315 _0 = 0,
316 #[doc = "1: Received data is in RDR register"]
317 _1 = 1,
318}
319impl From<RDRF_A> for bool {
320 #[inline(always)]
321 fn from(variant: RDRF_A) -> Self {
322 variant as u8 != 0
323 }
324}
325impl RDRF_R {
326 #[doc = "Get enumerated values variant"]
327 #[inline(always)]
328 pub fn variant(&self) -> RDRF_A {
329 match self.bits {
330 false => RDRF_A::_0,
331 true => RDRF_A::_1,
332 }
333 }
334 #[doc = "Checks if the value of the field is `_0`"]
335 #[inline(always)]
336 pub fn is_0(&self) -> bool {
337 *self == RDRF_A::_0
338 }
339 #[doc = "Checks if the value of the field is `_1`"]
340 #[inline(always)]
341 pub fn is_1(&self) -> bool {
342 *self == RDRF_A::_1
343 }
344}
345#[doc = "Field `RDRF` writer - Receive Data Full Flag"]
346pub type RDRF_W<'a, const O: u8> = crate::BitWriter<'a, u8, SSR_MANC_SPEC, RDRF_A, O>;
347impl<'a, const O: u8> RDRF_W<'a, O> {
348 #[doc = "No received data is in RDR register"]
349 #[inline(always)]
350 pub fn _0(self) -> &'a mut W {
351 self.variant(RDRF_A::_0)
352 }
353 #[doc = "Received data is in RDR register"]
354 #[inline(always)]
355 pub fn _1(self) -> &'a mut W {
356 self.variant(RDRF_A::_1)
357 }
358}
359#[doc = "Field `TDRE` reader - Transmit Data Empty Flag"]
360pub type TDRE_R = crate::BitReader<TDRE_A>;
361#[doc = "Transmit Data Empty Flag\n\nValue on reset: 1"]
362#[derive(Clone, Copy, Debug, PartialEq, Eq)]
363pub enum TDRE_A {
364 #[doc = "0: Transmit data is in TDR register"]
365 _0 = 0,
366 #[doc = "1: No transmit data is in TDR register"]
367 _1 = 1,
368}
369impl From<TDRE_A> for bool {
370 #[inline(always)]
371 fn from(variant: TDRE_A) -> Self {
372 variant as u8 != 0
373 }
374}
375impl TDRE_R {
376 #[doc = "Get enumerated values variant"]
377 #[inline(always)]
378 pub fn variant(&self) -> TDRE_A {
379 match self.bits {
380 false => TDRE_A::_0,
381 true => TDRE_A::_1,
382 }
383 }
384 #[doc = "Checks if the value of the field is `_0`"]
385 #[inline(always)]
386 pub fn is_0(&self) -> bool {
387 *self == TDRE_A::_0
388 }
389 #[doc = "Checks if the value of the field is `_1`"]
390 #[inline(always)]
391 pub fn is_1(&self) -> bool {
392 *self == TDRE_A::_1
393 }
394}
395#[doc = "Field `TDRE` writer - Transmit Data Empty Flag"]
396pub type TDRE_W<'a, const O: u8> = crate::BitWriter<'a, u8, SSR_MANC_SPEC, TDRE_A, O>;
397impl<'a, const O: u8> TDRE_W<'a, O> {
398 #[doc = "Transmit data is in TDR register"]
399 #[inline(always)]
400 pub fn _0(self) -> &'a mut W {
401 self.variant(TDRE_A::_0)
402 }
403 #[doc = "No transmit data is in TDR register"]
404 #[inline(always)]
405 pub fn _1(self) -> &'a mut W {
406 self.variant(TDRE_A::_1)
407 }
408}
409impl R {
410 #[doc = "Bit 0 - Manchester Error Flag"]
411 #[inline(always)]
412 pub fn mer(&self) -> MER_R {
413 MER_R::new((self.bits & 1) != 0)
414 }
415 #[doc = "Bit 1 - Multi-Processor"]
416 #[inline(always)]
417 pub fn mpb(&self) -> MPB_R {
418 MPB_R::new(((self.bits >> 1) & 1) != 0)
419 }
420 #[doc = "Bit 2 - Transmit End Flag"]
421 #[inline(always)]
422 pub fn tend(&self) -> TEND_R {
423 TEND_R::new(((self.bits >> 2) & 1) != 0)
424 }
425 #[doc = "Bit 3 - Parity Error Flag"]
426 #[inline(always)]
427 pub fn per(&self) -> PER_R {
428 PER_R::new(((self.bits >> 3) & 1) != 0)
429 }
430 #[doc = "Bit 4 - Framing Error Flag"]
431 #[inline(always)]
432 pub fn fer(&self) -> FER_R {
433 FER_R::new(((self.bits >> 4) & 1) != 0)
434 }
435 #[doc = "Bit 5 - Overrun Error Flag"]
436 #[inline(always)]
437 pub fn orer(&self) -> ORER_R {
438 ORER_R::new(((self.bits >> 5) & 1) != 0)
439 }
440 #[doc = "Bit 6 - Receive Data Full Flag"]
441 #[inline(always)]
442 pub fn rdrf(&self) -> RDRF_R {
443 RDRF_R::new(((self.bits >> 6) & 1) != 0)
444 }
445 #[doc = "Bit 7 - Transmit Data Empty Flag"]
446 #[inline(always)]
447 pub fn tdre(&self) -> TDRE_R {
448 TDRE_R::new(((self.bits >> 7) & 1) != 0)
449 }
450}
451impl W {
452 #[doc = "Bit 0 - Manchester Error Flag"]
453 #[inline(always)]
454 #[must_use]
455 pub fn mer(&mut self) -> MER_W<0> {
456 MER_W::new(self)
457 }
458 #[doc = "Bit 3 - Parity Error Flag"]
459 #[inline(always)]
460 #[must_use]
461 pub fn per(&mut self) -> PER_W<3> {
462 PER_W::new(self)
463 }
464 #[doc = "Bit 4 - Framing Error Flag"]
465 #[inline(always)]
466 #[must_use]
467 pub fn fer(&mut self) -> FER_W<4> {
468 FER_W::new(self)
469 }
470 #[doc = "Bit 5 - Overrun Error Flag"]
471 #[inline(always)]
472 #[must_use]
473 pub fn orer(&mut self) -> ORER_W<5> {
474 ORER_W::new(self)
475 }
476 #[doc = "Bit 6 - Receive Data Full Flag"]
477 #[inline(always)]
478 #[must_use]
479 pub fn rdrf(&mut self) -> RDRF_W<6> {
480 RDRF_W::new(self)
481 }
482 #[doc = "Bit 7 - Transmit Data Empty Flag"]
483 #[inline(always)]
484 #[must_use]
485 pub fn tdre(&mut self) -> TDRE_W<7> {
486 TDRE_W::new(self)
487 }
488 #[doc = "Writes raw bits to the register."]
489 #[inline(always)]
490 pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
491 self.0.bits(bits);
492 self
493 }
494}
495#[doc = "Serial Status Register for Manchester Mode (SCMR.SMIF = 0, and MMR.MANEN = 1)\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 [ssr_manc](index.html) module"]
496pub struct SSR_MANC_SPEC;
497impl crate::RegisterSpec for SSR_MANC_SPEC {
498 type Ux = u8;
499}
500#[doc = "`read()` method returns [ssr_manc::R](R) reader structure"]
501impl crate::Readable for SSR_MANC_SPEC {
502 type Reader = R;
503}
504#[doc = "`write(|w| ..)` method takes [ssr_manc::W](W) writer structure"]
505impl crate::Writable for SSR_MANC_SPEC {
506 type Writer = W;
507 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
508 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
509}
510#[doc = "`reset()` method sets SSR_MANC to value 0x84"]
511impl crate::Resettable for SSR_MANC_SPEC {
512 const RESET_VALUE: Self::Ux = 0x84;
513}