nrf5340_app_pac/clock_ns/
publish_lfclkstarted.rs1#[doc = "Register `PUBLISH_LFCLKSTARTED` reader"]
2pub struct R(crate::R<PUBLISH_LFCLKSTARTED_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PUBLISH_LFCLKSTARTED_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PUBLISH_LFCLKSTARTED_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PUBLISH_LFCLKSTARTED_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PUBLISH_LFCLKSTARTED` writer"]
17pub struct W(crate::W<PUBLISH_LFCLKSTARTED_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PUBLISH_LFCLKSTARTED_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<PUBLISH_LFCLKSTARTED_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PUBLISH_LFCLKSTARTED_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `CHIDX` reader - DPPI channel that event LFCLKSTARTED will publish to."]
38pub type CHIDX_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `CHIDX` writer - DPPI channel that event LFCLKSTARTED will publish to."]
40pub type CHIDX_W<'a, const O: u8> =
41 crate::FieldWriter<'a, u32, PUBLISH_LFCLKSTARTED_SPEC, u8, u8, 8, O>;
42#[doc = "Field `EN` reader - "]
43pub type EN_R = crate::BitReader<EN_A>;
44#[doc = "\n\nValue on reset: 0"]
45#[derive(Clone, Copy, Debug, PartialEq)]
46pub enum EN_A {
47 #[doc = "0: Disable publishing"]
48 DISABLED = 0,
49 #[doc = "1: Enable publishing"]
50 ENABLED = 1,
51}
52impl From<EN_A> for bool {
53 #[inline(always)]
54 fn from(variant: EN_A) -> Self {
55 variant as u8 != 0
56 }
57}
58impl EN_R {
59 #[doc = "Get enumerated values variant"]
60 #[inline(always)]
61 pub fn variant(&self) -> EN_A {
62 match self.bits {
63 false => EN_A::DISABLED,
64 true => EN_A::ENABLED,
65 }
66 }
67 #[doc = "Checks if the value of the field is `DISABLED`"]
68 #[inline(always)]
69 pub fn is_disabled(&self) -> bool {
70 *self == EN_A::DISABLED
71 }
72 #[doc = "Checks if the value of the field is `ENABLED`"]
73 #[inline(always)]
74 pub fn is_enabled(&self) -> bool {
75 *self == EN_A::ENABLED
76 }
77}
78#[doc = "Field `EN` writer - "]
79pub type EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PUBLISH_LFCLKSTARTED_SPEC, EN_A, O>;
80impl<'a, const O: u8> EN_W<'a, O> {
81 #[doc = "Disable publishing"]
82 #[inline(always)]
83 pub fn disabled(self) -> &'a mut W {
84 self.variant(EN_A::DISABLED)
85 }
86 #[doc = "Enable publishing"]
87 #[inline(always)]
88 pub fn enabled(self) -> &'a mut W {
89 self.variant(EN_A::ENABLED)
90 }
91}
92impl R {
93 #[doc = "Bits 0:7 - DPPI channel that event LFCLKSTARTED will publish to."]
94 #[inline(always)]
95 pub fn chidx(&self) -> CHIDX_R {
96 CHIDX_R::new((self.bits & 0xff) as u8)
97 }
98 #[doc = "Bit 31"]
99 #[inline(always)]
100 pub fn en(&self) -> EN_R {
101 EN_R::new(((self.bits >> 31) & 1) != 0)
102 }
103}
104impl W {
105 #[doc = "Bits 0:7 - DPPI channel that event LFCLKSTARTED will publish to."]
106 #[inline(always)]
107 pub fn chidx(&mut self) -> CHIDX_W<0> {
108 CHIDX_W::new(self)
109 }
110 #[doc = "Bit 31"]
111 #[inline(always)]
112 pub fn en(&mut self) -> EN_W<31> {
113 EN_W::new(self)
114 }
115 #[doc = "Writes raw bits to the register."]
116 #[inline(always)]
117 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
118 self.0.bits(bits);
119 self
120 }
121}
122#[doc = "Publish configuration for event LFCLKSTARTED\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 [publish_lfclkstarted](index.html) module"]
123pub struct PUBLISH_LFCLKSTARTED_SPEC;
124impl crate::RegisterSpec for PUBLISH_LFCLKSTARTED_SPEC {
125 type Ux = u32;
126}
127#[doc = "`read()` method returns [publish_lfclkstarted::R](R) reader structure"]
128impl crate::Readable for PUBLISH_LFCLKSTARTED_SPEC {
129 type Reader = R;
130}
131#[doc = "`write(|w| ..)` method takes [publish_lfclkstarted::W](W) writer structure"]
132impl crate::Writable for PUBLISH_LFCLKSTARTED_SPEC {
133 type Writer = W;
134}
135#[doc = "`reset()` method sets PUBLISH_LFCLKSTARTED to value 0"]
136impl crate::Resettable for PUBLISH_LFCLKSTARTED_SPEC {
137 #[inline(always)]
138 fn reset_value() -> Self::Ux {
139 0
140 }
141}