atsaml21j18bu/rtc/mode2/
evctrl.rs1#[doc = "Register `EVCTRL` reader"]
2pub struct R(crate::R<EVCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<EVCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<EVCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<EVCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `EVCTRL` writer"]
17pub struct W(crate::W<EVCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<EVCTRL_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<EVCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<EVCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `PEREO0` reader - Periodic Interval 0 Event Output Enable"]
38pub type PEREO0_R = crate::BitReader<bool>;
39#[doc = "Field `PEREO0` writer - Periodic Interval 0 Event Output Enable"]
40pub type PEREO0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
41#[doc = "Field `PEREO1` reader - Periodic Interval 1 Event Output Enable"]
42pub type PEREO1_R = crate::BitReader<bool>;
43#[doc = "Field `PEREO1` writer - Periodic Interval 1 Event Output Enable"]
44pub type PEREO1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
45#[doc = "Field `PEREO2` reader - Periodic Interval 2 Event Output Enable"]
46pub type PEREO2_R = crate::BitReader<bool>;
47#[doc = "Field `PEREO2` writer - Periodic Interval 2 Event Output Enable"]
48pub type PEREO2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
49#[doc = "Field `PEREO3` reader - Periodic Interval 3 Event Output Enable"]
50pub type PEREO3_R = crate::BitReader<bool>;
51#[doc = "Field `PEREO3` writer - Periodic Interval 3 Event Output Enable"]
52pub type PEREO3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
53#[doc = "Field `PEREO4` reader - Periodic Interval 4 Event Output Enable"]
54pub type PEREO4_R = crate::BitReader<bool>;
55#[doc = "Field `PEREO4` writer - Periodic Interval 4 Event Output Enable"]
56pub type PEREO4_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
57#[doc = "Field `PEREO5` reader - Periodic Interval 5 Event Output Enable"]
58pub type PEREO5_R = crate::BitReader<bool>;
59#[doc = "Field `PEREO5` writer - Periodic Interval 5 Event Output Enable"]
60pub type PEREO5_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
61#[doc = "Field `PEREO6` reader - Periodic Interval 6 Event Output Enable"]
62pub type PEREO6_R = crate::BitReader<bool>;
63#[doc = "Field `PEREO6` writer - Periodic Interval 6 Event Output Enable"]
64pub type PEREO6_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
65#[doc = "Field `PEREO7` reader - Periodic Interval 7 Event Output Enable"]
66pub type PEREO7_R = crate::BitReader<bool>;
67#[doc = "Field `PEREO7` writer - Periodic Interval 7 Event Output Enable"]
68pub type PEREO7_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
69#[doc = "Field `ALARMEO0` reader - Alarm 0 Event Output Enable"]
70pub type ALARMEO0_R = crate::BitReader<bool>;
71#[doc = "Field `ALARMEO0` writer - Alarm 0 Event Output Enable"]
72pub type ALARMEO0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
73#[doc = "Field `OVFEO` reader - Overflow Event Output Enable"]
74pub type OVFEO_R = crate::BitReader<bool>;
75#[doc = "Field `OVFEO` writer - Overflow Event Output Enable"]
76pub type OVFEO_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVCTRL_SPEC, bool, O>;
77impl R {
78 #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
79 #[inline(always)]
80 pub fn pereo0(&self) -> PEREO0_R {
81 PEREO0_R::new((self.bits & 1) != 0)
82 }
83 #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
84 #[inline(always)]
85 pub fn pereo1(&self) -> PEREO1_R {
86 PEREO1_R::new(((self.bits >> 1) & 1) != 0)
87 }
88 #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
89 #[inline(always)]
90 pub fn pereo2(&self) -> PEREO2_R {
91 PEREO2_R::new(((self.bits >> 2) & 1) != 0)
92 }
93 #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
94 #[inline(always)]
95 pub fn pereo3(&self) -> PEREO3_R {
96 PEREO3_R::new(((self.bits >> 3) & 1) != 0)
97 }
98 #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
99 #[inline(always)]
100 pub fn pereo4(&self) -> PEREO4_R {
101 PEREO4_R::new(((self.bits >> 4) & 1) != 0)
102 }
103 #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
104 #[inline(always)]
105 pub fn pereo5(&self) -> PEREO5_R {
106 PEREO5_R::new(((self.bits >> 5) & 1) != 0)
107 }
108 #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
109 #[inline(always)]
110 pub fn pereo6(&self) -> PEREO6_R {
111 PEREO6_R::new(((self.bits >> 6) & 1) != 0)
112 }
113 #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
114 #[inline(always)]
115 pub fn pereo7(&self) -> PEREO7_R {
116 PEREO7_R::new(((self.bits >> 7) & 1) != 0)
117 }
118 #[doc = "Bit 8 - Alarm 0 Event Output Enable"]
119 #[inline(always)]
120 pub fn alarmeo0(&self) -> ALARMEO0_R {
121 ALARMEO0_R::new(((self.bits >> 8) & 1) != 0)
122 }
123 #[doc = "Bit 15 - Overflow Event Output Enable"]
124 #[inline(always)]
125 pub fn ovfeo(&self) -> OVFEO_R {
126 OVFEO_R::new(((self.bits >> 15) & 1) != 0)
127 }
128}
129impl W {
130 #[doc = "Bit 0 - Periodic Interval 0 Event Output Enable"]
131 #[inline(always)]
132 #[must_use]
133 pub fn pereo0(&mut self) -> PEREO0_W<0> {
134 PEREO0_W::new(self)
135 }
136 #[doc = "Bit 1 - Periodic Interval 1 Event Output Enable"]
137 #[inline(always)]
138 #[must_use]
139 pub fn pereo1(&mut self) -> PEREO1_W<1> {
140 PEREO1_W::new(self)
141 }
142 #[doc = "Bit 2 - Periodic Interval 2 Event Output Enable"]
143 #[inline(always)]
144 #[must_use]
145 pub fn pereo2(&mut self) -> PEREO2_W<2> {
146 PEREO2_W::new(self)
147 }
148 #[doc = "Bit 3 - Periodic Interval 3 Event Output Enable"]
149 #[inline(always)]
150 #[must_use]
151 pub fn pereo3(&mut self) -> PEREO3_W<3> {
152 PEREO3_W::new(self)
153 }
154 #[doc = "Bit 4 - Periodic Interval 4 Event Output Enable"]
155 #[inline(always)]
156 #[must_use]
157 pub fn pereo4(&mut self) -> PEREO4_W<4> {
158 PEREO4_W::new(self)
159 }
160 #[doc = "Bit 5 - Periodic Interval 5 Event Output Enable"]
161 #[inline(always)]
162 #[must_use]
163 pub fn pereo5(&mut self) -> PEREO5_W<5> {
164 PEREO5_W::new(self)
165 }
166 #[doc = "Bit 6 - Periodic Interval 6 Event Output Enable"]
167 #[inline(always)]
168 #[must_use]
169 pub fn pereo6(&mut self) -> PEREO6_W<6> {
170 PEREO6_W::new(self)
171 }
172 #[doc = "Bit 7 - Periodic Interval 7 Event Output Enable"]
173 #[inline(always)]
174 #[must_use]
175 pub fn pereo7(&mut self) -> PEREO7_W<7> {
176 PEREO7_W::new(self)
177 }
178 #[doc = "Bit 8 - Alarm 0 Event Output Enable"]
179 #[inline(always)]
180 #[must_use]
181 pub fn alarmeo0(&mut self) -> ALARMEO0_W<8> {
182 ALARMEO0_W::new(self)
183 }
184 #[doc = "Bit 15 - Overflow Event Output Enable"]
185 #[inline(always)]
186 #[must_use]
187 pub fn ovfeo(&mut self) -> OVFEO_W<15> {
188 OVFEO_W::new(self)
189 }
190 #[doc = "Writes raw bits to the register."]
191 #[inline(always)]
192 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
193 self.0.bits(bits);
194 self
195 }
196}
197#[doc = "MODE2 Event Control\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 [evctrl](index.html) module"]
198pub struct EVCTRL_SPEC;
199impl crate::RegisterSpec for EVCTRL_SPEC {
200 type Ux = u32;
201}
202#[doc = "`read()` method returns [evctrl::R](R) reader structure"]
203impl crate::Readable for EVCTRL_SPEC {
204 type Reader = R;
205}
206#[doc = "`write(|w| ..)` method takes [evctrl::W](W) writer structure"]
207impl crate::Writable for EVCTRL_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 EVCTRL to value 0"]
213impl crate::Resettable for EVCTRL_SPEC {
214 const RESET_VALUE: Self::Ux = 0;
215}