nrf5340_app_pac/twim0_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 `LASTTX_STARTRX` reader - Shortcut between event LASTTX and task STARTRX"]
38pub type LASTTX_STARTRX_R = crate::BitReader<LASTTX_STARTRX_A>;
39#[doc = "Shortcut between event LASTTX and task STARTRX\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum LASTTX_STARTRX_A {
42 #[doc = "0: Disable shortcut"]
43 DISABLED = 0,
44 #[doc = "1: Enable shortcut"]
45 ENABLED = 1,
46}
47impl From<LASTTX_STARTRX_A> for bool {
48 #[inline(always)]
49 fn from(variant: LASTTX_STARTRX_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl LASTTX_STARTRX_R {
54 #[doc = "Get enumerated values variant"]
55 #[inline(always)]
56 pub fn variant(&self) -> LASTTX_STARTRX_A {
57 match self.bits {
58 false => LASTTX_STARTRX_A::DISABLED,
59 true => LASTTX_STARTRX_A::ENABLED,
60 }
61 }
62 #[doc = "Checks if the value of the field is `DISABLED`"]
63 #[inline(always)]
64 pub fn is_disabled(&self) -> bool {
65 *self == LASTTX_STARTRX_A::DISABLED
66 }
67 #[doc = "Checks if the value of the field is `ENABLED`"]
68 #[inline(always)]
69 pub fn is_enabled(&self) -> bool {
70 *self == LASTTX_STARTRX_A::ENABLED
71 }
72}
73#[doc = "Field `LASTTX_STARTRX` writer - Shortcut between event LASTTX and task STARTRX"]
74pub type LASTTX_STARTRX_W<'a, const O: u8> =
75 crate::BitWriter<'a, u32, SHORTS_SPEC, LASTTX_STARTRX_A, O>;
76impl<'a, const O: u8> LASTTX_STARTRX_W<'a, O> {
77 #[doc = "Disable shortcut"]
78 #[inline(always)]
79 pub fn disabled(self) -> &'a mut W {
80 self.variant(LASTTX_STARTRX_A::DISABLED)
81 }
82 #[doc = "Enable shortcut"]
83 #[inline(always)]
84 pub fn enabled(self) -> &'a mut W {
85 self.variant(LASTTX_STARTRX_A::ENABLED)
86 }
87}
88#[doc = "Field `LASTTX_SUSPEND` reader - Shortcut between event LASTTX and task SUSPEND"]
89pub type LASTTX_SUSPEND_R = crate::BitReader<LASTTX_SUSPEND_A>;
90#[doc = "Shortcut between event LASTTX and task SUSPEND\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum LASTTX_SUSPEND_A {
93 #[doc = "0: Disable shortcut"]
94 DISABLED = 0,
95 #[doc = "1: Enable shortcut"]
96 ENABLED = 1,
97}
98impl From<LASTTX_SUSPEND_A> for bool {
99 #[inline(always)]
100 fn from(variant: LASTTX_SUSPEND_A) -> Self {
101 variant as u8 != 0
102 }
103}
104impl LASTTX_SUSPEND_R {
105 #[doc = "Get enumerated values variant"]
106 #[inline(always)]
107 pub fn variant(&self) -> LASTTX_SUSPEND_A {
108 match self.bits {
109 false => LASTTX_SUSPEND_A::DISABLED,
110 true => LASTTX_SUSPEND_A::ENABLED,
111 }
112 }
113 #[doc = "Checks if the value of the field is `DISABLED`"]
114 #[inline(always)]
115 pub fn is_disabled(&self) -> bool {
116 *self == LASTTX_SUSPEND_A::DISABLED
117 }
118 #[doc = "Checks if the value of the field is `ENABLED`"]
119 #[inline(always)]
120 pub fn is_enabled(&self) -> bool {
121 *self == LASTTX_SUSPEND_A::ENABLED
122 }
123}
124#[doc = "Field `LASTTX_SUSPEND` writer - Shortcut between event LASTTX and task SUSPEND"]
125pub type LASTTX_SUSPEND_W<'a, const O: u8> =
126 crate::BitWriter<'a, u32, SHORTS_SPEC, LASTTX_SUSPEND_A, O>;
127impl<'a, const O: u8> LASTTX_SUSPEND_W<'a, O> {
128 #[doc = "Disable shortcut"]
129 #[inline(always)]
130 pub fn disabled(self) -> &'a mut W {
131 self.variant(LASTTX_SUSPEND_A::DISABLED)
132 }
133 #[doc = "Enable shortcut"]
134 #[inline(always)]
135 pub fn enabled(self) -> &'a mut W {
136 self.variant(LASTTX_SUSPEND_A::ENABLED)
137 }
138}
139#[doc = "Field `LASTTX_STOP` reader - Shortcut between event LASTTX and task STOP"]
140pub type LASTTX_STOP_R = crate::BitReader<LASTTX_STOP_A>;
141#[doc = "Shortcut between event LASTTX and task STOP\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq)]
143pub enum LASTTX_STOP_A {
144 #[doc = "0: Disable shortcut"]
145 DISABLED = 0,
146 #[doc = "1: Enable shortcut"]
147 ENABLED = 1,
148}
149impl From<LASTTX_STOP_A> for bool {
150 #[inline(always)]
151 fn from(variant: LASTTX_STOP_A) -> Self {
152 variant as u8 != 0
153 }
154}
155impl LASTTX_STOP_R {
156 #[doc = "Get enumerated values variant"]
157 #[inline(always)]
158 pub fn variant(&self) -> LASTTX_STOP_A {
159 match self.bits {
160 false => LASTTX_STOP_A::DISABLED,
161 true => LASTTX_STOP_A::ENABLED,
162 }
163 }
164 #[doc = "Checks if the value of the field is `DISABLED`"]
165 #[inline(always)]
166 pub fn is_disabled(&self) -> bool {
167 *self == LASTTX_STOP_A::DISABLED
168 }
169 #[doc = "Checks if the value of the field is `ENABLED`"]
170 #[inline(always)]
171 pub fn is_enabled(&self) -> bool {
172 *self == LASTTX_STOP_A::ENABLED
173 }
174}
175#[doc = "Field `LASTTX_STOP` writer - Shortcut between event LASTTX and task STOP"]
176pub type LASTTX_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, LASTTX_STOP_A, O>;
177impl<'a, const O: u8> LASTTX_STOP_W<'a, O> {
178 #[doc = "Disable shortcut"]
179 #[inline(always)]
180 pub fn disabled(self) -> &'a mut W {
181 self.variant(LASTTX_STOP_A::DISABLED)
182 }
183 #[doc = "Enable shortcut"]
184 #[inline(always)]
185 pub fn enabled(self) -> &'a mut W {
186 self.variant(LASTTX_STOP_A::ENABLED)
187 }
188}
189#[doc = "Field `LASTRX_STARTTX` reader - Shortcut between event LASTRX and task STARTTX"]
190pub type LASTRX_STARTTX_R = crate::BitReader<LASTRX_STARTTX_A>;
191#[doc = "Shortcut between event LASTRX and task STARTTX\n\nValue on reset: 0"]
192#[derive(Clone, Copy, Debug, PartialEq)]
193pub enum LASTRX_STARTTX_A {
194 #[doc = "0: Disable shortcut"]
195 DISABLED = 0,
196 #[doc = "1: Enable shortcut"]
197 ENABLED = 1,
198}
199impl From<LASTRX_STARTTX_A> for bool {
200 #[inline(always)]
201 fn from(variant: LASTRX_STARTTX_A) -> Self {
202 variant as u8 != 0
203 }
204}
205impl LASTRX_STARTTX_R {
206 #[doc = "Get enumerated values variant"]
207 #[inline(always)]
208 pub fn variant(&self) -> LASTRX_STARTTX_A {
209 match self.bits {
210 false => LASTRX_STARTTX_A::DISABLED,
211 true => LASTRX_STARTTX_A::ENABLED,
212 }
213 }
214 #[doc = "Checks if the value of the field is `DISABLED`"]
215 #[inline(always)]
216 pub fn is_disabled(&self) -> bool {
217 *self == LASTRX_STARTTX_A::DISABLED
218 }
219 #[doc = "Checks if the value of the field is `ENABLED`"]
220 #[inline(always)]
221 pub fn is_enabled(&self) -> bool {
222 *self == LASTRX_STARTTX_A::ENABLED
223 }
224}
225#[doc = "Field `LASTRX_STARTTX` writer - Shortcut between event LASTRX and task STARTTX"]
226pub type LASTRX_STARTTX_W<'a, const O: u8> =
227 crate::BitWriter<'a, u32, SHORTS_SPEC, LASTRX_STARTTX_A, O>;
228impl<'a, const O: u8> LASTRX_STARTTX_W<'a, O> {
229 #[doc = "Disable shortcut"]
230 #[inline(always)]
231 pub fn disabled(self) -> &'a mut W {
232 self.variant(LASTRX_STARTTX_A::DISABLED)
233 }
234 #[doc = "Enable shortcut"]
235 #[inline(always)]
236 pub fn enabled(self) -> &'a mut W {
237 self.variant(LASTRX_STARTTX_A::ENABLED)
238 }
239}
240#[doc = "Field `LASTRX_STOP` reader - Shortcut between event LASTRX and task STOP"]
241pub type LASTRX_STOP_R = crate::BitReader<LASTRX_STOP_A>;
242#[doc = "Shortcut between event LASTRX and task STOP\n\nValue on reset: 0"]
243#[derive(Clone, Copy, Debug, PartialEq)]
244pub enum LASTRX_STOP_A {
245 #[doc = "0: Disable shortcut"]
246 DISABLED = 0,
247 #[doc = "1: Enable shortcut"]
248 ENABLED = 1,
249}
250impl From<LASTRX_STOP_A> for bool {
251 #[inline(always)]
252 fn from(variant: LASTRX_STOP_A) -> Self {
253 variant as u8 != 0
254 }
255}
256impl LASTRX_STOP_R {
257 #[doc = "Get enumerated values variant"]
258 #[inline(always)]
259 pub fn variant(&self) -> LASTRX_STOP_A {
260 match self.bits {
261 false => LASTRX_STOP_A::DISABLED,
262 true => LASTRX_STOP_A::ENABLED,
263 }
264 }
265 #[doc = "Checks if the value of the field is `DISABLED`"]
266 #[inline(always)]
267 pub fn is_disabled(&self) -> bool {
268 *self == LASTRX_STOP_A::DISABLED
269 }
270 #[doc = "Checks if the value of the field is `ENABLED`"]
271 #[inline(always)]
272 pub fn is_enabled(&self) -> bool {
273 *self == LASTRX_STOP_A::ENABLED
274 }
275}
276#[doc = "Field `LASTRX_STOP` writer - Shortcut between event LASTRX and task STOP"]
277pub type LASTRX_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, LASTRX_STOP_A, O>;
278impl<'a, const O: u8> LASTRX_STOP_W<'a, O> {
279 #[doc = "Disable shortcut"]
280 #[inline(always)]
281 pub fn disabled(self) -> &'a mut W {
282 self.variant(LASTRX_STOP_A::DISABLED)
283 }
284 #[doc = "Enable shortcut"]
285 #[inline(always)]
286 pub fn enabled(self) -> &'a mut W {
287 self.variant(LASTRX_STOP_A::ENABLED)
288 }
289}
290impl R {
291 #[doc = "Bit 7 - Shortcut between event LASTTX and task STARTRX"]
292 #[inline(always)]
293 pub fn lasttx_startrx(&self) -> LASTTX_STARTRX_R {
294 LASTTX_STARTRX_R::new(((self.bits >> 7) & 1) != 0)
295 }
296 #[doc = "Bit 8 - Shortcut between event LASTTX and task SUSPEND"]
297 #[inline(always)]
298 pub fn lasttx_suspend(&self) -> LASTTX_SUSPEND_R {
299 LASTTX_SUSPEND_R::new(((self.bits >> 8) & 1) != 0)
300 }
301 #[doc = "Bit 9 - Shortcut between event LASTTX and task STOP"]
302 #[inline(always)]
303 pub fn lasttx_stop(&self) -> LASTTX_STOP_R {
304 LASTTX_STOP_R::new(((self.bits >> 9) & 1) != 0)
305 }
306 #[doc = "Bit 10 - Shortcut between event LASTRX and task STARTTX"]
307 #[inline(always)]
308 pub fn lastrx_starttx(&self) -> LASTRX_STARTTX_R {
309 LASTRX_STARTTX_R::new(((self.bits >> 10) & 1) != 0)
310 }
311 #[doc = "Bit 12 - Shortcut between event LASTRX and task STOP"]
312 #[inline(always)]
313 pub fn lastrx_stop(&self) -> LASTRX_STOP_R {
314 LASTRX_STOP_R::new(((self.bits >> 12) & 1) != 0)
315 }
316}
317impl W {
318 #[doc = "Bit 7 - Shortcut between event LASTTX and task STARTRX"]
319 #[inline(always)]
320 pub fn lasttx_startrx(&mut self) -> LASTTX_STARTRX_W<7> {
321 LASTTX_STARTRX_W::new(self)
322 }
323 #[doc = "Bit 8 - Shortcut between event LASTTX and task SUSPEND"]
324 #[inline(always)]
325 pub fn lasttx_suspend(&mut self) -> LASTTX_SUSPEND_W<8> {
326 LASTTX_SUSPEND_W::new(self)
327 }
328 #[doc = "Bit 9 - Shortcut between event LASTTX and task STOP"]
329 #[inline(always)]
330 pub fn lasttx_stop(&mut self) -> LASTTX_STOP_W<9> {
331 LASTTX_STOP_W::new(self)
332 }
333 #[doc = "Bit 10 - Shortcut between event LASTRX and task STARTTX"]
334 #[inline(always)]
335 pub fn lastrx_starttx(&mut self) -> LASTRX_STARTTX_W<10> {
336 LASTRX_STARTTX_W::new(self)
337 }
338 #[doc = "Bit 12 - Shortcut between event LASTRX and task STOP"]
339 #[inline(always)]
340 pub fn lastrx_stop(&mut self) -> LASTRX_STOP_W<12> {
341 LASTRX_STOP_W::new(self)
342 }
343 #[doc = "Writes raw bits to the register."]
344 #[inline(always)]
345 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
346 self.0.bits(bits);
347 self
348 }
349}
350#[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"]
351pub struct SHORTS_SPEC;
352impl crate::RegisterSpec for SHORTS_SPEC {
353 type Ux = u32;
354}
355#[doc = "`read()` method returns [shorts::R](R) reader structure"]
356impl crate::Readable for SHORTS_SPEC {
357 type Reader = R;
358}
359#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
360impl crate::Writable for SHORTS_SPEC {
361 type Writer = W;
362}
363#[doc = "`reset()` method sets SHORTS to value 0"]
364impl crate::Resettable for SHORTS_SPEC {
365 #[inline(always)]
366 fn reset_value() -> Self::Ux {
367 0
368 }
369}