esp32s3/spi1/
int_ena.rs

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 `PER_END` reader - The enable bit for SPI_MEM_PER_END_INT interrupt."]
6pub type PER_END_R = crate::BitReader;
7#[doc = "Field `PER_END` writer - The enable bit for SPI_MEM_PER_END_INT interrupt."]
8pub type PER_END_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `PES_END` reader - The enable bit for SPI_MEM_PES_END_INT interrupt."]
10pub type PES_END_R = crate::BitReader;
11#[doc = "Field `PES_END` writer - The enable bit for SPI_MEM_PES_END_INT interrupt."]
12pub type PES_END_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `TOTAL_TRANS_END` reader - The enable bit for SPI_MEM_TOTAL_TRANS_END_INT interrupt."]
14pub type TOTAL_TRANS_END_R = crate::BitReader;
15#[doc = "Field `TOTAL_TRANS_END` writer - The enable bit for SPI_MEM_TOTAL_TRANS_END_INT interrupt."]
16pub type TOTAL_TRANS_END_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `BROWN_OUT` reader - The enable bit for SPI_MEM_BROWN_OUT_INT interrupt."]
18pub type BROWN_OUT_R = crate::BitReader;
19#[doc = "Field `BROWN_OUT` writer - The enable bit for SPI_MEM_BROWN_OUT_INT interrupt."]
20pub type BROWN_OUT_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - The enable bit for SPI_MEM_PER_END_INT interrupt."]
23    #[inline(always)]
24    pub fn per_end(&self) -> PER_END_R {
25        PER_END_R::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - The enable bit for SPI_MEM_PES_END_INT interrupt."]
28    #[inline(always)]
29    pub fn pes_end(&self) -> PES_END_R {
30        PES_END_R::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2 - The enable bit for SPI_MEM_TOTAL_TRANS_END_INT interrupt."]
33    #[inline(always)]
34    pub fn total_trans_end(&self) -> TOTAL_TRANS_END_R {
35        TOTAL_TRANS_END_R::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 3 - The enable bit for SPI_MEM_BROWN_OUT_INT interrupt."]
38    #[inline(always)]
39    pub fn brown_out(&self) -> BROWN_OUT_R {
40        BROWN_OUT_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("per_end", &self.per_end())
48            .field("pes_end", &self.pes_end())
49            .field("total_trans_end", &self.total_trans_end())
50            .field("brown_out", &self.brown_out())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bit 0 - The enable bit for SPI_MEM_PER_END_INT interrupt."]
56    #[inline(always)]
57    pub fn per_end(&mut self) -> PER_END_W<INT_ENA_SPEC> {
58        PER_END_W::new(self, 0)
59    }
60    #[doc = "Bit 1 - The enable bit for SPI_MEM_PES_END_INT interrupt."]
61    #[inline(always)]
62    pub fn pes_end(&mut self) -> PES_END_W<INT_ENA_SPEC> {
63        PES_END_W::new(self, 1)
64    }
65    #[doc = "Bit 2 - The enable bit for SPI_MEM_TOTAL_TRANS_END_INT interrupt."]
66    #[inline(always)]
67    pub fn total_trans_end(&mut self) -> TOTAL_TRANS_END_W<INT_ENA_SPEC> {
68        TOTAL_TRANS_END_W::new(self, 2)
69    }
70    #[doc = "Bit 3 - The enable bit for SPI_MEM_BROWN_OUT_INT interrupt."]
71    #[inline(always)]
72    pub fn brown_out(&mut self) -> BROWN_OUT_W<INT_ENA_SPEC> {
73        BROWN_OUT_W::new(self, 3)
74    }
75}
76#[doc = "SPI1 interrupt enable register\n\nYou can [`read`](crate::Reg::read) this register and get [`int_ena::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`int_ena::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct INT_ENA_SPEC;
78impl crate::RegisterSpec for INT_ENA_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`int_ena::R`](R) reader structure"]
82impl crate::Readable for INT_ENA_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`int_ena::W`](W) writer structure"]
84impl crate::Writable for INT_ENA_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets INT_ENA to value 0"]
90impl crate::Resettable for INT_ENA_SPEC {
91    const RESET_VALUE: u32 = 0;
92}