nrf5340_app_pac/cti_s/
ctiouten.rs

1#[doc = "Register `CTIOUTEN[%s]` reader"]
2pub struct R(crate::R<CTIOUTEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTIOUTEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTIOUTEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTIOUTEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTIOUTEN[%s]` writer"]
17pub struct W(crate::W<CTIOUTEN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTIOUTEN_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<CTIOUTEN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTIOUTEN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `TRIGOUTEN_0` reader - Enables a cross trigger event to ctitrigout when channel 0 is activated."]
38pub type TRIGOUTEN_0_R = crate::BitReader<TRIGOUTEN_0_A>;
39#[doc = "Enables a cross trigger event to ctitrigout when channel 0 is activated.\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum TRIGOUTEN_0_A {
42    #[doc = "0: Channel 0 is ignored by output trigger n."]
43    DISABLED = 0,
44    #[doc = "1: When an event occurs on channel 0, generate an event on output event n (ctitrigout\\[n\\])."]
45    ENABLED = 1,
46}
47impl From<TRIGOUTEN_0_A> for bool {
48    #[inline(always)]
49    fn from(variant: TRIGOUTEN_0_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl TRIGOUTEN_0_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> TRIGOUTEN_0_A {
57        match self.bits {
58            false => TRIGOUTEN_0_A::DISABLED,
59            true => TRIGOUTEN_0_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 == TRIGOUTEN_0_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 == TRIGOUTEN_0_A::ENABLED
71    }
72}
73#[doc = "Field `TRIGOUTEN_0` writer - Enables a cross trigger event to ctitrigout when channel 0 is activated."]
74pub type TRIGOUTEN_0_W<'a, const O: u8> =
75    crate::BitWriter<'a, u32, CTIOUTEN_SPEC, TRIGOUTEN_0_A, O>;
76impl<'a, const O: u8> TRIGOUTEN_0_W<'a, O> {
77    #[doc = "Channel 0 is ignored by output trigger n."]
78    #[inline(always)]
79    pub fn disabled(self) -> &'a mut W {
80        self.variant(TRIGOUTEN_0_A::DISABLED)
81    }
82    #[doc = "When an event occurs on channel 0, generate an event on output event n (ctitrigout\\[n\\])."]
83    #[inline(always)]
84    pub fn enabled(self) -> &'a mut W {
85        self.variant(TRIGOUTEN_0_A::ENABLED)
86    }
87}
88#[doc = "Field `TRIGOUTEN_1` reader - Enables a cross trigger event to ctitrigout when channel 1 is activated."]
89pub type TRIGOUTEN_1_R = crate::BitReader<TRIGOUTEN_1_A>;
90#[doc = "Enables a cross trigger event to ctitrigout when channel 1 is activated.\n\nValue on reset: 0"]
91#[derive(Clone, Copy, Debug, PartialEq)]
92pub enum TRIGOUTEN_1_A {
93    #[doc = "0: Channel 1 is ignored by output trigger n."]
94    DISABLED = 0,
95    #[doc = "1: When an event occurs on channel 1, generate an event on output event n (ctitrigout\\[n\\])."]
96    ENABLED = 1,
97}
98impl From<TRIGOUTEN_1_A> for bool {
99    #[inline(always)]
100    fn from(variant: TRIGOUTEN_1_A) -> Self {
101        variant as u8 != 0
102    }
103}
104impl TRIGOUTEN_1_R {
105    #[doc = "Get enumerated values variant"]
106    #[inline(always)]
107    pub fn variant(&self) -> TRIGOUTEN_1_A {
108        match self.bits {
109            false => TRIGOUTEN_1_A::DISABLED,
110            true => TRIGOUTEN_1_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 == TRIGOUTEN_1_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 == TRIGOUTEN_1_A::ENABLED
122    }
123}
124#[doc = "Field `TRIGOUTEN_1` writer - Enables a cross trigger event to ctitrigout when channel 1 is activated."]
125pub type TRIGOUTEN_1_W<'a, const O: u8> =
126    crate::BitWriter<'a, u32, CTIOUTEN_SPEC, TRIGOUTEN_1_A, O>;
127impl<'a, const O: u8> TRIGOUTEN_1_W<'a, O> {
128    #[doc = "Channel 1 is ignored by output trigger n."]
129    #[inline(always)]
130    pub fn disabled(self) -> &'a mut W {
131        self.variant(TRIGOUTEN_1_A::DISABLED)
132    }
133    #[doc = "When an event occurs on channel 1, generate an event on output event n (ctitrigout\\[n\\])."]
134    #[inline(always)]
135    pub fn enabled(self) -> &'a mut W {
136        self.variant(TRIGOUTEN_1_A::ENABLED)
137    }
138}
139#[doc = "Field `TRIGOUTEN_2` reader - Enables a cross trigger event to ctitrigout when channel 2 is activated."]
140pub type TRIGOUTEN_2_R = crate::BitReader<TRIGOUTEN_2_A>;
141#[doc = "Enables a cross trigger event to ctitrigout when channel 2 is activated.\n\nValue on reset: 0"]
142#[derive(Clone, Copy, Debug, PartialEq)]
143pub enum TRIGOUTEN_2_A {
144    #[doc = "0: Channel 2 is ignored by output trigger n."]
145    DISABLED = 0,
146    #[doc = "1: When an event occurs on channel 2, generate an event on output event n (ctitrigout\\[n\\])."]
147    ENABLED = 1,
148}
149impl From<TRIGOUTEN_2_A> for bool {
150    #[inline(always)]
151    fn from(variant: TRIGOUTEN_2_A) -> Self {
152        variant as u8 != 0
153    }
154}
155impl TRIGOUTEN_2_R {
156    #[doc = "Get enumerated values variant"]
157    #[inline(always)]
158    pub fn variant(&self) -> TRIGOUTEN_2_A {
159        match self.bits {
160            false => TRIGOUTEN_2_A::DISABLED,
161            true => TRIGOUTEN_2_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 == TRIGOUTEN_2_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 == TRIGOUTEN_2_A::ENABLED
173    }
174}
175#[doc = "Field `TRIGOUTEN_2` writer - Enables a cross trigger event to ctitrigout when channel 2 is activated."]
176pub type TRIGOUTEN_2_W<'a, const O: u8> =
177    crate::BitWriter<'a, u32, CTIOUTEN_SPEC, TRIGOUTEN_2_A, O>;
178impl<'a, const O: u8> TRIGOUTEN_2_W<'a, O> {
179    #[doc = "Channel 2 is ignored by output trigger n."]
180    #[inline(always)]
181    pub fn disabled(self) -> &'a mut W {
182        self.variant(TRIGOUTEN_2_A::DISABLED)
183    }
184    #[doc = "When an event occurs on channel 2, generate an event on output event n (ctitrigout\\[n\\])."]
185    #[inline(always)]
186    pub fn enabled(self) -> &'a mut W {
187        self.variant(TRIGOUTEN_2_A::ENABLED)
188    }
189}
190#[doc = "Field `TRIGOUTEN_3` reader - Enables a cross trigger event to ctitrigout when channel 3 is activated."]
191pub type TRIGOUTEN_3_R = crate::BitReader<TRIGOUTEN_3_A>;
192#[doc = "Enables a cross trigger event to ctitrigout when channel 3 is activated.\n\nValue on reset: 0"]
193#[derive(Clone, Copy, Debug, PartialEq)]
194pub enum TRIGOUTEN_3_A {
195    #[doc = "0: Channel 3 is ignored by output trigger n."]
196    DISABLED = 0,
197    #[doc = "1: When an event occurs on channel 3, generate an event on output event n (ctitrigout\\[n\\])."]
198    ENABLED = 1,
199}
200impl From<TRIGOUTEN_3_A> for bool {
201    #[inline(always)]
202    fn from(variant: TRIGOUTEN_3_A) -> Self {
203        variant as u8 != 0
204    }
205}
206impl TRIGOUTEN_3_R {
207    #[doc = "Get enumerated values variant"]
208    #[inline(always)]
209    pub fn variant(&self) -> TRIGOUTEN_3_A {
210        match self.bits {
211            false => TRIGOUTEN_3_A::DISABLED,
212            true => TRIGOUTEN_3_A::ENABLED,
213        }
214    }
215    #[doc = "Checks if the value of the field is `DISABLED`"]
216    #[inline(always)]
217    pub fn is_disabled(&self) -> bool {
218        *self == TRIGOUTEN_3_A::DISABLED
219    }
220    #[doc = "Checks if the value of the field is `ENABLED`"]
221    #[inline(always)]
222    pub fn is_enabled(&self) -> bool {
223        *self == TRIGOUTEN_3_A::ENABLED
224    }
225}
226#[doc = "Field `TRIGOUTEN_3` writer - Enables a cross trigger event to ctitrigout when channel 3 is activated."]
227pub type TRIGOUTEN_3_W<'a, const O: u8> =
228    crate::BitWriter<'a, u32, CTIOUTEN_SPEC, TRIGOUTEN_3_A, O>;
229impl<'a, const O: u8> TRIGOUTEN_3_W<'a, O> {
230    #[doc = "Channel 3 is ignored by output trigger n."]
231    #[inline(always)]
232    pub fn disabled(self) -> &'a mut W {
233        self.variant(TRIGOUTEN_3_A::DISABLED)
234    }
235    #[doc = "When an event occurs on channel 3, generate an event on output event n (ctitrigout\\[n\\])."]
236    #[inline(always)]
237    pub fn enabled(self) -> &'a mut W {
238        self.variant(TRIGOUTEN_3_A::ENABLED)
239    }
240}
241impl R {
242    #[doc = "Bit 0 - Enables a cross trigger event to ctitrigout when channel 0 is activated."]
243    #[inline(always)]
244    pub fn trigouten_0(&self) -> TRIGOUTEN_0_R {
245        TRIGOUTEN_0_R::new((self.bits & 1) != 0)
246    }
247    #[doc = "Bit 1 - Enables a cross trigger event to ctitrigout when channel 1 is activated."]
248    #[inline(always)]
249    pub fn trigouten_1(&self) -> TRIGOUTEN_1_R {
250        TRIGOUTEN_1_R::new(((self.bits >> 1) & 1) != 0)
251    }
252    #[doc = "Bit 2 - Enables a cross trigger event to ctitrigout when channel 2 is activated."]
253    #[inline(always)]
254    pub fn trigouten_2(&self) -> TRIGOUTEN_2_R {
255        TRIGOUTEN_2_R::new(((self.bits >> 2) & 1) != 0)
256    }
257    #[doc = "Bit 3 - Enables a cross trigger event to ctitrigout when channel 3 is activated."]
258    #[inline(always)]
259    pub fn trigouten_3(&self) -> TRIGOUTEN_3_R {
260        TRIGOUTEN_3_R::new(((self.bits >> 3) & 1) != 0)
261    }
262}
263impl W {
264    #[doc = "Bit 0 - Enables a cross trigger event to ctitrigout when channel 0 is activated."]
265    #[inline(always)]
266    pub fn trigouten_0(&mut self) -> TRIGOUTEN_0_W<0> {
267        TRIGOUTEN_0_W::new(self)
268    }
269    #[doc = "Bit 1 - Enables a cross trigger event to ctitrigout when channel 1 is activated."]
270    #[inline(always)]
271    pub fn trigouten_1(&mut self) -> TRIGOUTEN_1_W<1> {
272        TRIGOUTEN_1_W::new(self)
273    }
274    #[doc = "Bit 2 - Enables a cross trigger event to ctitrigout when channel 2 is activated."]
275    #[inline(always)]
276    pub fn trigouten_2(&mut self) -> TRIGOUTEN_2_W<2> {
277        TRIGOUTEN_2_W::new(self)
278    }
279    #[doc = "Bit 3 - Enables a cross trigger event to ctitrigout when channel 3 is activated."]
280    #[inline(always)]
281    pub fn trigouten_3(&mut self) -> TRIGOUTEN_3_W<3> {
282        TRIGOUTEN_3_W::new(self)
283    }
284    #[doc = "Writes raw bits to the register."]
285    #[inline(always)]
286    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
287        self.0.bits(bits);
288        self
289    }
290}
291#[doc = "Description collection: CTI Trigger output\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 [ctiouten](index.html) module"]
292pub struct CTIOUTEN_SPEC;
293impl crate::RegisterSpec for CTIOUTEN_SPEC {
294    type Ux = u32;
295}
296#[doc = "`read()` method returns [ctiouten::R](R) reader structure"]
297impl crate::Readable for CTIOUTEN_SPEC {
298    type Reader = R;
299}
300#[doc = "`write(|w| ..)` method takes [ctiouten::W](W) writer structure"]
301impl crate::Writable for CTIOUTEN_SPEC {
302    type Writer = W;
303}
304#[doc = "`reset()` method sets CTIOUTEN[%s]
305to value 0"]
306impl crate::Resettable for CTIOUTEN_SPEC {
307    #[inline(always)]
308    fn reset_value() -> Self::Ux {
309        0
310    }
311}