rv32m1_ri5cy_pac/lpuart1/
data.rs

1#[doc = "Reader of register DATA"]
2pub type R = crate::R<u32, super::DATA>;
3#[doc = "Writer for register DATA"]
4pub type W = crate::W<u32, super::DATA>;
5#[doc = "Register DATA `reset()`'s with value 0x1000"]
6impl crate::ResetValue for super::DATA {
7  type Type = u32;
8  #[inline(always)]
9  fn reset_value() -> Self::Type {
10    0x1000
11  }
12}
13#[doc = "Reader of field `R0T0`"]
14pub type R0T0_R = crate::R<bool, bool>;
15#[doc = "Write proxy for field `R0T0`"]
16pub struct R0T0_W<'a> {
17  w: &'a mut W,
18}
19impl<'a> R0T0_W<'a> {
20  #[doc = r"Sets the field bit"]
21  #[inline(always)]
22  pub fn set_bit(self) -> &'a mut W {
23    self.bit(true)
24  }
25  #[doc = r"Clears the field bit"]
26  #[inline(always)]
27  pub fn clear_bit(self) -> &'a mut W {
28    self.bit(false)
29  }
30  #[doc = r"Writes raw bits to the field"]
31  #[inline(always)]
32  pub fn bit(self, value: bool) -> &'a mut W {
33    self.w.bits = (self.w.bits & !0x01) | ((value as u32) & 0x01);
34    self.w
35  }
36}
37#[doc = "Reader of field `R1T1`"]
38pub type R1T1_R = crate::R<bool, bool>;
39#[doc = "Write proxy for field `R1T1`"]
40pub struct R1T1_W<'a> {
41  w: &'a mut W,
42}
43impl<'a> R1T1_W<'a> {
44  #[doc = r"Sets the field bit"]
45  #[inline(always)]
46  pub fn set_bit(self) -> &'a mut W {
47    self.bit(true)
48  }
49  #[doc = r"Clears the field bit"]
50  #[inline(always)]
51  pub fn clear_bit(self) -> &'a mut W {
52    self.bit(false)
53  }
54  #[doc = r"Writes raw bits to the field"]
55  #[inline(always)]
56  pub fn bit(self, value: bool) -> &'a mut W {
57    self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
58    self.w
59  }
60}
61#[doc = "Reader of field `R2T2`"]
62pub type R2T2_R = crate::R<bool, bool>;
63#[doc = "Write proxy for field `R2T2`"]
64pub struct R2T2_W<'a> {
65  w: &'a mut W,
66}
67impl<'a> R2T2_W<'a> {
68  #[doc = r"Sets the field bit"]
69  #[inline(always)]
70  pub fn set_bit(self) -> &'a mut W {
71    self.bit(true)
72  }
73  #[doc = r"Clears the field bit"]
74  #[inline(always)]
75  pub fn clear_bit(self) -> &'a mut W {
76    self.bit(false)
77  }
78  #[doc = r"Writes raw bits to the field"]
79  #[inline(always)]
80  pub fn bit(self, value: bool) -> &'a mut W {
81    self.w.bits = (self.w.bits & !(0x01 << 2)) | (((value as u32) & 0x01) << 2);
82    self.w
83  }
84}
85#[doc = "Reader of field `R3T3`"]
86pub type R3T3_R = crate::R<bool, bool>;
87#[doc = "Write proxy for field `R3T3`"]
88pub struct R3T3_W<'a> {
89  w: &'a mut W,
90}
91impl<'a> R3T3_W<'a> {
92  #[doc = r"Sets the field bit"]
93  #[inline(always)]
94  pub fn set_bit(self) -> &'a mut W {
95    self.bit(true)
96  }
97  #[doc = r"Clears the field bit"]
98  #[inline(always)]
99  pub fn clear_bit(self) -> &'a mut W {
100    self.bit(false)
101  }
102  #[doc = r"Writes raw bits to the field"]
103  #[inline(always)]
104  pub fn bit(self, value: bool) -> &'a mut W {
105    self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
106    self.w
107  }
108}
109#[doc = "Reader of field `R4T4`"]
110pub type R4T4_R = crate::R<bool, bool>;
111#[doc = "Write proxy for field `R4T4`"]
112pub struct R4T4_W<'a> {
113  w: &'a mut W,
114}
115impl<'a> R4T4_W<'a> {
116  #[doc = r"Sets the field bit"]
117  #[inline(always)]
118  pub fn set_bit(self) -> &'a mut W {
119    self.bit(true)
120  }
121  #[doc = r"Clears the field bit"]
122  #[inline(always)]
123  pub fn clear_bit(self) -> &'a mut W {
124    self.bit(false)
125  }
126  #[doc = r"Writes raw bits to the field"]
127  #[inline(always)]
128  pub fn bit(self, value: bool) -> &'a mut W {
129    self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u32) & 0x01) << 4);
130    self.w
131  }
132}
133#[doc = "Reader of field `R5T5`"]
134pub type R5T5_R = crate::R<bool, bool>;
135#[doc = "Write proxy for field `R5T5`"]
136pub struct R5T5_W<'a> {
137  w: &'a mut W,
138}
139impl<'a> R5T5_W<'a> {
140  #[doc = r"Sets the field bit"]
141  #[inline(always)]
142  pub fn set_bit(self) -> &'a mut W {
143    self.bit(true)
144  }
145  #[doc = r"Clears the field bit"]
146  #[inline(always)]
147  pub fn clear_bit(self) -> &'a mut W {
148    self.bit(false)
149  }
150  #[doc = r"Writes raw bits to the field"]
151  #[inline(always)]
152  pub fn bit(self, value: bool) -> &'a mut W {
153    self.w.bits = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
154    self.w
155  }
156}
157#[doc = "Reader of field `R6T6`"]
158pub type R6T6_R = crate::R<bool, bool>;
159#[doc = "Write proxy for field `R6T6`"]
160pub struct R6T6_W<'a> {
161  w: &'a mut W,
162}
163impl<'a> R6T6_W<'a> {
164  #[doc = r"Sets the field bit"]
165  #[inline(always)]
166  pub fn set_bit(self) -> &'a mut W {
167    self.bit(true)
168  }
169  #[doc = r"Clears the field bit"]
170  #[inline(always)]
171  pub fn clear_bit(self) -> &'a mut W {
172    self.bit(false)
173  }
174  #[doc = r"Writes raw bits to the field"]
175  #[inline(always)]
176  pub fn bit(self, value: bool) -> &'a mut W {
177    self.w.bits = (self.w.bits & !(0x01 << 6)) | (((value as u32) & 0x01) << 6);
178    self.w
179  }
180}
181#[doc = "Reader of field `R7T7`"]
182pub type R7T7_R = crate::R<bool, bool>;
183#[doc = "Write proxy for field `R7T7`"]
184pub struct R7T7_W<'a> {
185  w: &'a mut W,
186}
187impl<'a> R7T7_W<'a> {
188  #[doc = r"Sets the field bit"]
189  #[inline(always)]
190  pub fn set_bit(self) -> &'a mut W {
191    self.bit(true)
192  }
193  #[doc = r"Clears the field bit"]
194  #[inline(always)]
195  pub fn clear_bit(self) -> &'a mut W {
196    self.bit(false)
197  }
198  #[doc = r"Writes raw bits to the field"]
199  #[inline(always)]
200  pub fn bit(self, value: bool) -> &'a mut W {
201    self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
202    self.w
203  }
204}
205#[doc = "Reader of field `R8T8`"]
206pub type R8T8_R = crate::R<bool, bool>;
207#[doc = "Write proxy for field `R8T8`"]
208pub struct R8T8_W<'a> {
209  w: &'a mut W,
210}
211impl<'a> R8T8_W<'a> {
212  #[doc = r"Sets the field bit"]
213  #[inline(always)]
214  pub fn set_bit(self) -> &'a mut W {
215    self.bit(true)
216  }
217  #[doc = r"Clears the field bit"]
218  #[inline(always)]
219  pub fn clear_bit(self) -> &'a mut W {
220    self.bit(false)
221  }
222  #[doc = r"Writes raw bits to the field"]
223  #[inline(always)]
224  pub fn bit(self, value: bool) -> &'a mut W {
225    self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
226    self.w
227  }
228}
229#[doc = "Reader of field `R9T9`"]
230pub type R9T9_R = crate::R<bool, bool>;
231#[doc = "Write proxy for field `R9T9`"]
232pub struct R9T9_W<'a> {
233  w: &'a mut W,
234}
235impl<'a> R9T9_W<'a> {
236  #[doc = r"Sets the field bit"]
237  #[inline(always)]
238  pub fn set_bit(self) -> &'a mut W {
239    self.bit(true)
240  }
241  #[doc = r"Clears the field bit"]
242  #[inline(always)]
243  pub fn clear_bit(self) -> &'a mut W {
244    self.bit(false)
245  }
246  #[doc = r"Writes raw bits to the field"]
247  #[inline(always)]
248  pub fn bit(self, value: bool) -> &'a mut W {
249    self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
250    self.w
251  }
252}
253#[doc = "Idle Line\n\nValue on reset: 0"]
254#[derive(Clone, Copy, Debug, PartialEq)]
255pub enum IDLINE_A {
256  #[doc = "0: Receiver was not idle before receiving this character."]
257  IDLINE_0,
258  #[doc = "1: Receiver was idle before receiving this character."]
259  IDLINE_1,
260}
261impl From<IDLINE_A> for bool {
262  #[inline(always)]
263  fn from(variant: IDLINE_A) -> Self {
264    match variant {
265      IDLINE_A::IDLINE_0 => false,
266      IDLINE_A::IDLINE_1 => true,
267    }
268  }
269}
270#[doc = "Reader of field `IDLINE`"]
271pub type IDLINE_R = crate::R<bool, IDLINE_A>;
272impl IDLINE_R {
273  #[doc = r"Get enumerated values variant"]
274  #[inline(always)]
275  pub fn variant(&self) -> IDLINE_A {
276    match self.bits {
277      false => IDLINE_A::IDLINE_0,
278      true => IDLINE_A::IDLINE_1,
279    }
280  }
281  #[doc = "Checks if the value of the field is `IDLINE_0`"]
282  #[inline(always)]
283  pub fn is_idline_0(&self) -> bool {
284    *self == IDLINE_A::IDLINE_0
285  }
286  #[doc = "Checks if the value of the field is `IDLINE_1`"]
287  #[inline(always)]
288  pub fn is_idline_1(&self) -> bool {
289    *self == IDLINE_A::IDLINE_1
290  }
291}
292#[doc = "Receive Buffer Empty\n\nValue on reset: 1"]
293#[derive(Clone, Copy, Debug, PartialEq)]
294pub enum RXEMPT_A {
295  #[doc = "0: Receive buffer contains valid data."]
296  RXEMPT_0,
297  #[doc = "1: Receive buffer is empty, data returned on read is not valid."]
298  RXEMPT_1,
299}
300impl From<RXEMPT_A> for bool {
301  #[inline(always)]
302  fn from(variant: RXEMPT_A) -> Self {
303    match variant {
304      RXEMPT_A::RXEMPT_0 => false,
305      RXEMPT_A::RXEMPT_1 => true,
306    }
307  }
308}
309#[doc = "Reader of field `RXEMPT`"]
310pub type RXEMPT_R = crate::R<bool, RXEMPT_A>;
311impl RXEMPT_R {
312  #[doc = r"Get enumerated values variant"]
313  #[inline(always)]
314  pub fn variant(&self) -> RXEMPT_A {
315    match self.bits {
316      false => RXEMPT_A::RXEMPT_0,
317      true => RXEMPT_A::RXEMPT_1,
318    }
319  }
320  #[doc = "Checks if the value of the field is `RXEMPT_0`"]
321  #[inline(always)]
322  pub fn is_rxempt_0(&self) -> bool {
323    *self == RXEMPT_A::RXEMPT_0
324  }
325  #[doc = "Checks if the value of the field is `RXEMPT_1`"]
326  #[inline(always)]
327  pub fn is_rxempt_1(&self) -> bool {
328    *self == RXEMPT_A::RXEMPT_1
329  }
330}
331#[doc = "Frame Error / Transmit Special Character\n\nValue on reset: 0"]
332#[derive(Clone, Copy, Debug, PartialEq)]
333pub enum FRETSC_A {
334  #[doc = "0: The dataword was received without a frame error on read, or transmit a normal character on write."]
335  FRETSC_0,
336  #[doc = "1: The dataword was received with a frame error, or transmit an idle or break character on transmit."]
337  FRETSC_1,
338}
339impl From<FRETSC_A> for bool {
340  #[inline(always)]
341  fn from(variant: FRETSC_A) -> Self {
342    match variant {
343      FRETSC_A::FRETSC_0 => false,
344      FRETSC_A::FRETSC_1 => true,
345    }
346  }
347}
348#[doc = "Reader of field `FRETSC`"]
349pub type FRETSC_R = crate::R<bool, FRETSC_A>;
350impl FRETSC_R {
351  #[doc = r"Get enumerated values variant"]
352  #[inline(always)]
353  pub fn variant(&self) -> FRETSC_A {
354    match self.bits {
355      false => FRETSC_A::FRETSC_0,
356      true => FRETSC_A::FRETSC_1,
357    }
358  }
359  #[doc = "Checks if the value of the field is `FRETSC_0`"]
360  #[inline(always)]
361  pub fn is_fretsc_0(&self) -> bool {
362    *self == FRETSC_A::FRETSC_0
363  }
364  #[doc = "Checks if the value of the field is `FRETSC_1`"]
365  #[inline(always)]
366  pub fn is_fretsc_1(&self) -> bool {
367    *self == FRETSC_A::FRETSC_1
368  }
369}
370#[doc = "Write proxy for field `FRETSC`"]
371pub struct FRETSC_W<'a> {
372  w: &'a mut W,
373}
374impl<'a> FRETSC_W<'a> {
375  #[doc = r"Writes `variant` to the field"]
376  #[inline(always)]
377  pub fn variant(self, variant: FRETSC_A) -> &'a mut W {
378    {
379      self.bit(variant.into())
380    }
381  }
382  #[doc = "The dataword was received without a frame error on read, or transmit a normal character on write."]
383  #[inline(always)]
384  pub fn fretsc_0(self) -> &'a mut W {
385    self.variant(FRETSC_A::FRETSC_0)
386  }
387  #[doc = "The dataword was received with a frame error, or transmit an idle or break character on transmit."]
388  #[inline(always)]
389  pub fn fretsc_1(self) -> &'a mut W {
390    self.variant(FRETSC_A::FRETSC_1)
391  }
392  #[doc = r"Sets the field bit"]
393  #[inline(always)]
394  pub fn set_bit(self) -> &'a mut W {
395    self.bit(true)
396  }
397  #[doc = r"Clears the field bit"]
398  #[inline(always)]
399  pub fn clear_bit(self) -> &'a mut W {
400    self.bit(false)
401  }
402  #[doc = r"Writes raw bits to the field"]
403  #[inline(always)]
404  pub fn bit(self, value: bool) -> &'a mut W {
405    self.w.bits = (self.w.bits & !(0x01 << 13)) | (((value as u32) & 0x01) << 13);
406    self.w
407  }
408}
409#[doc = "PARITYE\n\nValue on reset: 0"]
410#[derive(Clone, Copy, Debug, PartialEq)]
411pub enum PARITYE_A {
412  #[doc = "0: The dataword was received without a parity error."]
413  PARITYE_0,
414  #[doc = "1: The dataword was received with a parity error."]
415  PARITYE_1,
416}
417impl From<PARITYE_A> for bool {
418  #[inline(always)]
419  fn from(variant: PARITYE_A) -> Self {
420    match variant {
421      PARITYE_A::PARITYE_0 => false,
422      PARITYE_A::PARITYE_1 => true,
423    }
424  }
425}
426#[doc = "Reader of field `PARITYE`"]
427pub type PARITYE_R = crate::R<bool, PARITYE_A>;
428impl PARITYE_R {
429  #[doc = r"Get enumerated values variant"]
430  #[inline(always)]
431  pub fn variant(&self) -> PARITYE_A {
432    match self.bits {
433      false => PARITYE_A::PARITYE_0,
434      true => PARITYE_A::PARITYE_1,
435    }
436  }
437  #[doc = "Checks if the value of the field is `PARITYE_0`"]
438  #[inline(always)]
439  pub fn is_paritye_0(&self) -> bool {
440    *self == PARITYE_A::PARITYE_0
441  }
442  #[doc = "Checks if the value of the field is `PARITYE_1`"]
443  #[inline(always)]
444  pub fn is_paritye_1(&self) -> bool {
445    *self == PARITYE_A::PARITYE_1
446  }
447}
448#[doc = "NOISY\n\nValue on reset: 0"]
449#[derive(Clone, Copy, Debug, PartialEq)]
450pub enum NOISY_A {
451  #[doc = "0: The dataword was received without noise."]
452  NOISY_0,
453  #[doc = "1: The data was received with noise."]
454  NOISY_1,
455}
456impl From<NOISY_A> for bool {
457  #[inline(always)]
458  fn from(variant: NOISY_A) -> Self {
459    match variant {
460      NOISY_A::NOISY_0 => false,
461      NOISY_A::NOISY_1 => true,
462    }
463  }
464}
465#[doc = "Reader of field `NOISY`"]
466pub type NOISY_R = crate::R<bool, NOISY_A>;
467impl NOISY_R {
468  #[doc = r"Get enumerated values variant"]
469  #[inline(always)]
470  pub fn variant(&self) -> NOISY_A {
471    match self.bits {
472      false => NOISY_A::NOISY_0,
473      true => NOISY_A::NOISY_1,
474    }
475  }
476  #[doc = "Checks if the value of the field is `NOISY_0`"]
477  #[inline(always)]
478  pub fn is_noisy_0(&self) -> bool {
479    *self == NOISY_A::NOISY_0
480  }
481  #[doc = "Checks if the value of the field is `NOISY_1`"]
482  #[inline(always)]
483  pub fn is_noisy_1(&self) -> bool {
484    *self == NOISY_A::NOISY_1
485  }
486}
487impl R {
488  #[doc = "Bit 0 - R0T0"]
489  #[inline(always)]
490  pub fn r0t0(&self) -> R0T0_R {
491    R0T0_R::new((self.bits & 0x01) != 0)
492  }
493  #[doc = "Bit 1 - R1T1"]
494  #[inline(always)]
495  pub fn r1t1(&self) -> R1T1_R {
496    R1T1_R::new(((self.bits >> 1) & 0x01) != 0)
497  }
498  #[doc = "Bit 2 - R2T2"]
499  #[inline(always)]
500  pub fn r2t2(&self) -> R2T2_R {
501    R2T2_R::new(((self.bits >> 2) & 0x01) != 0)
502  }
503  #[doc = "Bit 3 - R3T3"]
504  #[inline(always)]
505  pub fn r3t3(&self) -> R3T3_R {
506    R3T3_R::new(((self.bits >> 3) & 0x01) != 0)
507  }
508  #[doc = "Bit 4 - R4T4"]
509  #[inline(always)]
510  pub fn r4t4(&self) -> R4T4_R {
511    R4T4_R::new(((self.bits >> 4) & 0x01) != 0)
512  }
513  #[doc = "Bit 5 - R5T5"]
514  #[inline(always)]
515  pub fn r5t5(&self) -> R5T5_R {
516    R5T5_R::new(((self.bits >> 5) & 0x01) != 0)
517  }
518  #[doc = "Bit 6 - R6T6"]
519  #[inline(always)]
520  pub fn r6t6(&self) -> R6T6_R {
521    R6T6_R::new(((self.bits >> 6) & 0x01) != 0)
522  }
523  #[doc = "Bit 7 - R7T7"]
524  #[inline(always)]
525  pub fn r7t7(&self) -> R7T7_R {
526    R7T7_R::new(((self.bits >> 7) & 0x01) != 0)
527  }
528  #[doc = "Bit 8 - R8T8"]
529  #[inline(always)]
530  pub fn r8t8(&self) -> R8T8_R {
531    R8T8_R::new(((self.bits >> 8) & 0x01) != 0)
532  }
533  #[doc = "Bit 9 - R9T9"]
534  #[inline(always)]
535  pub fn r9t9(&self) -> R9T9_R {
536    R9T9_R::new(((self.bits >> 9) & 0x01) != 0)
537  }
538  #[doc = "Bit 11 - Idle Line"]
539  #[inline(always)]
540  pub fn idline(&self) -> IDLINE_R {
541    IDLINE_R::new(((self.bits >> 11) & 0x01) != 0)
542  }
543  #[doc = "Bit 12 - Receive Buffer Empty"]
544  #[inline(always)]
545  pub fn rxempt(&self) -> RXEMPT_R {
546    RXEMPT_R::new(((self.bits >> 12) & 0x01) != 0)
547  }
548  #[doc = "Bit 13 - Frame Error / Transmit Special Character"]
549  #[inline(always)]
550  pub fn fretsc(&self) -> FRETSC_R {
551    FRETSC_R::new(((self.bits >> 13) & 0x01) != 0)
552  }
553  #[doc = "Bit 14 - PARITYE"]
554  #[inline(always)]
555  pub fn paritye(&self) -> PARITYE_R {
556    PARITYE_R::new(((self.bits >> 14) & 0x01) != 0)
557  }
558  #[doc = "Bit 15 - NOISY"]
559  #[inline(always)]
560  pub fn noisy(&self) -> NOISY_R {
561    NOISY_R::new(((self.bits >> 15) & 0x01) != 0)
562  }
563}
564impl W {
565  #[doc = "Bit 0 - R0T0"]
566  #[inline(always)]
567  pub fn r0t0(&mut self) -> R0T0_W {
568    R0T0_W { w: self }
569  }
570  #[doc = "Bit 1 - R1T1"]
571  #[inline(always)]
572  pub fn r1t1(&mut self) -> R1T1_W {
573    R1T1_W { w: self }
574  }
575  #[doc = "Bit 2 - R2T2"]
576  #[inline(always)]
577  pub fn r2t2(&mut self) -> R2T2_W {
578    R2T2_W { w: self }
579  }
580  #[doc = "Bit 3 - R3T3"]
581  #[inline(always)]
582  pub fn r3t3(&mut self) -> R3T3_W {
583    R3T3_W { w: self }
584  }
585  #[doc = "Bit 4 - R4T4"]
586  #[inline(always)]
587  pub fn r4t4(&mut self) -> R4T4_W {
588    R4T4_W { w: self }
589  }
590  #[doc = "Bit 5 - R5T5"]
591  #[inline(always)]
592  pub fn r5t5(&mut self) -> R5T5_W {
593    R5T5_W { w: self }
594  }
595  #[doc = "Bit 6 - R6T6"]
596  #[inline(always)]
597  pub fn r6t6(&mut self) -> R6T6_W {
598    R6T6_W { w: self }
599  }
600  #[doc = "Bit 7 - R7T7"]
601  #[inline(always)]
602  pub fn r7t7(&mut self) -> R7T7_W {
603    R7T7_W { w: self }
604  }
605  #[doc = "Bit 8 - R8T8"]
606  #[inline(always)]
607  pub fn r8t8(&mut self) -> R8T8_W {
608    R8T8_W { w: self }
609  }
610  #[doc = "Bit 9 - R9T9"]
611  #[inline(always)]
612  pub fn r9t9(&mut self) -> R9T9_W {
613    R9T9_W { w: self }
614  }
615  #[doc = "Bit 13 - Frame Error / Transmit Special Character"]
616  #[inline(always)]
617  pub fn fretsc(&mut self) -> FRETSC_W {
618    FRETSC_W { w: self }
619  }
620}