atsaml21e16b/rtc/mode0/
intflag.rs

1#[doc = "Register `INTFLAG` reader"]
2pub struct R(crate::R<INTFLAG_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTFLAG_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTFLAG_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTFLAG_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTFLAG` writer"]
17pub struct W(crate::W<INTFLAG_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTFLAG_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<INTFLAG_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTFLAG_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PER0` reader - Periodic Interval 0"]
38pub type PER0_R = crate::BitReader<bool>;
39#[doc = "Field `PER0` writer - Periodic Interval 0"]
40pub type PER0_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
41#[doc = "Field `PER1` reader - Periodic Interval 1"]
42pub type PER1_R = crate::BitReader<bool>;
43#[doc = "Field `PER1` writer - Periodic Interval 1"]
44pub type PER1_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
45#[doc = "Field `PER2` reader - Periodic Interval 2"]
46pub type PER2_R = crate::BitReader<bool>;
47#[doc = "Field `PER2` writer - Periodic Interval 2"]
48pub type PER2_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
49#[doc = "Field `PER3` reader - Periodic Interval 3"]
50pub type PER3_R = crate::BitReader<bool>;
51#[doc = "Field `PER3` writer - Periodic Interval 3"]
52pub type PER3_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
53#[doc = "Field `PER4` reader - Periodic Interval 4"]
54pub type PER4_R = crate::BitReader<bool>;
55#[doc = "Field `PER4` writer - Periodic Interval 4"]
56pub type PER4_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
57#[doc = "Field `PER5` reader - Periodic Interval 5"]
58pub type PER5_R = crate::BitReader<bool>;
59#[doc = "Field `PER5` writer - Periodic Interval 5"]
60pub type PER5_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
61#[doc = "Field `PER6` reader - Periodic Interval 6"]
62pub type PER6_R = crate::BitReader<bool>;
63#[doc = "Field `PER6` writer - Periodic Interval 6"]
64pub type PER6_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
65#[doc = "Field `PER7` reader - Periodic Interval 7"]
66pub type PER7_R = crate::BitReader<bool>;
67#[doc = "Field `PER7` writer - Periodic Interval 7"]
68pub type PER7_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
69#[doc = "Field `CMP0` reader - Compare 0"]
70pub type CMP0_R = crate::BitReader<bool>;
71#[doc = "Field `CMP0` writer - Compare 0"]
72pub type CMP0_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
73#[doc = "Field `OVF` reader - Overflow"]
74pub type OVF_R = crate::BitReader<bool>;
75#[doc = "Field `OVF` writer - Overflow"]
76pub type OVF_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
77impl R {
78    #[doc = "Bit 0 - Periodic Interval 0"]
79    #[inline(always)]
80    pub fn per0(&self) -> PER0_R {
81        PER0_R::new((self.bits & 1) != 0)
82    }
83    #[doc = "Bit 1 - Periodic Interval 1"]
84    #[inline(always)]
85    pub fn per1(&self) -> PER1_R {
86        PER1_R::new(((self.bits >> 1) & 1) != 0)
87    }
88    #[doc = "Bit 2 - Periodic Interval 2"]
89    #[inline(always)]
90    pub fn per2(&self) -> PER2_R {
91        PER2_R::new(((self.bits >> 2) & 1) != 0)
92    }
93    #[doc = "Bit 3 - Periodic Interval 3"]
94    #[inline(always)]
95    pub fn per3(&self) -> PER3_R {
96        PER3_R::new(((self.bits >> 3) & 1) != 0)
97    }
98    #[doc = "Bit 4 - Periodic Interval 4"]
99    #[inline(always)]
100    pub fn per4(&self) -> PER4_R {
101        PER4_R::new(((self.bits >> 4) & 1) != 0)
102    }
103    #[doc = "Bit 5 - Periodic Interval 5"]
104    #[inline(always)]
105    pub fn per5(&self) -> PER5_R {
106        PER5_R::new(((self.bits >> 5) & 1) != 0)
107    }
108    #[doc = "Bit 6 - Periodic Interval 6"]
109    #[inline(always)]
110    pub fn per6(&self) -> PER6_R {
111        PER6_R::new(((self.bits >> 6) & 1) != 0)
112    }
113    #[doc = "Bit 7 - Periodic Interval 7"]
114    #[inline(always)]
115    pub fn per7(&self) -> PER7_R {
116        PER7_R::new(((self.bits >> 7) & 1) != 0)
117    }
118    #[doc = "Bit 8 - Compare 0"]
119    #[inline(always)]
120    pub fn cmp0(&self) -> CMP0_R {
121        CMP0_R::new(((self.bits >> 8) & 1) != 0)
122    }
123    #[doc = "Bit 15 - Overflow"]
124    #[inline(always)]
125    pub fn ovf(&self) -> OVF_R {
126        OVF_R::new(((self.bits >> 15) & 1) != 0)
127    }
128}
129impl W {
130    #[doc = "Bit 0 - Periodic Interval 0"]
131    #[inline(always)]
132    #[must_use]
133    pub fn per0(&mut self) -> PER0_W<0> {
134        PER0_W::new(self)
135    }
136    #[doc = "Bit 1 - Periodic Interval 1"]
137    #[inline(always)]
138    #[must_use]
139    pub fn per1(&mut self) -> PER1_W<1> {
140        PER1_W::new(self)
141    }
142    #[doc = "Bit 2 - Periodic Interval 2"]
143    #[inline(always)]
144    #[must_use]
145    pub fn per2(&mut self) -> PER2_W<2> {
146        PER2_W::new(self)
147    }
148    #[doc = "Bit 3 - Periodic Interval 3"]
149    #[inline(always)]
150    #[must_use]
151    pub fn per3(&mut self) -> PER3_W<3> {
152        PER3_W::new(self)
153    }
154    #[doc = "Bit 4 - Periodic Interval 4"]
155    #[inline(always)]
156    #[must_use]
157    pub fn per4(&mut self) -> PER4_W<4> {
158        PER4_W::new(self)
159    }
160    #[doc = "Bit 5 - Periodic Interval 5"]
161    #[inline(always)]
162    #[must_use]
163    pub fn per5(&mut self) -> PER5_W<5> {
164        PER5_W::new(self)
165    }
166    #[doc = "Bit 6 - Periodic Interval 6"]
167    #[inline(always)]
168    #[must_use]
169    pub fn per6(&mut self) -> PER6_W<6> {
170        PER6_W::new(self)
171    }
172    #[doc = "Bit 7 - Periodic Interval 7"]
173    #[inline(always)]
174    #[must_use]
175    pub fn per7(&mut self) -> PER7_W<7> {
176        PER7_W::new(self)
177    }
178    #[doc = "Bit 8 - Compare 0"]
179    #[inline(always)]
180    #[must_use]
181    pub fn cmp0(&mut self) -> CMP0_W<8> {
182        CMP0_W::new(self)
183    }
184    #[doc = "Bit 15 - Overflow"]
185    #[inline(always)]
186    #[must_use]
187    pub fn ovf(&mut self) -> OVF_W<15> {
188        OVF_W::new(self)
189    }
190    #[doc = "Writes raw bits to the register."]
191    #[inline(always)]
192    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
193        self.0.bits(bits);
194        self
195    }
196}
197#[doc = "MODE0 Interrupt Flag Status and Clear\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 [intflag](index.html) module"]
198pub struct INTFLAG_SPEC;
199impl crate::RegisterSpec for INTFLAG_SPEC {
200    type Ux = u16;
201}
202#[doc = "`read()` method returns [intflag::R](R) reader structure"]
203impl crate::Readable for INTFLAG_SPEC {
204    type Reader = R;
205}
206#[doc = "`write(|w| ..)` method takes [intflag::W](W) writer structure"]
207impl crate::Writable for INTFLAG_SPEC {
208    type Writer = W;
209    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
210    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
211}
212#[doc = "`reset()` method sets INTFLAG to value 0"]
213impl crate::Resettable for INTFLAG_SPEC {
214    const RESET_VALUE: Self::Ux = 0;
215}