atsaml21e16b/tcc0/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `STATUS` writer"]
17pub struct W(crate::W<STATUS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<STATUS_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<STATUS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<STATUS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `STOP` reader - Stop"]
38pub type STOP_R = crate::BitReader<bool>;
39#[doc = "Field `IDX` reader - Ramp"]
40pub type IDX_R = crate::BitReader<bool>;
41#[doc = "Field `UFS` reader - Non-recoverable Update Fault State"]
42pub type UFS_R = crate::BitReader<bool>;
43#[doc = "Field `UFS` writer - Non-recoverable Update Fault State"]
44pub type UFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
45#[doc = "Field `DFS` reader - Non-Recoverable Debug Fault State"]
46pub type DFS_R = crate::BitReader<bool>;
47#[doc = "Field `DFS` writer - Non-Recoverable Debug Fault State"]
48pub type DFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
49#[doc = "Field `SLAVE` reader - Slave"]
50pub type SLAVE_R = crate::BitReader<bool>;
51#[doc = "Field `PATTBUFV` reader - Pattern Buffer Valid"]
52pub type PATTBUFV_R = crate::BitReader<bool>;
53#[doc = "Field `PATTBUFV` writer - Pattern Buffer Valid"]
54pub type PATTBUFV_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
55#[doc = "Field `PERBUFV` reader - Period Buffer Valid"]
56pub type PERBUFV_R = crate::BitReader<bool>;
57#[doc = "Field `PERBUFV` writer - Period Buffer Valid"]
58pub type PERBUFV_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
59#[doc = "Field `FAULTAIN` reader - Recoverable Fault A Input"]
60pub type FAULTAIN_R = crate::BitReader<bool>;
61#[doc = "Field `FAULTBIN` reader - Recoverable Fault B Input"]
62pub type FAULTBIN_R = crate::BitReader<bool>;
63#[doc = "Field `FAULT0IN` reader - Non-Recoverable Fault0 Input"]
64pub type FAULT0IN_R = crate::BitReader<bool>;
65#[doc = "Field `FAULT1IN` reader - Non-Recoverable Fault1 Input"]
66pub type FAULT1IN_R = crate::BitReader<bool>;
67#[doc = "Field `FAULTA` reader - Recoverable Fault A State"]
68pub type FAULTA_R = crate::BitReader<bool>;
69#[doc = "Field `FAULTA` writer - Recoverable Fault A State"]
70pub type FAULTA_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
71#[doc = "Field `FAULTB` reader - Recoverable Fault B State"]
72pub type FAULTB_R = crate::BitReader<bool>;
73#[doc = "Field `FAULTB` writer - Recoverable Fault B State"]
74pub type FAULTB_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
75#[doc = "Field `FAULT0` reader - Non-Recoverable Fault 0 State"]
76pub type FAULT0_R = crate::BitReader<bool>;
77#[doc = "Field `FAULT0` writer - Non-Recoverable Fault 0 State"]
78pub type FAULT0_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
79#[doc = "Field `FAULT1` reader - Non-Recoverable Fault 1 State"]
80pub type FAULT1_R = crate::BitReader<bool>;
81#[doc = "Field `FAULT1` writer - Non-Recoverable Fault 1 State"]
82pub type FAULT1_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
83#[doc = "Field `CCBUFV0` reader - Compare Channel 0 Buffer Valid"]
84pub type CCBUFV0_R = crate::BitReader<bool>;
85#[doc = "Field `CCBUFV0` writer - Compare Channel 0 Buffer Valid"]
86pub type CCBUFV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
87#[doc = "Field `CCBUFV1` reader - Compare Channel 1 Buffer Valid"]
88pub type CCBUFV1_R = crate::BitReader<bool>;
89#[doc = "Field `CCBUFV1` writer - Compare Channel 1 Buffer Valid"]
90pub type CCBUFV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
91#[doc = "Field `CCBUFV2` reader - Compare Channel 2 Buffer Valid"]
92pub type CCBUFV2_R = crate::BitReader<bool>;
93#[doc = "Field `CCBUFV2` writer - Compare Channel 2 Buffer Valid"]
94pub type CCBUFV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
95#[doc = "Field `CCBUFV3` reader - Compare Channel 3 Buffer Valid"]
96pub type CCBUFV3_R = crate::BitReader<bool>;
97#[doc = "Field `CCBUFV3` writer - Compare Channel 3 Buffer Valid"]
98pub type CCBUFV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>;
99#[doc = "Field `CMP0` reader - Compare Channel 0 Value"]
100pub type CMP0_R = crate::BitReader<bool>;
101#[doc = "Field `CMP1` reader - Compare Channel 1 Value"]
102pub type CMP1_R = crate::BitReader<bool>;
103#[doc = "Field `CMP2` reader - Compare Channel 2 Value"]
104pub type CMP2_R = crate::BitReader<bool>;
105#[doc = "Field `CMP3` reader - Compare Channel 3 Value"]
106pub type CMP3_R = crate::BitReader<bool>;
107impl R {
108    #[doc = "Bit 0 - Stop"]
109    #[inline(always)]
110    pub fn stop(&self) -> STOP_R {
111        STOP_R::new((self.bits & 1) != 0)
112    }
113    #[doc = "Bit 1 - Ramp"]
114    #[inline(always)]
115    pub fn idx(&self) -> IDX_R {
116        IDX_R::new(((self.bits >> 1) & 1) != 0)
117    }
118    #[doc = "Bit 2 - Non-recoverable Update Fault State"]
119    #[inline(always)]
120    pub fn ufs(&self) -> UFS_R {
121        UFS_R::new(((self.bits >> 2) & 1) != 0)
122    }
123    #[doc = "Bit 3 - Non-Recoverable Debug Fault State"]
124    #[inline(always)]
125    pub fn dfs(&self) -> DFS_R {
126        DFS_R::new(((self.bits >> 3) & 1) != 0)
127    }
128    #[doc = "Bit 4 - Slave"]
129    #[inline(always)]
130    pub fn slave(&self) -> SLAVE_R {
131        SLAVE_R::new(((self.bits >> 4) & 1) != 0)
132    }
133    #[doc = "Bit 5 - Pattern Buffer Valid"]
134    #[inline(always)]
135    pub fn pattbufv(&self) -> PATTBUFV_R {
136        PATTBUFV_R::new(((self.bits >> 5) & 1) != 0)
137    }
138    #[doc = "Bit 7 - Period Buffer Valid"]
139    #[inline(always)]
140    pub fn perbufv(&self) -> PERBUFV_R {
141        PERBUFV_R::new(((self.bits >> 7) & 1) != 0)
142    }
143    #[doc = "Bit 8 - Recoverable Fault A Input"]
144    #[inline(always)]
145    pub fn faultain(&self) -> FAULTAIN_R {
146        FAULTAIN_R::new(((self.bits >> 8) & 1) != 0)
147    }
148    #[doc = "Bit 9 - Recoverable Fault B Input"]
149    #[inline(always)]
150    pub fn faultbin(&self) -> FAULTBIN_R {
151        FAULTBIN_R::new(((self.bits >> 9) & 1) != 0)
152    }
153    #[doc = "Bit 10 - Non-Recoverable Fault0 Input"]
154    #[inline(always)]
155    pub fn fault0in(&self) -> FAULT0IN_R {
156        FAULT0IN_R::new(((self.bits >> 10) & 1) != 0)
157    }
158    #[doc = "Bit 11 - Non-Recoverable Fault1 Input"]
159    #[inline(always)]
160    pub fn fault1in(&self) -> FAULT1IN_R {
161        FAULT1IN_R::new(((self.bits >> 11) & 1) != 0)
162    }
163    #[doc = "Bit 12 - Recoverable Fault A State"]
164    #[inline(always)]
165    pub fn faulta(&self) -> FAULTA_R {
166        FAULTA_R::new(((self.bits >> 12) & 1) != 0)
167    }
168    #[doc = "Bit 13 - Recoverable Fault B State"]
169    #[inline(always)]
170    pub fn faultb(&self) -> FAULTB_R {
171        FAULTB_R::new(((self.bits >> 13) & 1) != 0)
172    }
173    #[doc = "Bit 14 - Non-Recoverable Fault 0 State"]
174    #[inline(always)]
175    pub fn fault0(&self) -> FAULT0_R {
176        FAULT0_R::new(((self.bits >> 14) & 1) != 0)
177    }
178    #[doc = "Bit 15 - Non-Recoverable Fault 1 State"]
179    #[inline(always)]
180    pub fn fault1(&self) -> FAULT1_R {
181        FAULT1_R::new(((self.bits >> 15) & 1) != 0)
182    }
183    #[doc = "Bit 16 - Compare Channel 0 Buffer Valid"]
184    #[inline(always)]
185    pub fn ccbufv0(&self) -> CCBUFV0_R {
186        CCBUFV0_R::new(((self.bits >> 16) & 1) != 0)
187    }
188    #[doc = "Bit 17 - Compare Channel 1 Buffer Valid"]
189    #[inline(always)]
190    pub fn ccbufv1(&self) -> CCBUFV1_R {
191        CCBUFV1_R::new(((self.bits >> 17) & 1) != 0)
192    }
193    #[doc = "Bit 18 - Compare Channel 2 Buffer Valid"]
194    #[inline(always)]
195    pub fn ccbufv2(&self) -> CCBUFV2_R {
196        CCBUFV2_R::new(((self.bits >> 18) & 1) != 0)
197    }
198    #[doc = "Bit 19 - Compare Channel 3 Buffer Valid"]
199    #[inline(always)]
200    pub fn ccbufv3(&self) -> CCBUFV3_R {
201        CCBUFV3_R::new(((self.bits >> 19) & 1) != 0)
202    }
203    #[doc = "Bit 24 - Compare Channel 0 Value"]
204    #[inline(always)]
205    pub fn cmp0(&self) -> CMP0_R {
206        CMP0_R::new(((self.bits >> 24) & 1) != 0)
207    }
208    #[doc = "Bit 25 - Compare Channel 1 Value"]
209    #[inline(always)]
210    pub fn cmp1(&self) -> CMP1_R {
211        CMP1_R::new(((self.bits >> 25) & 1) != 0)
212    }
213    #[doc = "Bit 26 - Compare Channel 2 Value"]
214    #[inline(always)]
215    pub fn cmp2(&self) -> CMP2_R {
216        CMP2_R::new(((self.bits >> 26) & 1) != 0)
217    }
218    #[doc = "Bit 27 - Compare Channel 3 Value"]
219    #[inline(always)]
220    pub fn cmp3(&self) -> CMP3_R {
221        CMP3_R::new(((self.bits >> 27) & 1) != 0)
222    }
223}
224impl W {
225    #[doc = "Bit 2 - Non-recoverable Update Fault State"]
226    #[inline(always)]
227    #[must_use]
228    pub fn ufs(&mut self) -> UFS_W<2> {
229        UFS_W::new(self)
230    }
231    #[doc = "Bit 3 - Non-Recoverable Debug Fault State"]
232    #[inline(always)]
233    #[must_use]
234    pub fn dfs(&mut self) -> DFS_W<3> {
235        DFS_W::new(self)
236    }
237    #[doc = "Bit 5 - Pattern Buffer Valid"]
238    #[inline(always)]
239    #[must_use]
240    pub fn pattbufv(&mut self) -> PATTBUFV_W<5> {
241        PATTBUFV_W::new(self)
242    }
243    #[doc = "Bit 7 - Period Buffer Valid"]
244    #[inline(always)]
245    #[must_use]
246    pub fn perbufv(&mut self) -> PERBUFV_W<7> {
247        PERBUFV_W::new(self)
248    }
249    #[doc = "Bit 12 - Recoverable Fault A State"]
250    #[inline(always)]
251    #[must_use]
252    pub fn faulta(&mut self) -> FAULTA_W<12> {
253        FAULTA_W::new(self)
254    }
255    #[doc = "Bit 13 - Recoverable Fault B State"]
256    #[inline(always)]
257    #[must_use]
258    pub fn faultb(&mut self) -> FAULTB_W<13> {
259        FAULTB_W::new(self)
260    }
261    #[doc = "Bit 14 - Non-Recoverable Fault 0 State"]
262    #[inline(always)]
263    #[must_use]
264    pub fn fault0(&mut self) -> FAULT0_W<14> {
265        FAULT0_W::new(self)
266    }
267    #[doc = "Bit 15 - Non-Recoverable Fault 1 State"]
268    #[inline(always)]
269    #[must_use]
270    pub fn fault1(&mut self) -> FAULT1_W<15> {
271        FAULT1_W::new(self)
272    }
273    #[doc = "Bit 16 - Compare Channel 0 Buffer Valid"]
274    #[inline(always)]
275    #[must_use]
276    pub fn ccbufv0(&mut self) -> CCBUFV0_W<16> {
277        CCBUFV0_W::new(self)
278    }
279    #[doc = "Bit 17 - Compare Channel 1 Buffer Valid"]
280    #[inline(always)]
281    #[must_use]
282    pub fn ccbufv1(&mut self) -> CCBUFV1_W<17> {
283        CCBUFV1_W::new(self)
284    }
285    #[doc = "Bit 18 - Compare Channel 2 Buffer Valid"]
286    #[inline(always)]
287    #[must_use]
288    pub fn ccbufv2(&mut self) -> CCBUFV2_W<18> {
289        CCBUFV2_W::new(self)
290    }
291    #[doc = "Bit 19 - Compare Channel 3 Buffer Valid"]
292    #[inline(always)]
293    #[must_use]
294    pub fn ccbufv3(&mut self) -> CCBUFV3_W<19> {
295        CCBUFV3_W::new(self)
296    }
297    #[doc = "Writes raw bits to the register."]
298    #[inline(always)]
299    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
300        self.0.bits(bits);
301        self
302    }
303}
304#[doc = "Status\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [status](index.html) module"]
305pub struct STATUS_SPEC;
306impl crate::RegisterSpec for STATUS_SPEC {
307    type Ux = u32;
308}
309#[doc = "`read()` method returns [status::R](R) reader structure"]
310impl crate::Readable for STATUS_SPEC {
311    type Reader = R;
312}
313#[doc = "`write(|w| ..)` method takes [status::W](W) writer structure"]
314impl crate::Writable for STATUS_SPEC {
315    type Writer = W;
316    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
317    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
318}
319#[doc = "`reset()` method sets STATUS to value 0x01"]
320impl crate::Resettable for STATUS_SPEC {
321    const RESET_VALUE: Self::Ux = 0x01;
322}