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