nrf5340_app_pac/cti_s/
ctiinen.rs

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