nrf5340_app_pac/i2s0_ns/
intenset.rs

1#[doc = "Register `INTENSET` reader"]
2pub struct R(crate::R<INTENSET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<INTENSET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<INTENSET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<INTENSET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `INTENSET` writer"]
17pub struct W(crate::W<INTENSET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<INTENSET_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<INTENSET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<INTENSET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `RXPTRUPD` reader - Write '1' to enable interrupt for event RXPTRUPD"]
38pub type RXPTRUPD_R = crate::BitReader<RXPTRUPD_A>;
39#[doc = "Write '1' to enable interrupt for event RXPTRUPD\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41pub enum RXPTRUPD_A {
42    #[doc = "0: Read: Disabled"]
43    DISABLED = 0,
44    #[doc = "1: Read: Enabled"]
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 = "Write '1' to enable interrupt for event RXPTRUPD\n\nValue on reset: 0"]
74#[derive(Clone, Copy, Debug, PartialEq)]
75pub enum RXPTRUPD_AW {
76    #[doc = "1: Enable"]
77    SET = 1,
78}
79impl From<RXPTRUPD_AW> for bool {
80    #[inline(always)]
81    fn from(variant: RXPTRUPD_AW) -> Self {
82        variant as u8 != 0
83    }
84}
85#[doc = "Field `RXPTRUPD` writer - Write '1' to enable interrupt for event RXPTRUPD"]
86pub type RXPTRUPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, RXPTRUPD_AW, O>;
87impl<'a, const O: u8> RXPTRUPD_W<'a, O> {
88    #[doc = "Enable"]
89    #[inline(always)]
90    pub fn set(self) -> &'a mut W {
91        self.variant(RXPTRUPD_AW::SET)
92    }
93}
94#[doc = "Field `STOPPED` reader - Write '1' to enable interrupt for event STOPPED"]
95pub type STOPPED_R = crate::BitReader<STOPPED_A>;
96#[doc = "Write '1' to enable interrupt for event STOPPED\n\nValue on reset: 0"]
97#[derive(Clone, Copy, Debug, PartialEq)]
98pub enum STOPPED_A {
99    #[doc = "0: Read: Disabled"]
100    DISABLED = 0,
101    #[doc = "1: Read: Enabled"]
102    ENABLED = 1,
103}
104impl From<STOPPED_A> for bool {
105    #[inline(always)]
106    fn from(variant: STOPPED_A) -> Self {
107        variant as u8 != 0
108    }
109}
110impl STOPPED_R {
111    #[doc = "Get enumerated values variant"]
112    #[inline(always)]
113    pub fn variant(&self) -> STOPPED_A {
114        match self.bits {
115            false => STOPPED_A::DISABLED,
116            true => STOPPED_A::ENABLED,
117        }
118    }
119    #[doc = "Checks if the value of the field is `DISABLED`"]
120    #[inline(always)]
121    pub fn is_disabled(&self) -> bool {
122        *self == STOPPED_A::DISABLED
123    }
124    #[doc = "Checks if the value of the field is `ENABLED`"]
125    #[inline(always)]
126    pub fn is_enabled(&self) -> bool {
127        *self == STOPPED_A::ENABLED
128    }
129}
130#[doc = "Write '1' to enable interrupt for event STOPPED\n\nValue on reset: 0"]
131#[derive(Clone, Copy, Debug, PartialEq)]
132pub enum STOPPED_AW {
133    #[doc = "1: Enable"]
134    SET = 1,
135}
136impl From<STOPPED_AW> for bool {
137    #[inline(always)]
138    fn from(variant: STOPPED_AW) -> Self {
139        variant as u8 != 0
140    }
141}
142#[doc = "Field `STOPPED` writer - Write '1' to enable interrupt for event STOPPED"]
143pub type STOPPED_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, STOPPED_AW, O>;
144impl<'a, const O: u8> STOPPED_W<'a, O> {
145    #[doc = "Enable"]
146    #[inline(always)]
147    pub fn set(self) -> &'a mut W {
148        self.variant(STOPPED_AW::SET)
149    }
150}
151#[doc = "Field `TXPTRUPD` reader - Write '1' to enable interrupt for event TXPTRUPD"]
152pub type TXPTRUPD_R = crate::BitReader<TXPTRUPD_A>;
153#[doc = "Write '1' to enable interrupt for event TXPTRUPD\n\nValue on reset: 0"]
154#[derive(Clone, Copy, Debug, PartialEq)]
155pub enum TXPTRUPD_A {
156    #[doc = "0: Read: Disabled"]
157    DISABLED = 0,
158    #[doc = "1: Read: Enabled"]
159    ENABLED = 1,
160}
161impl From<TXPTRUPD_A> for bool {
162    #[inline(always)]
163    fn from(variant: TXPTRUPD_A) -> Self {
164        variant as u8 != 0
165    }
166}
167impl TXPTRUPD_R {
168    #[doc = "Get enumerated values variant"]
169    #[inline(always)]
170    pub fn variant(&self) -> TXPTRUPD_A {
171        match self.bits {
172            false => TXPTRUPD_A::DISABLED,
173            true => TXPTRUPD_A::ENABLED,
174        }
175    }
176    #[doc = "Checks if the value of the field is `DISABLED`"]
177    #[inline(always)]
178    pub fn is_disabled(&self) -> bool {
179        *self == TXPTRUPD_A::DISABLED
180    }
181    #[doc = "Checks if the value of the field is `ENABLED`"]
182    #[inline(always)]
183    pub fn is_enabled(&self) -> bool {
184        *self == TXPTRUPD_A::ENABLED
185    }
186}
187#[doc = "Write '1' to enable interrupt for event TXPTRUPD\n\nValue on reset: 0"]
188#[derive(Clone, Copy, Debug, PartialEq)]
189pub enum TXPTRUPD_AW {
190    #[doc = "1: Enable"]
191    SET = 1,
192}
193impl From<TXPTRUPD_AW> for bool {
194    #[inline(always)]
195    fn from(variant: TXPTRUPD_AW) -> Self {
196        variant as u8 != 0
197    }
198}
199#[doc = "Field `TXPTRUPD` writer - Write '1' to enable interrupt for event TXPTRUPD"]
200pub type TXPTRUPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, TXPTRUPD_AW, O>;
201impl<'a, const O: u8> TXPTRUPD_W<'a, O> {
202    #[doc = "Enable"]
203    #[inline(always)]
204    pub fn set(self) -> &'a mut W {
205        self.variant(TXPTRUPD_AW::SET)
206    }
207}
208#[doc = "Field `FRAMESTART` reader - Write '1' to enable interrupt for event FRAMESTART"]
209pub type FRAMESTART_R = crate::BitReader<FRAMESTART_A>;
210#[doc = "Write '1' to enable interrupt for event FRAMESTART\n\nValue on reset: 0"]
211#[derive(Clone, Copy, Debug, PartialEq)]
212pub enum FRAMESTART_A {
213    #[doc = "0: Read: Disabled"]
214    DISABLED = 0,
215    #[doc = "1: Read: Enabled"]
216    ENABLED = 1,
217}
218impl From<FRAMESTART_A> for bool {
219    #[inline(always)]
220    fn from(variant: FRAMESTART_A) -> Self {
221        variant as u8 != 0
222    }
223}
224impl FRAMESTART_R {
225    #[doc = "Get enumerated values variant"]
226    #[inline(always)]
227    pub fn variant(&self) -> FRAMESTART_A {
228        match self.bits {
229            false => FRAMESTART_A::DISABLED,
230            true => FRAMESTART_A::ENABLED,
231        }
232    }
233    #[doc = "Checks if the value of the field is `DISABLED`"]
234    #[inline(always)]
235    pub fn is_disabled(&self) -> bool {
236        *self == FRAMESTART_A::DISABLED
237    }
238    #[doc = "Checks if the value of the field is `ENABLED`"]
239    #[inline(always)]
240    pub fn is_enabled(&self) -> bool {
241        *self == FRAMESTART_A::ENABLED
242    }
243}
244#[doc = "Write '1' to enable interrupt for event FRAMESTART\n\nValue on reset: 0"]
245#[derive(Clone, Copy, Debug, PartialEq)]
246pub enum FRAMESTART_AW {
247    #[doc = "1: Enable"]
248    SET = 1,
249}
250impl From<FRAMESTART_AW> for bool {
251    #[inline(always)]
252    fn from(variant: FRAMESTART_AW) -> Self {
253        variant as u8 != 0
254    }
255}
256#[doc = "Field `FRAMESTART` writer - Write '1' to enable interrupt for event FRAMESTART"]
257pub type FRAMESTART_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, FRAMESTART_AW, O>;
258impl<'a, const O: u8> FRAMESTART_W<'a, O> {
259    #[doc = "Enable"]
260    #[inline(always)]
261    pub fn set(self) -> &'a mut W {
262        self.variant(FRAMESTART_AW::SET)
263    }
264}
265impl R {
266    #[doc = "Bit 1 - Write '1' to enable interrupt for event RXPTRUPD"]
267    #[inline(always)]
268    pub fn rxptrupd(&self) -> RXPTRUPD_R {
269        RXPTRUPD_R::new(((self.bits >> 1) & 1) != 0)
270    }
271    #[doc = "Bit 2 - Write '1' to enable interrupt for event STOPPED"]
272    #[inline(always)]
273    pub fn stopped(&self) -> STOPPED_R {
274        STOPPED_R::new(((self.bits >> 2) & 1) != 0)
275    }
276    #[doc = "Bit 5 - Write '1' to enable interrupt for event TXPTRUPD"]
277    #[inline(always)]
278    pub fn txptrupd(&self) -> TXPTRUPD_R {
279        TXPTRUPD_R::new(((self.bits >> 5) & 1) != 0)
280    }
281    #[doc = "Bit 7 - Write '1' to enable interrupt for event FRAMESTART"]
282    #[inline(always)]
283    pub fn framestart(&self) -> FRAMESTART_R {
284        FRAMESTART_R::new(((self.bits >> 7) & 1) != 0)
285    }
286}
287impl W {
288    #[doc = "Bit 1 - Write '1' to enable interrupt for event RXPTRUPD"]
289    #[inline(always)]
290    pub fn rxptrupd(&mut self) -> RXPTRUPD_W<1> {
291        RXPTRUPD_W::new(self)
292    }
293    #[doc = "Bit 2 - Write '1' to enable interrupt for event STOPPED"]
294    #[inline(always)]
295    pub fn stopped(&mut self) -> STOPPED_W<2> {
296        STOPPED_W::new(self)
297    }
298    #[doc = "Bit 5 - Write '1' to enable interrupt for event TXPTRUPD"]
299    #[inline(always)]
300    pub fn txptrupd(&mut self) -> TXPTRUPD_W<5> {
301        TXPTRUPD_W::new(self)
302    }
303    #[doc = "Bit 7 - Write '1' to enable interrupt for event FRAMESTART"]
304    #[inline(always)]
305    pub fn framestart(&mut self) -> FRAMESTART_W<7> {
306        FRAMESTART_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 = "Enable 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 [intenset](index.html) module"]
316pub struct INTENSET_SPEC;
317impl crate::RegisterSpec for INTENSET_SPEC {
318    type Ux = u32;
319}
320#[doc = "`read()` method returns [intenset::R](R) reader structure"]
321impl crate::Readable for INTENSET_SPEC {
322    type Reader = R;
323}
324#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
325impl crate::Writable for INTENSET_SPEC {
326    type Writer = W;
327}
328#[doc = "`reset()` method sets INTENSET to value 0"]
329impl crate::Resettable for INTENSET_SPEC {
330    #[inline(always)]
331    fn reset_value() -> Self::Ux {
332        0
333    }
334}