atsamd11c/sercom0/usart/
status.rs1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<StatusSpec>;
3#[doc = "Register `STATUS` writer"]
4pub type W = crate::W<StatusSpec>;
5#[doc = "Field `PERR` reader - Parity Error"]
6pub type PerrR = crate::BitReader;
7#[doc = "Field `PERR` writer - Parity Error"]
8pub type PerrW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `FERR` reader - Frame Error"]
10pub type FerrR = crate::BitReader;
11#[doc = "Field `FERR` writer - Frame Error"]
12pub type FerrW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `BUFOVF` reader - Buffer Overflow"]
14pub type BufovfR = crate::BitReader;
15#[doc = "Field `BUFOVF` writer - Buffer Overflow"]
16pub type BufovfW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `CTS` reader - Clear To Send"]
18pub type CtsR = crate::BitReader;
19#[doc = "Field `ISF` reader - Inconsistent Sync Field"]
20pub type IsfR = crate::BitReader;
21#[doc = "Field `ISF` writer - Inconsistent Sync Field"]
22pub type IsfW<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `COLL` reader - Collision Detected"]
24pub type CollR = crate::BitReader;
25#[doc = "Field `COLL` writer - Collision Detected"]
26pub type CollW<'a, REG> = crate::BitWriter<'a, REG>;
27impl R {
28 #[doc = "Bit 0 - Parity Error"]
29 #[inline(always)]
30 pub fn perr(&self) -> PerrR {
31 PerrR::new((self.bits & 1) != 0)
32 }
33 #[doc = "Bit 1 - Frame Error"]
34 #[inline(always)]
35 pub fn ferr(&self) -> FerrR {
36 FerrR::new(((self.bits >> 1) & 1) != 0)
37 }
38 #[doc = "Bit 2 - Buffer Overflow"]
39 #[inline(always)]
40 pub fn bufovf(&self) -> BufovfR {
41 BufovfR::new(((self.bits >> 2) & 1) != 0)
42 }
43 #[doc = "Bit 3 - Clear To Send"]
44 #[inline(always)]
45 pub fn cts(&self) -> CtsR {
46 CtsR::new(((self.bits >> 3) & 1) != 0)
47 }
48 #[doc = "Bit 4 - Inconsistent Sync Field"]
49 #[inline(always)]
50 pub fn isf(&self) -> IsfR {
51 IsfR::new(((self.bits >> 4) & 1) != 0)
52 }
53 #[doc = "Bit 5 - Collision Detected"]
54 #[inline(always)]
55 pub fn coll(&self) -> CollR {
56 CollR::new(((self.bits >> 5) & 1) != 0)
57 }
58}
59impl W {
60 #[doc = "Bit 0 - Parity Error"]
61 #[inline(always)]
62 #[must_use]
63 pub fn perr(&mut self) -> PerrW<StatusSpec> {
64 PerrW::new(self, 0)
65 }
66 #[doc = "Bit 1 - Frame Error"]
67 #[inline(always)]
68 #[must_use]
69 pub fn ferr(&mut self) -> FerrW<StatusSpec> {
70 FerrW::new(self, 1)
71 }
72 #[doc = "Bit 2 - Buffer Overflow"]
73 #[inline(always)]
74 #[must_use]
75 pub fn bufovf(&mut self) -> BufovfW<StatusSpec> {
76 BufovfW::new(self, 2)
77 }
78 #[doc = "Bit 4 - Inconsistent Sync Field"]
79 #[inline(always)]
80 #[must_use]
81 pub fn isf(&mut self) -> IsfW<StatusSpec> {
82 IsfW::new(self, 4)
83 }
84 #[doc = "Bit 5 - Collision Detected"]
85 #[inline(always)]
86 #[must_use]
87 pub fn coll(&mut self) -> CollW<StatusSpec> {
88 CollW::new(self, 5)
89 }
90}
91#[doc = "USART Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`status::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
92pub struct StatusSpec;
93impl crate::RegisterSpec for StatusSpec {
94 type Ux = u16;
95}
96#[doc = "`read()` method returns [`status::R`](R) reader structure"]
97impl crate::Readable for StatusSpec {}
98#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
99impl crate::Writable for StatusSpec {
100 type Safety = crate::Unsafe;
101 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
102 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
103}
104#[doc = "`reset()` method sets STATUS to value 0"]
105impl crate::Resettable for StatusSpec {
106 const RESET_VALUE: u16 = 0;
107}