nrf5340_app_pac/cti_s/
ctigate.rs

1#[doc = "Register `CTIGATE` reader"]
2pub struct R(crate::R<CTIGATE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CTIGATE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CTIGATE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CTIGATE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `CTIGATE` writer"]
17pub struct W(crate::W<CTIGATE_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<CTIGATE_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<CTIGATE_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<CTIGATE_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `CTIGATEEN_0` reader - Enable ctichout0."]
38pub type CTIGATEEN_0_R = crate::BitReader<CTIGATEEN_0_A>;
39#[doc = "Enable ctichout0.\n\nValue on reset: 1"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum CTIGATEEN_0_A {
42    #[doc = "1: Enable ctichout channel 0 propagation."]
43    ENABLED = 1,
44    #[doc = "0: Disable ctichout channel 0 propagation."]
45    DISABLED = 0,
46}
47impl From<CTIGATEEN_0_A> for bool {
48    #[inline(always)]
49    fn from(variant: CTIGATEEN_0_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl CTIGATEEN_0_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> CTIGATEEN_0_A {
57        match self.bits {
58            true => CTIGATEEN_0_A::ENABLED,
59            false => CTIGATEEN_0_A::DISABLED,
60        }
61    }
62    #[doc = "Checks if the value of the field is `ENABLED`"]
63    #[inline(always)]
64    pub fn is_enabled(&self) -> bool {
65        *self == CTIGATEEN_0_A::ENABLED
66    }
67    #[doc = "Checks if the value of the field is `DISABLED`"]
68    #[inline(always)]
69    pub fn is_disabled(&self) -> bool {
70        *self == CTIGATEEN_0_A::DISABLED
71    }
72}
73#[doc = "Field `CTIGATEEN_0` writer - Enable ctichout0."]
74pub type CTIGATEEN_0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTIGATE_SPEC, CTIGATEEN_0_A, O>;
75impl<'a, const O: u8> CTIGATEEN_0_W<'a, O> {
76    #[doc = "Enable ctichout channel 0 propagation."]
77    #[inline(always)]
78    pub fn enabled(self) -> &'a mut W {
79        self.variant(CTIGATEEN_0_A::ENABLED)
80    }
81    #[doc = "Disable ctichout channel 0 propagation."]
82    #[inline(always)]
83    pub fn disabled(self) -> &'a mut W {
84        self.variant(CTIGATEEN_0_A::DISABLED)
85    }
86}
87#[doc = "Field `CTIGATEEN_1` reader - Enable ctichout1."]
88pub type CTIGATEEN_1_R = crate::BitReader<CTIGATEEN_1_A>;
89#[doc = "Enable ctichout1.\n\nValue on reset: 1"]
90#[derive(Clone, Copy, Debug, PartialEq)]
91pub enum CTIGATEEN_1_A {
92    #[doc = "1: Enable ctichout channel 1 propagation."]
93    ENABLED = 1,
94    #[doc = "0: Disable ctichout channel 1 propagation."]
95    DISABLED = 0,
96}
97impl From<CTIGATEEN_1_A> for bool {
98    #[inline(always)]
99    fn from(variant: CTIGATEEN_1_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl CTIGATEEN_1_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> CTIGATEEN_1_A {
107        match self.bits {
108            true => CTIGATEEN_1_A::ENABLED,
109            false => CTIGATEEN_1_A::DISABLED,
110        }
111    }
112    #[doc = "Checks if the value of the field is `ENABLED`"]
113    #[inline(always)]
114    pub fn is_enabled(&self) -> bool {
115        *self == CTIGATEEN_1_A::ENABLED
116    }
117    #[doc = "Checks if the value of the field is `DISABLED`"]
118    #[inline(always)]
119    pub fn is_disabled(&self) -> bool {
120        *self == CTIGATEEN_1_A::DISABLED
121    }
122}
123#[doc = "Field `CTIGATEEN_1` writer - Enable ctichout1."]
124pub type CTIGATEEN_1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTIGATE_SPEC, CTIGATEEN_1_A, O>;
125impl<'a, const O: u8> CTIGATEEN_1_W<'a, O> {
126    #[doc = "Enable ctichout channel 1 propagation."]
127    #[inline(always)]
128    pub fn enabled(self) -> &'a mut W {
129        self.variant(CTIGATEEN_1_A::ENABLED)
130    }
131    #[doc = "Disable ctichout channel 1 propagation."]
132    #[inline(always)]
133    pub fn disabled(self) -> &'a mut W {
134        self.variant(CTIGATEEN_1_A::DISABLED)
135    }
136}
137#[doc = "Field `CTIGATEEN_2` reader - Enable ctichout2."]
138pub type CTIGATEEN_2_R = crate::BitReader<CTIGATEEN_2_A>;
139#[doc = "Enable ctichout2.\n\nValue on reset: 1"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum CTIGATEEN_2_A {
142    #[doc = "1: Enable ctichout channel 2 propagation."]
143    ENABLED = 1,
144    #[doc = "0: Disable ctichout channel 2 propagation."]
145    DISABLED = 0,
146}
147impl From<CTIGATEEN_2_A> for bool {
148    #[inline(always)]
149    fn from(variant: CTIGATEEN_2_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl CTIGATEEN_2_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> CTIGATEEN_2_A {
157        match self.bits {
158            true => CTIGATEEN_2_A::ENABLED,
159            false => CTIGATEEN_2_A::DISABLED,
160        }
161    }
162    #[doc = "Checks if the value of the field is `ENABLED`"]
163    #[inline(always)]
164    pub fn is_enabled(&self) -> bool {
165        *self == CTIGATEEN_2_A::ENABLED
166    }
167    #[doc = "Checks if the value of the field is `DISABLED`"]
168    #[inline(always)]
169    pub fn is_disabled(&self) -> bool {
170        *self == CTIGATEEN_2_A::DISABLED
171    }
172}
173#[doc = "Field `CTIGATEEN_2` writer - Enable ctichout2."]
174pub type CTIGATEEN_2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTIGATE_SPEC, CTIGATEEN_2_A, O>;
175impl<'a, const O: u8> CTIGATEEN_2_W<'a, O> {
176    #[doc = "Enable ctichout channel 2 propagation."]
177    #[inline(always)]
178    pub fn enabled(self) -> &'a mut W {
179        self.variant(CTIGATEEN_2_A::ENABLED)
180    }
181    #[doc = "Disable ctichout channel 2 propagation."]
182    #[inline(always)]
183    pub fn disabled(self) -> &'a mut W {
184        self.variant(CTIGATEEN_2_A::DISABLED)
185    }
186}
187#[doc = "Field `CTIGATEEN_3` reader - Enable ctichout3."]
188pub type CTIGATEEN_3_R = crate::BitReader<CTIGATEEN_3_A>;
189#[doc = "Enable ctichout3.\n\nValue on reset: 1"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum CTIGATEEN_3_A {
192    #[doc = "1: Enable ctichout channel 3 propagation."]
193    ENABLED = 1,
194    #[doc = "0: Disable ctichout channel 3 propagation."]
195    DISABLED = 0,
196}
197impl From<CTIGATEEN_3_A> for bool {
198    #[inline(always)]
199    fn from(variant: CTIGATEEN_3_A) -> Self {
200        variant as u8 != 0
201    }
202}
203impl CTIGATEEN_3_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> CTIGATEEN_3_A {
207        match self.bits {
208            true => CTIGATEEN_3_A::ENABLED,
209            false => CTIGATEEN_3_A::DISABLED,
210        }
211    }
212    #[doc = "Checks if the value of the field is `ENABLED`"]
213    #[inline(always)]
214    pub fn is_enabled(&self) -> bool {
215        *self == CTIGATEEN_3_A::ENABLED
216    }
217    #[doc = "Checks if the value of the field is `DISABLED`"]
218    #[inline(always)]
219    pub fn is_disabled(&self) -> bool {
220        *self == CTIGATEEN_3_A::DISABLED
221    }
222}
223#[doc = "Field `CTIGATEEN_3` writer - Enable ctichout3."]
224pub type CTIGATEEN_3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTIGATE_SPEC, CTIGATEEN_3_A, O>;
225impl<'a, const O: u8> CTIGATEEN_3_W<'a, O> {
226    #[doc = "Enable ctichout channel 3 propagation."]
227    #[inline(always)]
228    pub fn enabled(self) -> &'a mut W {
229        self.variant(CTIGATEEN_3_A::ENABLED)
230    }
231    #[doc = "Disable ctichout channel 3 propagation."]
232    #[inline(always)]
233    pub fn disabled(self) -> &'a mut W {
234        self.variant(CTIGATEEN_3_A::DISABLED)
235    }
236}
237impl R {
238    #[doc = "Bit 0 - Enable ctichout0."]
239    #[inline(always)]
240    pub fn ctigateen_0(&self) -> CTIGATEEN_0_R {
241        CTIGATEEN_0_R::new((self.bits & 1) != 0)
242    }
243    #[doc = "Bit 1 - Enable ctichout1."]
244    #[inline(always)]
245    pub fn ctigateen_1(&self) -> CTIGATEEN_1_R {
246        CTIGATEEN_1_R::new(((self.bits >> 1) & 1) != 0)
247    }
248    #[doc = "Bit 2 - Enable ctichout2."]
249    #[inline(always)]
250    pub fn ctigateen_2(&self) -> CTIGATEEN_2_R {
251        CTIGATEEN_2_R::new(((self.bits >> 2) & 1) != 0)
252    }
253    #[doc = "Bit 3 - Enable ctichout3."]
254    #[inline(always)]
255    pub fn ctigateen_3(&self) -> CTIGATEEN_3_R {
256        CTIGATEEN_3_R::new(((self.bits >> 3) & 1) != 0)
257    }
258}
259impl W {
260    #[doc = "Bit 0 - Enable ctichout0."]
261    #[inline(always)]
262    pub fn ctigateen_0(&mut self) -> CTIGATEEN_0_W<0> {
263        CTIGATEEN_0_W::new(self)
264    }
265    #[doc = "Bit 1 - Enable ctichout1."]
266    #[inline(always)]
267    pub fn ctigateen_1(&mut self) -> CTIGATEEN_1_W<1> {
268        CTIGATEEN_1_W::new(self)
269    }
270    #[doc = "Bit 2 - Enable ctichout2."]
271    #[inline(always)]
272    pub fn ctigateen_2(&mut self) -> CTIGATEEN_2_W<2> {
273        CTIGATEEN_2_W::new(self)
274    }
275    #[doc = "Bit 3 - Enable ctichout3."]
276    #[inline(always)]
277    pub fn ctigateen_3(&mut self) -> CTIGATEEN_3_W<3> {
278        CTIGATEEN_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 = "Enable CTI Channel Gate 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 [ctigate](index.html) module"]
288pub struct CTIGATE_SPEC;
289impl crate::RegisterSpec for CTIGATE_SPEC {
290    type Ux = u32;
291}
292#[doc = "`read()` method returns [ctigate::R](R) reader structure"]
293impl crate::Readable for CTIGATE_SPEC {
294    type Reader = R;
295}
296#[doc = "`write(|w| ..)` method takes [ctigate::W](W) writer structure"]
297impl crate::Writable for CTIGATE_SPEC {
298    type Writer = W;
299}
300#[doc = "`reset()` method sets CTIGATE to value 0x0f"]
301impl crate::Resettable for CTIGATE_SPEC {
302    #[inline(always)]
303    fn reset_value() -> Self::Ux {
304        0x0f
305    }
306}