atsamd51g/sercom0/usart_int/
status.rs

1#[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 `CTS` writer - Clear To Send"]
20pub type CtsW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `ISF` reader - Inconsistent Sync Field"]
22pub type IsfR = crate::BitReader;
23#[doc = "Field `ISF` writer - Inconsistent Sync Field"]
24pub type IsfW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `COLL` reader - Collision Detected"]
26pub type CollR = crate::BitReader;
27#[doc = "Field `COLL` writer - Collision Detected"]
28pub type CollW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `TXE` reader - Transmitter Empty"]
30pub type TxeR = crate::BitReader;
31#[doc = "Field `TXE` writer - Transmitter Empty"]
32pub type TxeW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `ITER` reader - Maximum Number of Repetitions Reached"]
34pub type IterR = crate::BitReader;
35#[doc = "Field `ITER` writer - Maximum Number of Repetitions Reached"]
36pub type IterW<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bit 0 - Parity Error"]
39    #[inline(always)]
40    pub fn perr(&self) -> PerrR {
41        PerrR::new((self.bits & 1) != 0)
42    }
43    #[doc = "Bit 1 - Frame Error"]
44    #[inline(always)]
45    pub fn ferr(&self) -> FerrR {
46        FerrR::new(((self.bits >> 1) & 1) != 0)
47    }
48    #[doc = "Bit 2 - Buffer Overflow"]
49    #[inline(always)]
50    pub fn bufovf(&self) -> BufovfR {
51        BufovfR::new(((self.bits >> 2) & 1) != 0)
52    }
53    #[doc = "Bit 3 - Clear To Send"]
54    #[inline(always)]
55    pub fn cts(&self) -> CtsR {
56        CtsR::new(((self.bits >> 3) & 1) != 0)
57    }
58    #[doc = "Bit 4 - Inconsistent Sync Field"]
59    #[inline(always)]
60    pub fn isf(&self) -> IsfR {
61        IsfR::new(((self.bits >> 4) & 1) != 0)
62    }
63    #[doc = "Bit 5 - Collision Detected"]
64    #[inline(always)]
65    pub fn coll(&self) -> CollR {
66        CollR::new(((self.bits >> 5) & 1) != 0)
67    }
68    #[doc = "Bit 6 - Transmitter Empty"]
69    #[inline(always)]
70    pub fn txe(&self) -> TxeR {
71        TxeR::new(((self.bits >> 6) & 1) != 0)
72    }
73    #[doc = "Bit 7 - Maximum Number of Repetitions Reached"]
74    #[inline(always)]
75    pub fn iter(&self) -> IterR {
76        IterR::new(((self.bits >> 7) & 1) != 0)
77    }
78}
79impl W {
80    #[doc = "Bit 0 - Parity Error"]
81    #[inline(always)]
82    #[must_use]
83    pub fn perr(&mut self) -> PerrW<StatusSpec> {
84        PerrW::new(self, 0)
85    }
86    #[doc = "Bit 1 - Frame Error"]
87    #[inline(always)]
88    #[must_use]
89    pub fn ferr(&mut self) -> FerrW<StatusSpec> {
90        FerrW::new(self, 1)
91    }
92    #[doc = "Bit 2 - Buffer Overflow"]
93    #[inline(always)]
94    #[must_use]
95    pub fn bufovf(&mut self) -> BufovfW<StatusSpec> {
96        BufovfW::new(self, 2)
97    }
98    #[doc = "Bit 3 - Clear To Send"]
99    #[inline(always)]
100    #[must_use]
101    pub fn cts(&mut self) -> CtsW<StatusSpec> {
102        CtsW::new(self, 3)
103    }
104    #[doc = "Bit 4 - Inconsistent Sync Field"]
105    #[inline(always)]
106    #[must_use]
107    pub fn isf(&mut self) -> IsfW<StatusSpec> {
108        IsfW::new(self, 4)
109    }
110    #[doc = "Bit 5 - Collision Detected"]
111    #[inline(always)]
112    #[must_use]
113    pub fn coll(&mut self) -> CollW<StatusSpec> {
114        CollW::new(self, 5)
115    }
116    #[doc = "Bit 6 - Transmitter Empty"]
117    #[inline(always)]
118    #[must_use]
119    pub fn txe(&mut self) -> TxeW<StatusSpec> {
120        TxeW::new(self, 6)
121    }
122    #[doc = "Bit 7 - Maximum Number of Repetitions Reached"]
123    #[inline(always)]
124    #[must_use]
125    pub fn iter(&mut self) -> IterW<StatusSpec> {
126        IterW::new(self, 7)
127    }
128}
129#[doc = "USART_INT 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)."]
130pub struct StatusSpec;
131impl crate::RegisterSpec for StatusSpec {
132    type Ux = u16;
133}
134#[doc = "`read()` method returns [`status::R`](R) reader structure"]
135impl crate::Readable for StatusSpec {}
136#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
137impl crate::Writable for StatusSpec {
138    type Safety = crate::Unsafe;
139    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
140    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
141}
142#[doc = "`reset()` method sets STATUS to value 0"]
143impl crate::Resettable for StatusSpec {
144    const RESET_VALUE: u16 = 0;
145}