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