1#[doc = "Register `INT_ENA` reader"]
2pub type R = crate::R<INT_ENA_SPEC>;
3#[doc = "Register `INT_ENA` writer"]
4pub type W = crate::W<INT_ENA_SPEC>;
5#[doc = "Field `RX_DONE` reader - The interrupt enable bit for the i2s_rx_done_int interrupt"]
6pub type RX_DONE_R = crate::BitReader;
7#[doc = "Field `RX_DONE` writer - The interrupt enable bit for the i2s_rx_done_int interrupt"]
8pub type RX_DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `TX_DONE` reader - The interrupt enable bit for the i2s_tx_done_int interrupt"]
10pub type TX_DONE_R = crate::BitReader;
11#[doc = "Field `TX_DONE` writer - The interrupt enable bit for the i2s_tx_done_int interrupt"]
12pub type TX_DONE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `RX_HUNG` reader - The interrupt enable bit for the i2s_rx_hung_int interrupt"]
14pub type RX_HUNG_R = crate::BitReader;
15#[doc = "Field `RX_HUNG` writer - The interrupt enable bit for the i2s_rx_hung_int interrupt"]
16pub type RX_HUNG_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `TX_HUNG` reader - The interrupt enable bit for the i2s_tx_hung_int interrupt"]
18pub type TX_HUNG_R = crate::BitReader;
19#[doc = "Field `TX_HUNG` writer - The interrupt enable bit for the i2s_tx_hung_int interrupt"]
20pub type TX_HUNG_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22 #[doc = "Bit 0 - The interrupt enable bit for the i2s_rx_done_int interrupt"]
23 #[inline(always)]
24 pub fn rx_done(&self) -> RX_DONE_R {
25 RX_DONE_R::new((self.bits & 1) != 0)
26 }
27 #[doc = "Bit 1 - The interrupt enable bit for the i2s_tx_done_int interrupt"]
28 #[inline(always)]
29 pub fn tx_done(&self) -> TX_DONE_R {
30 TX_DONE_R::new(((self.bits >> 1) & 1) != 0)
31 }
32 #[doc = "Bit 2 - The interrupt enable bit for the i2s_rx_hung_int interrupt"]
33 #[inline(always)]
34 pub fn rx_hung(&self) -> RX_HUNG_R {
35 RX_HUNG_R::new(((self.bits >> 2) & 1) != 0)
36 }
37 #[doc = "Bit 3 - The interrupt enable bit for the i2s_tx_hung_int interrupt"]
38 #[inline(always)]
39 pub fn tx_hung(&self) -> TX_HUNG_R {
40 TX_HUNG_R::new(((self.bits >> 3) & 1) != 0)
41 }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46 f.debug_struct("INT_ENA")
47 .field("rx_done", &format_args!("{}", self.rx_done().bit()))
48 .field("tx_done", &format_args!("{}", self.tx_done().bit()))
49 .field("rx_hung", &format_args!("{}", self.rx_hung().bit()))
50 .field("tx_hung", &format_args!("{}", self.tx_hung().bit()))
51 .finish()
52 }
53}
54#[cfg(feature = "impl-register-debug")]
55impl core::fmt::Debug for crate::generic::Reg<INT_ENA_SPEC> {
56 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
57 core::fmt::Debug::fmt(&self.read(), f)
58 }
59}
60impl W {
61 #[doc = "Bit 0 - The interrupt enable bit for the i2s_rx_done_int interrupt"]
62 #[inline(always)]
63 #[must_use]
64 pub fn rx_done(&mut self) -> RX_DONE_W<INT_ENA_SPEC> {
65 RX_DONE_W::new(self, 0)
66 }
67 #[doc = "Bit 1 - The interrupt enable bit for the i2s_tx_done_int interrupt"]
68 #[inline(always)]
69 #[must_use]
70 pub fn tx_done(&mut self) -> TX_DONE_W<INT_ENA_SPEC> {
71 TX_DONE_W::new(self, 1)
72 }
73 #[doc = "Bit 2 - The interrupt enable bit for the i2s_rx_hung_int interrupt"]
74 #[inline(always)]
75 #[must_use]
76 pub fn rx_hung(&mut self) -> RX_HUNG_W<INT_ENA_SPEC> {
77 RX_HUNG_W::new(self, 2)
78 }
79 #[doc = "Bit 3 - The interrupt enable bit for the i2s_tx_hung_int interrupt"]
80 #[inline(always)]
81 #[must_use]
82 pub fn tx_hung(&mut self) -> TX_HUNG_W<INT_ENA_SPEC> {
83 TX_HUNG_W::new(self, 3)
84 }
85}
86#[doc = "I2S interrupt enable register.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`int_ena::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`int_ena::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
87pub struct INT_ENA_SPEC;
88impl crate::RegisterSpec for INT_ENA_SPEC {
89 type Ux = u32;
90}
91#[doc = "`read()` method returns [`int_ena::R`](R) reader structure"]
92impl crate::Readable for INT_ENA_SPEC {}
93#[doc = "`write(|w| ..)` method takes [`int_ena::W`](W) writer structure"]
94impl crate::Writable for INT_ENA_SPEC {
95 type Safety = crate::Unsafe;
96 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
97 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
98}
99#[doc = "`reset()` method sets INT_ENA to value 0"]
100impl crate::Resettable for INT_ENA_SPEC {
101 const RESET_VALUE: u32 = 0;
102}