esp32p4/cache/
l2_cache_preload_ctrl.rs1#[doc = "Register `L2_CACHE_PRELOAD_CTRL` reader"]
2pub type R = crate::R<L2_CACHE_PRELOAD_CTRL_SPEC>;
3#[doc = "Register `L2_CACHE_PRELOAD_CTRL` writer"]
4pub type W = crate::W<L2_CACHE_PRELOAD_CTRL_SPEC>;
5#[doc = "Field `L2_CACHE_PRELOAD_ENA` reader - The bit is used to enable preload operation on L2-Cache. It will be cleared by hardware automatically after preload operation is done."]
6pub type L2_CACHE_PRELOAD_ENA_R = crate::BitReader;
7#[doc = "Field `L2_CACHE_PRELOAD_ENA` writer - The bit is used to enable preload operation on L2-Cache. It will be cleared by hardware automatically after preload operation is done."]
8pub type L2_CACHE_PRELOAD_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `L2_CACHE_PRELOAD_DONE` reader - The bit is used to indicate whether preload operation is finished or not. 0: not finished. 1: finished."]
10pub type L2_CACHE_PRELOAD_DONE_R = crate::BitReader;
11#[doc = "Field `L2_CACHE_PRELOAD_ORDER` reader - The bit is used to configure the direction of preload operation. 0: ascending, 1: descending."]
12pub type L2_CACHE_PRELOAD_ORDER_R = crate::BitReader;
13#[doc = "Field `L2_CACHE_PRELOAD_ORDER` writer - The bit is used to configure the direction of preload operation. 0: ascending, 1: descending."]
14pub type L2_CACHE_PRELOAD_ORDER_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `L2_CACHE_PRELOAD_RGID` reader - The bit is used to set the gid of l2 cache preload."]
16pub type L2_CACHE_PRELOAD_RGID_R = crate::FieldReader;
17#[doc = "Field `L2_CACHE_PRELOAD_RGID` writer - The bit is used to set the gid of l2 cache preload."]
18pub type L2_CACHE_PRELOAD_RGID_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
19impl R {
20 #[doc = "Bit 0 - The bit is used to enable preload operation on L2-Cache. It will be cleared by hardware automatically after preload operation is done."]
21 #[inline(always)]
22 pub fn l2_cache_preload_ena(&self) -> L2_CACHE_PRELOAD_ENA_R {
23 L2_CACHE_PRELOAD_ENA_R::new((self.bits & 1) != 0)
24 }
25 #[doc = "Bit 1 - The bit is used to indicate whether preload operation is finished or not. 0: not finished. 1: finished."]
26 #[inline(always)]
27 pub fn l2_cache_preload_done(&self) -> L2_CACHE_PRELOAD_DONE_R {
28 L2_CACHE_PRELOAD_DONE_R::new(((self.bits >> 1) & 1) != 0)
29 }
30 #[doc = "Bit 2 - The bit is used to configure the direction of preload operation. 0: ascending, 1: descending."]
31 #[inline(always)]
32 pub fn l2_cache_preload_order(&self) -> L2_CACHE_PRELOAD_ORDER_R {
33 L2_CACHE_PRELOAD_ORDER_R::new(((self.bits >> 2) & 1) != 0)
34 }
35 #[doc = "Bits 3:6 - The bit is used to set the gid of l2 cache preload."]
36 #[inline(always)]
37 pub fn l2_cache_preload_rgid(&self) -> L2_CACHE_PRELOAD_RGID_R {
38 L2_CACHE_PRELOAD_RGID_R::new(((self.bits >> 3) & 0x0f) as u8)
39 }
40}
41#[cfg(feature = "impl-register-debug")]
42impl core::fmt::Debug for R {
43 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
44 f.debug_struct("L2_CACHE_PRELOAD_CTRL")
45 .field(
46 "l2_cache_preload_ena",
47 &format_args!("{}", self.l2_cache_preload_ena().bit()),
48 )
49 .field(
50 "l2_cache_preload_done",
51 &format_args!("{}", self.l2_cache_preload_done().bit()),
52 )
53 .field(
54 "l2_cache_preload_order",
55 &format_args!("{}", self.l2_cache_preload_order().bit()),
56 )
57 .field(
58 "l2_cache_preload_rgid",
59 &format_args!("{}", self.l2_cache_preload_rgid().bits()),
60 )
61 .finish()
62 }
63}
64#[cfg(feature = "impl-register-debug")]
65impl core::fmt::Debug for crate::generic::Reg<L2_CACHE_PRELOAD_CTRL_SPEC> {
66 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
67 core::fmt::Debug::fmt(&self.read(), f)
68 }
69}
70impl W {
71 #[doc = "Bit 0 - The bit is used to enable preload operation on L2-Cache. It will be cleared by hardware automatically after preload operation is done."]
72 #[inline(always)]
73 #[must_use]
74 pub fn l2_cache_preload_ena(&mut self) -> L2_CACHE_PRELOAD_ENA_W<L2_CACHE_PRELOAD_CTRL_SPEC> {
75 L2_CACHE_PRELOAD_ENA_W::new(self, 0)
76 }
77 #[doc = "Bit 2 - The bit is used to configure the direction of preload operation. 0: ascending, 1: descending."]
78 #[inline(always)]
79 #[must_use]
80 pub fn l2_cache_preload_order(
81 &mut self,
82 ) -> L2_CACHE_PRELOAD_ORDER_W<L2_CACHE_PRELOAD_CTRL_SPEC> {
83 L2_CACHE_PRELOAD_ORDER_W::new(self, 2)
84 }
85 #[doc = "Bits 3:6 - The bit is used to set the gid of l2 cache preload."]
86 #[inline(always)]
87 #[must_use]
88 pub fn l2_cache_preload_rgid(&mut self) -> L2_CACHE_PRELOAD_RGID_W<L2_CACHE_PRELOAD_CTRL_SPEC> {
89 L2_CACHE_PRELOAD_RGID_W::new(self, 3)
90 }
91}
92#[doc = "L2 Cache preload-operation control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`l2_cache_preload_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_cache_preload_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
93pub struct L2_CACHE_PRELOAD_CTRL_SPEC;
94impl crate::RegisterSpec for L2_CACHE_PRELOAD_CTRL_SPEC {
95 type Ux = u32;
96}
97#[doc = "`read()` method returns [`l2_cache_preload_ctrl::R`](R) reader structure"]
98impl crate::Readable for L2_CACHE_PRELOAD_CTRL_SPEC {}
99#[doc = "`write(|w| ..)` method takes [`l2_cache_preload_ctrl::W`](W) writer structure"]
100impl crate::Writable for L2_CACHE_PRELOAD_CTRL_SPEC {
101 type Safety = crate::Unsafe;
102 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
103 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
104}
105#[doc = "`reset()` method sets L2_CACHE_PRELOAD_CTRL to value 0x02"]
106impl crate::Resettable for L2_CACHE_PRELOAD_CTRL_SPEC {
107 const RESET_VALUE: u32 = 0x02;
108}