atsamd51p/pdec/
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 `QERR` reader - Quadrature Error Flag"]
6pub type QerrR = crate::BitReader;
7#[doc = "Field `QERR` writer - Quadrature Error Flag"]
8pub type QerrW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `IDXERR` reader - Index Error Flag"]
10pub type IdxerrR = crate::BitReader;
11#[doc = "Field `IDXERR` writer - Index Error Flag"]
12pub type IdxerrW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `MPERR` reader - Missing Pulse Error flag"]
14pub type MperrR = crate::BitReader;
15#[doc = "Field `MPERR` writer - Missing Pulse Error flag"]
16pub type MperrW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `WINERR` reader - Window Error Flag"]
18pub type WinerrR = crate::BitReader;
19#[doc = "Field `WINERR` writer - Window Error Flag"]
20pub type WinerrW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `HERR` reader - Hall Error Flag"]
22pub type HerrR = crate::BitReader;
23#[doc = "Field `HERR` writer - Hall Error Flag"]
24pub type HerrW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `STOP` reader - Stop"]
26pub type StopR = crate::BitReader;
27#[doc = "Field `STOP` writer - Stop"]
28pub type StopW<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `DIR` reader - Direction Status Flag"]
30pub type DirR = crate::BitReader;
31#[doc = "Field `DIR` writer - Direction Status Flag"]
32pub type DirW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `PRESCBUFV` reader - Prescaler Buffer Valid"]
34pub type PrescbufvR = crate::BitReader;
35#[doc = "Field `PRESCBUFV` writer - Prescaler Buffer Valid"]
36pub type PrescbufvW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `FILTERBUFV` reader - Filter Buffer Valid"]
38pub type FilterbufvR = crate::BitReader;
39#[doc = "Field `FILTERBUFV` writer - Filter Buffer Valid"]
40pub type FilterbufvW<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `CCBUFV0` reader - Compare Channel 0 Buffer Valid"]
42pub type Ccbufv0R = crate::BitReader;
43#[doc = "Field `CCBUFV0` writer - Compare Channel 0 Buffer Valid"]
44pub type Ccbufv0W<'a, REG> = crate::BitWriter<'a, REG>;
45#[doc = "Field `CCBUFV1` reader - Compare Channel 1 Buffer Valid"]
46pub type Ccbufv1R = crate::BitReader;
47#[doc = "Field `CCBUFV1` writer - Compare Channel 1 Buffer Valid"]
48pub type Ccbufv1W<'a, REG> = crate::BitWriter<'a, REG>;
49impl R {
50    #[doc = "Bit 0 - Quadrature Error Flag"]
51    #[inline(always)]
52    pub fn qerr(&self) -> QerrR {
53        QerrR::new((self.bits & 1) != 0)
54    }
55    #[doc = "Bit 1 - Index Error Flag"]
56    #[inline(always)]
57    pub fn idxerr(&self) -> IdxerrR {
58        IdxerrR::new(((self.bits >> 1) & 1) != 0)
59    }
60    #[doc = "Bit 2 - Missing Pulse Error flag"]
61    #[inline(always)]
62    pub fn mperr(&self) -> MperrR {
63        MperrR::new(((self.bits >> 2) & 1) != 0)
64    }
65    #[doc = "Bit 4 - Window Error Flag"]
66    #[inline(always)]
67    pub fn winerr(&self) -> WinerrR {
68        WinerrR::new(((self.bits >> 4) & 1) != 0)
69    }
70    #[doc = "Bit 5 - Hall Error Flag"]
71    #[inline(always)]
72    pub fn herr(&self) -> HerrR {
73        HerrR::new(((self.bits >> 5) & 1) != 0)
74    }
75    #[doc = "Bit 6 - Stop"]
76    #[inline(always)]
77    pub fn stop(&self) -> StopR {
78        StopR::new(((self.bits >> 6) & 1) != 0)
79    }
80    #[doc = "Bit 7 - Direction Status Flag"]
81    #[inline(always)]
82    pub fn dir(&self) -> DirR {
83        DirR::new(((self.bits >> 7) & 1) != 0)
84    }
85    #[doc = "Bit 8 - Prescaler Buffer Valid"]
86    #[inline(always)]
87    pub fn prescbufv(&self) -> PrescbufvR {
88        PrescbufvR::new(((self.bits >> 8) & 1) != 0)
89    }
90    #[doc = "Bit 9 - Filter Buffer Valid"]
91    #[inline(always)]
92    pub fn filterbufv(&self) -> FilterbufvR {
93        FilterbufvR::new(((self.bits >> 9) & 1) != 0)
94    }
95    #[doc = "Bit 12 - Compare Channel 0 Buffer Valid"]
96    #[inline(always)]
97    pub fn ccbufv0(&self) -> Ccbufv0R {
98        Ccbufv0R::new(((self.bits >> 12) & 1) != 0)
99    }
100    #[doc = "Bit 13 - Compare Channel 1 Buffer Valid"]
101    #[inline(always)]
102    pub fn ccbufv1(&self) -> Ccbufv1R {
103        Ccbufv1R::new(((self.bits >> 13) & 1) != 0)
104    }
105}
106impl W {
107    #[doc = "Bit 0 - Quadrature Error Flag"]
108    #[inline(always)]
109    #[must_use]
110    pub fn qerr(&mut self) -> QerrW<StatusSpec> {
111        QerrW::new(self, 0)
112    }
113    #[doc = "Bit 1 - Index Error Flag"]
114    #[inline(always)]
115    #[must_use]
116    pub fn idxerr(&mut self) -> IdxerrW<StatusSpec> {
117        IdxerrW::new(self, 1)
118    }
119    #[doc = "Bit 2 - Missing Pulse Error flag"]
120    #[inline(always)]
121    #[must_use]
122    pub fn mperr(&mut self) -> MperrW<StatusSpec> {
123        MperrW::new(self, 2)
124    }
125    #[doc = "Bit 4 - Window Error Flag"]
126    #[inline(always)]
127    #[must_use]
128    pub fn winerr(&mut self) -> WinerrW<StatusSpec> {
129        WinerrW::new(self, 4)
130    }
131    #[doc = "Bit 5 - Hall Error Flag"]
132    #[inline(always)]
133    #[must_use]
134    pub fn herr(&mut self) -> HerrW<StatusSpec> {
135        HerrW::new(self, 5)
136    }
137    #[doc = "Bit 6 - Stop"]
138    #[inline(always)]
139    #[must_use]
140    pub fn stop(&mut self) -> StopW<StatusSpec> {
141        StopW::new(self, 6)
142    }
143    #[doc = "Bit 7 - Direction Status Flag"]
144    #[inline(always)]
145    #[must_use]
146    pub fn dir(&mut self) -> DirW<StatusSpec> {
147        DirW::new(self, 7)
148    }
149    #[doc = "Bit 8 - Prescaler Buffer Valid"]
150    #[inline(always)]
151    #[must_use]
152    pub fn prescbufv(&mut self) -> PrescbufvW<StatusSpec> {
153        PrescbufvW::new(self, 8)
154    }
155    #[doc = "Bit 9 - Filter Buffer Valid"]
156    #[inline(always)]
157    #[must_use]
158    pub fn filterbufv(&mut self) -> FilterbufvW<StatusSpec> {
159        FilterbufvW::new(self, 9)
160    }
161    #[doc = "Bit 12 - Compare Channel 0 Buffer Valid"]
162    #[inline(always)]
163    #[must_use]
164    pub fn ccbufv0(&mut self) -> Ccbufv0W<StatusSpec> {
165        Ccbufv0W::new(self, 12)
166    }
167    #[doc = "Bit 13 - Compare Channel 1 Buffer Valid"]
168    #[inline(always)]
169    #[must_use]
170    pub fn ccbufv1(&mut self) -> Ccbufv1W<StatusSpec> {
171        Ccbufv1W::new(self, 13)
172    }
173}
174#[doc = "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)."]
175pub struct StatusSpec;
176impl crate::RegisterSpec for StatusSpec {
177    type Ux = u16;
178}
179#[doc = "`read()` method returns [`status::R`](R) reader structure"]
180impl crate::Readable for StatusSpec {}
181#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
182impl crate::Writable for StatusSpec {
183    type Safety = crate::Unsafe;
184    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
185    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
186}
187#[doc = "`reset()` method sets STATUS to value 0x40"]
188impl crate::Resettable for StatusSpec {
189    const RESET_VALUE: u16 = 0x40;
190}