nrf52833_pac/timer0/
tasks_capture.rs1#[doc = "Register `TASKS_CAPTURE[%s]` writer"]
2pub struct W(crate::W<TASKS_CAPTURE_SPEC>);
3impl core::ops::Deref for W {
4 type Target = crate::W<TASKS_CAPTURE_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl core::ops::DerefMut for W {
11 #[inline(always)]
12 fn deref_mut(&mut self) -> &mut Self::Target {
13 &mut self.0
14 }
15}
16impl From<crate::W<TASKS_CAPTURE_SPEC>> for W {
17 #[inline(always)]
18 fn from(writer: crate::W<TASKS_CAPTURE_SPEC>) -> Self {
19 W(writer)
20 }
21}
22#[doc = "Capture Timer value to CC\\[n\\]
23register\n\nValue on reset: 0"]
24#[derive(Clone, Copy, Debug, PartialEq)]
25pub enum TASKS_CAPTURE_AW {
26 #[doc = "1: Trigger task"]
27 TRIGGER = 1,
28}
29impl From<TASKS_CAPTURE_AW> for bool {
30 #[inline(always)]
31 fn from(variant: TASKS_CAPTURE_AW) -> Self {
32 variant as u8 != 0
33 }
34}
35#[doc = "Field `TASKS_CAPTURE` writer - Capture Timer value to CC\\[n\\]
36register"]
37pub type TASKS_CAPTURE_W<'a, const O: u8> =
38 crate::BitWriter<'a, u32, TASKS_CAPTURE_SPEC, TASKS_CAPTURE_AW, O>;
39impl<'a, const O: u8> TASKS_CAPTURE_W<'a, O> {
40 #[doc = "Trigger task"]
41 #[inline(always)]
42 pub fn trigger(self) -> &'a mut W {
43 self.variant(TASKS_CAPTURE_AW::TRIGGER)
44 }
45}
46impl W {
47 #[doc = "Bit 0 - Capture Timer value to CC\\[n\\]
48register"]
49 #[inline(always)]
50 pub fn tasks_capture(&mut self) -> TASKS_CAPTURE_W<0> {
51 TASKS_CAPTURE_W::new(self)
52 }
53 #[doc = "Writes raw bits to the register."]
54 #[inline(always)]
55 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
56 self.0.bits(bits);
57 self
58 }
59}
60#[doc = "Description collection: Capture Timer value to CC\\[n\\]
61register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_capture](index.html) module"]
62pub struct TASKS_CAPTURE_SPEC;
63impl crate::RegisterSpec for TASKS_CAPTURE_SPEC {
64 type Ux = u32;
65}
66#[doc = "`write(|w| ..)` method takes [tasks_capture::W](W) writer structure"]
67impl crate::Writable for TASKS_CAPTURE_SPEC {
68 type Writer = W;
69}
70#[doc = "`reset()` method sets TASKS_CAPTURE[%s]
71to value 0"]
72impl crate::Resettable for TASKS_CAPTURE_SPEC {
73 #[inline(always)]
74 fn reset_value() -> Self::Ux {
75 0
76 }
77}