nrf5340_app_pac/i2s0_ns/
inten.rs1#[doc = "Register `INTEN` reader"]
2pub struct R(crate::R<INTEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTEN` writer"]
17pub struct W(crate::W<INTEN_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTEN_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<INTEN_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTEN_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `RXPTRUPD` reader - Enable or disable interrupt for event RXPTRUPD"]
38pub type RXPTRUPD_R = crate::BitReader<RXPTRUPD_A>;
39#[doc = "Enable or disable interrupt for event RXPTRUPD\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum RXPTRUPD_A {
42    #[doc = "0: Disable"]
43    DISABLED = 0,
44    #[doc = "1: Enable"]
45    ENABLED = 1,
46}
47impl From<RXPTRUPD_A> for bool {
48    #[inline(always)]
49    fn from(variant: RXPTRUPD_A) -> Self {
50        variant as u8 != 0
51    }
52}
53impl RXPTRUPD_R {
54    #[doc = "Get enumerated values variant"]
55    #[inline(always)]
56    pub fn variant(&self) -> RXPTRUPD_A {
57        match self.bits {
58            false => RXPTRUPD_A::DISABLED,
59            true => RXPTRUPD_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 == RXPTRUPD_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 == RXPTRUPD_A::ENABLED
71    }
72}
73#[doc = "Field `RXPTRUPD` writer - Enable or disable interrupt for event RXPTRUPD"]
74pub type RXPTRUPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, RXPTRUPD_A, O>;
75impl<'a, const O: u8> RXPTRUPD_W<'a, O> {
76    #[doc = "Disable"]
77    #[inline(always)]
78    pub fn disabled(self) -> &'a mut W {
79        self.variant(RXPTRUPD_A::DISABLED)
80    }
81    #[doc = "Enable"]
82    #[inline(always)]
83    pub fn enabled(self) -> &'a mut W {
84        self.variant(RXPTRUPD_A::ENABLED)
85    }
86}
87#[doc = "Field `STOPPED` reader - Enable or disable interrupt for event STOPPED"]
88pub type STOPPED_R = crate::BitReader<STOPPED_A>;
89#[doc = "Enable or disable interrupt for event STOPPED\n\nValue on reset: 0"]
90#[derive(Clone, Copy, Debug, PartialEq)]
91pub enum STOPPED_A {
92    #[doc = "0: Disable"]
93    DISABLED = 0,
94    #[doc = "1: Enable"]
95    ENABLED = 1,
96}
97impl From<STOPPED_A> for bool {
98    #[inline(always)]
99    fn from(variant: STOPPED_A) -> Self {
100        variant as u8 != 0
101    }
102}
103impl STOPPED_R {
104    #[doc = "Get enumerated values variant"]
105    #[inline(always)]
106    pub fn variant(&self) -> STOPPED_A {
107        match self.bits {
108            false => STOPPED_A::DISABLED,
109            true => STOPPED_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 == STOPPED_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 == STOPPED_A::ENABLED
121    }
122}
123#[doc = "Field `STOPPED` writer - Enable or disable interrupt for event STOPPED"]
124pub type STOPPED_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, STOPPED_A, O>;
125impl<'a, const O: u8> STOPPED_W<'a, O> {
126    #[doc = "Disable"]
127    #[inline(always)]
128    pub fn disabled(self) -> &'a mut W {
129        self.variant(STOPPED_A::DISABLED)
130    }
131    #[doc = "Enable"]
132    #[inline(always)]
133    pub fn enabled(self) -> &'a mut W {
134        self.variant(STOPPED_A::ENABLED)
135    }
136}
137#[doc = "Field `TXPTRUPD` reader - Enable or disable interrupt for event TXPTRUPD"]
138pub type TXPTRUPD_R = crate::BitReader<TXPTRUPD_A>;
139#[doc = "Enable or disable interrupt for event TXPTRUPD\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141pub enum TXPTRUPD_A {
142    #[doc = "0: Disable"]
143    DISABLED = 0,
144    #[doc = "1: Enable"]
145    ENABLED = 1,
146}
147impl From<TXPTRUPD_A> for bool {
148    #[inline(always)]
149    fn from(variant: TXPTRUPD_A) -> Self {
150        variant as u8 != 0
151    }
152}
153impl TXPTRUPD_R {
154    #[doc = "Get enumerated values variant"]
155    #[inline(always)]
156    pub fn variant(&self) -> TXPTRUPD_A {
157        match self.bits {
158            false => TXPTRUPD_A::DISABLED,
159            true => TXPTRUPD_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 == TXPTRUPD_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 == TXPTRUPD_A::ENABLED
171    }
172}
173#[doc = "Field `TXPTRUPD` writer - Enable or disable interrupt for event TXPTRUPD"]
174pub type TXPTRUPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, TXPTRUPD_A, O>;
175impl<'a, const O: u8> TXPTRUPD_W<'a, O> {
176    #[doc = "Disable"]
177    #[inline(always)]
178    pub fn disabled(self) -> &'a mut W {
179        self.variant(TXPTRUPD_A::DISABLED)
180    }
181    #[doc = "Enable"]
182    #[inline(always)]
183    pub fn enabled(self) -> &'a mut W {
184        self.variant(TXPTRUPD_A::ENABLED)
185    }
186}
187#[doc = "Field `FRAMESTART` reader - Enable or disable interrupt for event FRAMESTART"]
188pub type FRAMESTART_R = crate::BitReader<FRAMESTART_A>;
189#[doc = "Enable or disable interrupt for event FRAMESTART\n\nValue on reset: 0"]
190#[derive(Clone, Copy, Debug, PartialEq)]
191pub enum FRAMESTART_A {
192    #[doc = "0: Disable"]
193    DISABLED = 0,
194    #[doc = "1: Enable"]
195    ENABLED = 1,
196}
197impl From<FRAMESTART_A> for bool {
198    #[inline(always)]
199    fn from(variant: FRAMESTART_A) -> Self {
200        variant as u8 != 0
201    }
202}
203impl FRAMESTART_R {
204    #[doc = "Get enumerated values variant"]
205    #[inline(always)]
206    pub fn variant(&self) -> FRAMESTART_A {
207        match self.bits {
208            false => FRAMESTART_A::DISABLED,
209            true => FRAMESTART_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 == FRAMESTART_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 == FRAMESTART_A::ENABLED
221    }
222}
223#[doc = "Field `FRAMESTART` writer - Enable or disable interrupt for event FRAMESTART"]
224pub type FRAMESTART_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, FRAMESTART_A, O>;
225impl<'a, const O: u8> FRAMESTART_W<'a, O> {
226    #[doc = "Disable"]
227    #[inline(always)]
228    pub fn disabled(self) -> &'a mut W {
229        self.variant(FRAMESTART_A::DISABLED)
230    }
231    #[doc = "Enable"]
232    #[inline(always)]
233    pub fn enabled(self) -> &'a mut W {
234        self.variant(FRAMESTART_A::ENABLED)
235    }
236}
237impl R {
238    #[doc = "Bit 1 - Enable or disable interrupt for event RXPTRUPD"]
239    #[inline(always)]
240    pub fn rxptrupd(&self) -> RXPTRUPD_R {
241        RXPTRUPD_R::new(((self.bits >> 1) & 1) != 0)
242    }
243    #[doc = "Bit 2 - Enable or disable interrupt for event STOPPED"]
244    #[inline(always)]
245    pub fn stopped(&self) -> STOPPED_R {
246        STOPPED_R::new(((self.bits >> 2) & 1) != 0)
247    }
248    #[doc = "Bit 5 - Enable or disable interrupt for event TXPTRUPD"]
249    #[inline(always)]
250    pub fn txptrupd(&self) -> TXPTRUPD_R {
251        TXPTRUPD_R::new(((self.bits >> 5) & 1) != 0)
252    }
253    #[doc = "Bit 7 - Enable or disable interrupt for event FRAMESTART"]
254    #[inline(always)]
255    pub fn framestart(&self) -> FRAMESTART_R {
256        FRAMESTART_R::new(((self.bits >> 7) & 1) != 0)
257    }
258}
259impl W {
260    #[doc = "Bit 1 - Enable or disable interrupt for event RXPTRUPD"]
261    #[inline(always)]
262    pub fn rxptrupd(&mut self) -> RXPTRUPD_W<1> {
263        RXPTRUPD_W::new(self)
264    }
265    #[doc = "Bit 2 - Enable or disable interrupt for event STOPPED"]
266    #[inline(always)]
267    pub fn stopped(&mut self) -> STOPPED_W<2> {
268        STOPPED_W::new(self)
269    }
270    #[doc = "Bit 5 - Enable or disable interrupt for event TXPTRUPD"]
271    #[inline(always)]
272    pub fn txptrupd(&mut self) -> TXPTRUPD_W<5> {
273        TXPTRUPD_W::new(self)
274    }
275    #[doc = "Bit 7 - Enable or disable interrupt for event FRAMESTART"]
276    #[inline(always)]
277    pub fn framestart(&mut self) -> FRAMESTART_W<7> {
278        FRAMESTART_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 or disable interrupt\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 [inten](index.html) module"]
288pub struct INTEN_SPEC;
289impl crate::RegisterSpec for INTEN_SPEC {
290    type Ux = u32;
291}
292#[doc = "`read()` method returns [inten::R](R) reader structure"]
293impl crate::Readable for INTEN_SPEC {
294    type Reader = R;
295}
296#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"]
297impl crate::Writable for INTEN_SPEC {
298    type Writer = W;
299}
300#[doc = "`reset()` method sets INTEN to value 0"]
301impl crate::Resettable for INTEN_SPEC {
302    #[inline(always)]
303    fn reset_value() -> Self::Ux {
304        0
305    }
306}