atsaml21e15b/rtc/mode1/
intflag.rs1#[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 `CMP1` reader - Compare 1"]
74pub type CMP1_R = crate::BitReader<bool>;
75#[doc = "Field `CMP1` writer - Compare 1"]
76pub type CMP1_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
77#[doc = "Field `OVF` reader - Overflow"]
78pub type OVF_R = crate::BitReader<bool>;
79#[doc = "Field `OVF` writer - Overflow"]
80pub type OVF_W<'a, const O: u8> = crate::BitWriter<'a, u16, INTFLAG_SPEC, bool, O>;
81impl R {
82 #[doc = "Bit 0 - Periodic Interval 0"]
83 #[inline(always)]
84 pub fn per0(&self) -> PER0_R {
85 PER0_R::new((self.bits & 1) != 0)
86 }
87 #[doc = "Bit 1 - Periodic Interval 1"]
88 #[inline(always)]
89 pub fn per1(&self) -> PER1_R {
90 PER1_R::new(((self.bits >> 1) & 1) != 0)
91 }
92 #[doc = "Bit 2 - Periodic Interval 2"]
93 #[inline(always)]
94 pub fn per2(&self) -> PER2_R {
95 PER2_R::new(((self.bits >> 2) & 1) != 0)
96 }
97 #[doc = "Bit 3 - Periodic Interval 3"]
98 #[inline(always)]
99 pub fn per3(&self) -> PER3_R {
100 PER3_R::new(((self.bits >> 3) & 1) != 0)
101 }
102 #[doc = "Bit 4 - Periodic Interval 4"]
103 #[inline(always)]
104 pub fn per4(&self) -> PER4_R {
105 PER4_R::new(((self.bits >> 4) & 1) != 0)
106 }
107 #[doc = "Bit 5 - Periodic Interval 5"]
108 #[inline(always)]
109 pub fn per5(&self) -> PER5_R {
110 PER5_R::new(((self.bits >> 5) & 1) != 0)
111 }
112 #[doc = "Bit 6 - Periodic Interval 6"]
113 #[inline(always)]
114 pub fn per6(&self) -> PER6_R {
115 PER6_R::new(((self.bits >> 6) & 1) != 0)
116 }
117 #[doc = "Bit 7 - Periodic Interval 7"]
118 #[inline(always)]
119 pub fn per7(&self) -> PER7_R {
120 PER7_R::new(((self.bits >> 7) & 1) != 0)
121 }
122 #[doc = "Bit 8 - Compare 0"]
123 #[inline(always)]
124 pub fn cmp0(&self) -> CMP0_R {
125 CMP0_R::new(((self.bits >> 8) & 1) != 0)
126 }
127 #[doc = "Bit 9 - Compare 1"]
128 #[inline(always)]
129 pub fn cmp1(&self) -> CMP1_R {
130 CMP1_R::new(((self.bits >> 9) & 1) != 0)
131 }
132 #[doc = "Bit 15 - Overflow"]
133 #[inline(always)]
134 pub fn ovf(&self) -> OVF_R {
135 OVF_R::new(((self.bits >> 15) & 1) != 0)
136 }
137}
138impl W {
139 #[doc = "Bit 0 - Periodic Interval 0"]
140 #[inline(always)]
141 #[must_use]
142 pub fn per0(&mut self) -> PER0_W<0> {
143 PER0_W::new(self)
144 }
145 #[doc = "Bit 1 - Periodic Interval 1"]
146 #[inline(always)]
147 #[must_use]
148 pub fn per1(&mut self) -> PER1_W<1> {
149 PER1_W::new(self)
150 }
151 #[doc = "Bit 2 - Periodic Interval 2"]
152 #[inline(always)]
153 #[must_use]
154 pub fn per2(&mut self) -> PER2_W<2> {
155 PER2_W::new(self)
156 }
157 #[doc = "Bit 3 - Periodic Interval 3"]
158 #[inline(always)]
159 #[must_use]
160 pub fn per3(&mut self) -> PER3_W<3> {
161 PER3_W::new(self)
162 }
163 #[doc = "Bit 4 - Periodic Interval 4"]
164 #[inline(always)]
165 #[must_use]
166 pub fn per4(&mut self) -> PER4_W<4> {
167 PER4_W::new(self)
168 }
169 #[doc = "Bit 5 - Periodic Interval 5"]
170 #[inline(always)]
171 #[must_use]
172 pub fn per5(&mut self) -> PER5_W<5> {
173 PER5_W::new(self)
174 }
175 #[doc = "Bit 6 - Periodic Interval 6"]
176 #[inline(always)]
177 #[must_use]
178 pub fn per6(&mut self) -> PER6_W<6> {
179 PER6_W::new(self)
180 }
181 #[doc = "Bit 7 - Periodic Interval 7"]
182 #[inline(always)]
183 #[must_use]
184 pub fn per7(&mut self) -> PER7_W<7> {
185 PER7_W::new(self)
186 }
187 #[doc = "Bit 8 - Compare 0"]
188 #[inline(always)]
189 #[must_use]
190 pub fn cmp0(&mut self) -> CMP0_W<8> {
191 CMP0_W::new(self)
192 }
193 #[doc = "Bit 9 - Compare 1"]
194 #[inline(always)]
195 #[must_use]
196 pub fn cmp1(&mut self) -> CMP1_W<9> {
197 CMP1_W::new(self)
198 }
199 #[doc = "Bit 15 - Overflow"]
200 #[inline(always)]
201 #[must_use]
202 pub fn ovf(&mut self) -> OVF_W<15> {
203 OVF_W::new(self)
204 }
205 #[doc = "Writes raw bits to the register."]
206 #[inline(always)]
207 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
208 self.0.bits(bits);
209 self
210 }
211}
212#[doc = "MODE1 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"]
213pub struct INTFLAG_SPEC;
214impl crate::RegisterSpec for INTFLAG_SPEC {
215 type Ux = u16;
216}
217#[doc = "`read()` method returns [intflag::R](R) reader structure"]
218impl crate::Readable for INTFLAG_SPEC {
219 type Reader = R;
220}
221#[doc = "`write(|w| ..)` method takes [intflag::W](W) writer structure"]
222impl crate::Writable for INTFLAG_SPEC {
223 type Writer = W;
224 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
225 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
226}
227#[doc = "`reset()` method sets INTFLAG to value 0"]
228impl crate::Resettable for INTFLAG_SPEC {
229 const RESET_VALUE: Self::Ux = 0;
230}