esp32p4/hp_sys/
l2_mem_ahb_buffer_ctrl.rs

1#[doc = "Register `L2_MEM_AHB_BUFFER_CTRL` reader"]
2pub type R = crate::R<L2_MEM_AHB_BUFFER_CTRL_SPEC>;
3#[doc = "Register `L2_MEM_AHB_BUFFER_CTRL` writer"]
4pub type W = crate::W<L2_MEM_AHB_BUFFER_CTRL_SPEC>;
5#[doc = "Field `L2_MEM_AHB_WRBUFFER_EN` reader - Set 1 to turn on l2mem ahb wr buffer"]
6pub type L2_MEM_AHB_WRBUFFER_EN_R = crate::BitReader;
7#[doc = "Field `L2_MEM_AHB_WRBUFFER_EN` writer - Set 1 to turn on l2mem ahb wr buffer"]
8pub type L2_MEM_AHB_WRBUFFER_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `L2_MEM_AHB_RDBUFFER_EN` reader - Set 1 to turn on l2mem ahb rd buffer"]
10pub type L2_MEM_AHB_RDBUFFER_EN_R = crate::BitReader;
11#[doc = "Field `L2_MEM_AHB_RDBUFFER_EN` writer - Set 1 to turn on l2mem ahb rd buffer"]
12pub type L2_MEM_AHB_RDBUFFER_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - Set 1 to turn on l2mem ahb wr buffer"]
15    #[inline(always)]
16    pub fn l2_mem_ahb_wrbuffer_en(&self) -> L2_MEM_AHB_WRBUFFER_EN_R {
17        L2_MEM_AHB_WRBUFFER_EN_R::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - Set 1 to turn on l2mem ahb rd buffer"]
20    #[inline(always)]
21    pub fn l2_mem_ahb_rdbuffer_en(&self) -> L2_MEM_AHB_RDBUFFER_EN_R {
22        L2_MEM_AHB_RDBUFFER_EN_R::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("L2_MEM_AHB_BUFFER_CTRL")
29            .field(
30                "l2_mem_ahb_wrbuffer_en",
31                &format_args!("{}", self.l2_mem_ahb_wrbuffer_en().bit()),
32            )
33            .field(
34                "l2_mem_ahb_rdbuffer_en",
35                &format_args!("{}", self.l2_mem_ahb_rdbuffer_en().bit()),
36            )
37            .finish()
38    }
39}
40#[cfg(feature = "impl-register-debug")]
41impl core::fmt::Debug for crate::generic::Reg<L2_MEM_AHB_BUFFER_CTRL_SPEC> {
42    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
43        core::fmt::Debug::fmt(&self.read(), f)
44    }
45}
46impl W {
47    #[doc = "Bit 0 - Set 1 to turn on l2mem ahb wr buffer"]
48    #[inline(always)]
49    #[must_use]
50    pub fn l2_mem_ahb_wrbuffer_en(
51        &mut self,
52    ) -> L2_MEM_AHB_WRBUFFER_EN_W<L2_MEM_AHB_BUFFER_CTRL_SPEC> {
53        L2_MEM_AHB_WRBUFFER_EN_W::new(self, 0)
54    }
55    #[doc = "Bit 1 - Set 1 to turn on l2mem ahb rd buffer"]
56    #[inline(always)]
57    #[must_use]
58    pub fn l2_mem_ahb_rdbuffer_en(
59        &mut self,
60    ) -> L2_MEM_AHB_RDBUFFER_EN_W<L2_MEM_AHB_BUFFER_CTRL_SPEC> {
61        L2_MEM_AHB_RDBUFFER_EN_W::new(self, 1)
62    }
63}
64#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`l2_mem_ahb_buffer_ctrl::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 [`l2_mem_ahb_buffer_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
65pub struct L2_MEM_AHB_BUFFER_CTRL_SPEC;
66impl crate::RegisterSpec for L2_MEM_AHB_BUFFER_CTRL_SPEC {
67    type Ux = u32;
68}
69#[doc = "`read()` method returns [`l2_mem_ahb_buffer_ctrl::R`](R) reader structure"]
70impl crate::Readable for L2_MEM_AHB_BUFFER_CTRL_SPEC {}
71#[doc = "`write(|w| ..)` method takes [`l2_mem_ahb_buffer_ctrl::W`](W) writer structure"]
72impl crate::Writable for L2_MEM_AHB_BUFFER_CTRL_SPEC {
73    type Safety = crate::Unsafe;
74    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
75    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
76}
77#[doc = "`reset()` method sets L2_MEM_AHB_BUFFER_CTRL to value 0"]
78impl crate::Resettable for L2_MEM_AHB_BUFFER_CTRL_SPEC {
79    const RESET_VALUE: u32 = 0;
80}