nrf5340_net_pac/rtc0_ns/
shorts.rs1#[doc = "Register `SHORTS` reader"]
2pub struct R(crate::R<SHORTS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SHORTS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SHORTS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SHORTS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `SHORTS` writer"]
17pub struct W(crate::W<SHORTS_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SHORTS_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<SHORTS_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SHORTS_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `COMPARE0_CLEAR` reader - Shortcut between event COMPARE\\[0\\]
38and task CLEAR"]
39pub type COMPARE0_CLEAR_R = crate::BitReader<COMPARE0_CLEAR_A>;
40#[doc = "Shortcut between event COMPARE\\[0\\]
41and task CLEAR\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq)]
43pub enum COMPARE0_CLEAR_A {
44 #[doc = "0: Disable shortcut"]
45 DISABLED = 0,
46 #[doc = "1: Enable shortcut"]
47 ENABLED = 1,
48}
49impl From<COMPARE0_CLEAR_A> for bool {
50 #[inline(always)]
51 fn from(variant: COMPARE0_CLEAR_A) -> Self {
52 variant as u8 != 0
53 }
54}
55impl COMPARE0_CLEAR_R {
56 #[doc = "Get enumerated values variant"]
57 #[inline(always)]
58 pub fn variant(&self) -> COMPARE0_CLEAR_A {
59 match self.bits {
60 false => COMPARE0_CLEAR_A::DISABLED,
61 true => COMPARE0_CLEAR_A::ENABLED,
62 }
63 }
64 #[doc = "Checks if the value of the field is `DISABLED`"]
65 #[inline(always)]
66 pub fn is_disabled(&self) -> bool {
67 *self == COMPARE0_CLEAR_A::DISABLED
68 }
69 #[doc = "Checks if the value of the field is `ENABLED`"]
70 #[inline(always)]
71 pub fn is_enabled(&self) -> bool {
72 *self == COMPARE0_CLEAR_A::ENABLED
73 }
74}
75#[doc = "Field `COMPARE0_CLEAR` writer - Shortcut between event COMPARE\\[0\\]
76and task CLEAR"]
77pub type COMPARE0_CLEAR_W<'a, const O: u8> =
78 crate::BitWriter<'a, u32, SHORTS_SPEC, COMPARE0_CLEAR_A, O>;
79impl<'a, const O: u8> COMPARE0_CLEAR_W<'a, O> {
80 #[doc = "Disable shortcut"]
81 #[inline(always)]
82 pub fn disabled(self) -> &'a mut W {
83 self.variant(COMPARE0_CLEAR_A::DISABLED)
84 }
85 #[doc = "Enable shortcut"]
86 #[inline(always)]
87 pub fn enabled(self) -> &'a mut W {
88 self.variant(COMPARE0_CLEAR_A::ENABLED)
89 }
90}
91#[doc = "Field `COMPARE1_CLEAR` reader - Shortcut between event COMPARE\\[1\\]
92and task CLEAR"]
93pub type COMPARE1_CLEAR_R = crate::BitReader<COMPARE1_CLEAR_A>;
94#[doc = "Shortcut between event COMPARE\\[1\\]
95and task CLEAR\n\nValue on reset: 0"]
96#[derive(Clone, Copy, Debug, PartialEq)]
97pub enum COMPARE1_CLEAR_A {
98 #[doc = "0: Disable shortcut"]
99 DISABLED = 0,
100 #[doc = "1: Enable shortcut"]
101 ENABLED = 1,
102}
103impl From<COMPARE1_CLEAR_A> for bool {
104 #[inline(always)]
105 fn from(variant: COMPARE1_CLEAR_A) -> Self {
106 variant as u8 != 0
107 }
108}
109impl COMPARE1_CLEAR_R {
110 #[doc = "Get enumerated values variant"]
111 #[inline(always)]
112 pub fn variant(&self) -> COMPARE1_CLEAR_A {
113 match self.bits {
114 false => COMPARE1_CLEAR_A::DISABLED,
115 true => COMPARE1_CLEAR_A::ENABLED,
116 }
117 }
118 #[doc = "Checks if the value of the field is `DISABLED`"]
119 #[inline(always)]
120 pub fn is_disabled(&self) -> bool {
121 *self == COMPARE1_CLEAR_A::DISABLED
122 }
123 #[doc = "Checks if the value of the field is `ENABLED`"]
124 #[inline(always)]
125 pub fn is_enabled(&self) -> bool {
126 *self == COMPARE1_CLEAR_A::ENABLED
127 }
128}
129#[doc = "Field `COMPARE1_CLEAR` writer - Shortcut between event COMPARE\\[1\\]
130and task CLEAR"]
131pub type COMPARE1_CLEAR_W<'a, const O: u8> =
132 crate::BitWriter<'a, u32, SHORTS_SPEC, COMPARE1_CLEAR_A, O>;
133impl<'a, const O: u8> COMPARE1_CLEAR_W<'a, O> {
134 #[doc = "Disable shortcut"]
135 #[inline(always)]
136 pub fn disabled(self) -> &'a mut W {
137 self.variant(COMPARE1_CLEAR_A::DISABLED)
138 }
139 #[doc = "Enable shortcut"]
140 #[inline(always)]
141 pub fn enabled(self) -> &'a mut W {
142 self.variant(COMPARE1_CLEAR_A::ENABLED)
143 }
144}
145#[doc = "Field `COMPARE2_CLEAR` reader - Shortcut between event COMPARE\\[2\\]
146and task CLEAR"]
147pub type COMPARE2_CLEAR_R = crate::BitReader<COMPARE2_CLEAR_A>;
148#[doc = "Shortcut between event COMPARE\\[2\\]
149and task CLEAR\n\nValue on reset: 0"]
150#[derive(Clone, Copy, Debug, PartialEq)]
151pub enum COMPARE2_CLEAR_A {
152 #[doc = "0: Disable shortcut"]
153 DISABLED = 0,
154 #[doc = "1: Enable shortcut"]
155 ENABLED = 1,
156}
157impl From<COMPARE2_CLEAR_A> for bool {
158 #[inline(always)]
159 fn from(variant: COMPARE2_CLEAR_A) -> Self {
160 variant as u8 != 0
161 }
162}
163impl COMPARE2_CLEAR_R {
164 #[doc = "Get enumerated values variant"]
165 #[inline(always)]
166 pub fn variant(&self) -> COMPARE2_CLEAR_A {
167 match self.bits {
168 false => COMPARE2_CLEAR_A::DISABLED,
169 true => COMPARE2_CLEAR_A::ENABLED,
170 }
171 }
172 #[doc = "Checks if the value of the field is `DISABLED`"]
173 #[inline(always)]
174 pub fn is_disabled(&self) -> bool {
175 *self == COMPARE2_CLEAR_A::DISABLED
176 }
177 #[doc = "Checks if the value of the field is `ENABLED`"]
178 #[inline(always)]
179 pub fn is_enabled(&self) -> bool {
180 *self == COMPARE2_CLEAR_A::ENABLED
181 }
182}
183#[doc = "Field `COMPARE2_CLEAR` writer - Shortcut between event COMPARE\\[2\\]
184and task CLEAR"]
185pub type COMPARE2_CLEAR_W<'a, const O: u8> =
186 crate::BitWriter<'a, u32, SHORTS_SPEC, COMPARE2_CLEAR_A, O>;
187impl<'a, const O: u8> COMPARE2_CLEAR_W<'a, O> {
188 #[doc = "Disable shortcut"]
189 #[inline(always)]
190 pub fn disabled(self) -> &'a mut W {
191 self.variant(COMPARE2_CLEAR_A::DISABLED)
192 }
193 #[doc = "Enable shortcut"]
194 #[inline(always)]
195 pub fn enabled(self) -> &'a mut W {
196 self.variant(COMPARE2_CLEAR_A::ENABLED)
197 }
198}
199#[doc = "Field `COMPARE3_CLEAR` reader - Shortcut between event COMPARE\\[3\\]
200and task CLEAR"]
201pub type COMPARE3_CLEAR_R = crate::BitReader<COMPARE3_CLEAR_A>;
202#[doc = "Shortcut between event COMPARE\\[3\\]
203and task CLEAR\n\nValue on reset: 0"]
204#[derive(Clone, Copy, Debug, PartialEq)]
205pub enum COMPARE3_CLEAR_A {
206 #[doc = "0: Disable shortcut"]
207 DISABLED = 0,
208 #[doc = "1: Enable shortcut"]
209 ENABLED = 1,
210}
211impl From<COMPARE3_CLEAR_A> for bool {
212 #[inline(always)]
213 fn from(variant: COMPARE3_CLEAR_A) -> Self {
214 variant as u8 != 0
215 }
216}
217impl COMPARE3_CLEAR_R {
218 #[doc = "Get enumerated values variant"]
219 #[inline(always)]
220 pub fn variant(&self) -> COMPARE3_CLEAR_A {
221 match self.bits {
222 false => COMPARE3_CLEAR_A::DISABLED,
223 true => COMPARE3_CLEAR_A::ENABLED,
224 }
225 }
226 #[doc = "Checks if the value of the field is `DISABLED`"]
227 #[inline(always)]
228 pub fn is_disabled(&self) -> bool {
229 *self == COMPARE3_CLEAR_A::DISABLED
230 }
231 #[doc = "Checks if the value of the field is `ENABLED`"]
232 #[inline(always)]
233 pub fn is_enabled(&self) -> bool {
234 *self == COMPARE3_CLEAR_A::ENABLED
235 }
236}
237#[doc = "Field `COMPARE3_CLEAR` writer - Shortcut between event COMPARE\\[3\\]
238and task CLEAR"]
239pub type COMPARE3_CLEAR_W<'a, const O: u8> =
240 crate::BitWriter<'a, u32, SHORTS_SPEC, COMPARE3_CLEAR_A, O>;
241impl<'a, const O: u8> COMPARE3_CLEAR_W<'a, O> {
242 #[doc = "Disable shortcut"]
243 #[inline(always)]
244 pub fn disabled(self) -> &'a mut W {
245 self.variant(COMPARE3_CLEAR_A::DISABLED)
246 }
247 #[doc = "Enable shortcut"]
248 #[inline(always)]
249 pub fn enabled(self) -> &'a mut W {
250 self.variant(COMPARE3_CLEAR_A::ENABLED)
251 }
252}
253impl R {
254 #[doc = "Bit 0 - Shortcut between event COMPARE\\[0\\]
255and task CLEAR"]
256 #[inline(always)]
257 pub fn compare0_clear(&self) -> COMPARE0_CLEAR_R {
258 COMPARE0_CLEAR_R::new((self.bits & 1) != 0)
259 }
260 #[doc = "Bit 1 - Shortcut between event COMPARE\\[1\\]
261and task CLEAR"]
262 #[inline(always)]
263 pub fn compare1_clear(&self) -> COMPARE1_CLEAR_R {
264 COMPARE1_CLEAR_R::new(((self.bits >> 1) & 1) != 0)
265 }
266 #[doc = "Bit 2 - Shortcut between event COMPARE\\[2\\]
267and task CLEAR"]
268 #[inline(always)]
269 pub fn compare2_clear(&self) -> COMPARE2_CLEAR_R {
270 COMPARE2_CLEAR_R::new(((self.bits >> 2) & 1) != 0)
271 }
272 #[doc = "Bit 3 - Shortcut between event COMPARE\\[3\\]
273and task CLEAR"]
274 #[inline(always)]
275 pub fn compare3_clear(&self) -> COMPARE3_CLEAR_R {
276 COMPARE3_CLEAR_R::new(((self.bits >> 3) & 1) != 0)
277 }
278}
279impl W {
280 #[doc = "Bit 0 - Shortcut between event COMPARE\\[0\\]
281and task CLEAR"]
282 #[inline(always)]
283 pub fn compare0_clear(&mut self) -> COMPARE0_CLEAR_W<0> {
284 COMPARE0_CLEAR_W::new(self)
285 }
286 #[doc = "Bit 1 - Shortcut between event COMPARE\\[1\\]
287and task CLEAR"]
288 #[inline(always)]
289 pub fn compare1_clear(&mut self) -> COMPARE1_CLEAR_W<1> {
290 COMPARE1_CLEAR_W::new(self)
291 }
292 #[doc = "Bit 2 - Shortcut between event COMPARE\\[2\\]
293and task CLEAR"]
294 #[inline(always)]
295 pub fn compare2_clear(&mut self) -> COMPARE2_CLEAR_W<2> {
296 COMPARE2_CLEAR_W::new(self)
297 }
298 #[doc = "Bit 3 - Shortcut between event COMPARE\\[3\\]
299and task CLEAR"]
300 #[inline(always)]
301 pub fn compare3_clear(&mut self) -> COMPARE3_CLEAR_W<3> {
302 COMPARE3_CLEAR_W::new(self)
303 }
304 #[doc = "Writes raw bits to the register."]
305 #[inline(always)]
306 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
307 self.0.bits(bits);
308 self
309 }
310}
311#[doc = "Shortcuts between local events and tasks\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 [shorts](index.html) module"]
312pub struct SHORTS_SPEC;
313impl crate::RegisterSpec for SHORTS_SPEC {
314 type Ux = u32;
315}
316#[doc = "`read()` method returns [shorts::R](R) reader structure"]
317impl crate::Readable for SHORTS_SPEC {
318 type Reader = R;
319}
320#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
321impl crate::Writable for SHORTS_SPEC {
322 type Writer = W;
323}
324#[doc = "`reset()` method sets SHORTS to value 0"]
325impl crate::Resettable for SHORTS_SPEC {
326 #[inline(always)]
327 fn reset_value() -> Self::Ux {
328 0
329 }
330}