esp32s3/extmem/
icache_preload_ctrl.rs

1#[doc = "Register `ICACHE_PRELOAD_CTRL` reader"]
2pub type R = crate::R<ICACHE_PRELOAD_CTRL_SPEC>;
3#[doc = "Register `ICACHE_PRELOAD_CTRL` writer"]
4pub type W = crate::W<ICACHE_PRELOAD_CTRL_SPEC>;
5#[doc = "Field `ICACHE_PRELOAD_ENA` reader - The bit is used to enable preload operation. It will be cleared by hardware after preload operation done."]
6pub type ICACHE_PRELOAD_ENA_R = crate::BitReader;
7#[doc = "Field `ICACHE_PRELOAD_ENA` writer - The bit is used to enable preload operation. It will be cleared by hardware after preload operation done."]
8pub type ICACHE_PRELOAD_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ICACHE_PRELOAD_DONE` reader - The bit is used to indicate preload operation is finished."]
10pub type ICACHE_PRELOAD_DONE_R = crate::BitReader;
11#[doc = "Field `ICACHE_PRELOAD_ORDER` reader - The bit is used to configure the direction of preload operation. 1: descending, 0: ascending."]
12pub type ICACHE_PRELOAD_ORDER_R = crate::BitReader;
13#[doc = "Field `ICACHE_PRELOAD_ORDER` writer - The bit is used to configure the direction of preload operation. 1: descending, 0: ascending."]
14pub type ICACHE_PRELOAD_ORDER_W<'a, REG> = crate::BitWriter<'a, REG>;
15impl R {
16    #[doc = "Bit 0 - The bit is used to enable preload operation. It will be cleared by hardware after preload operation done."]
17    #[inline(always)]
18    pub fn icache_preload_ena(&self) -> ICACHE_PRELOAD_ENA_R {
19        ICACHE_PRELOAD_ENA_R::new((self.bits & 1) != 0)
20    }
21    #[doc = "Bit 1 - The bit is used to indicate preload operation is finished."]
22    #[inline(always)]
23    pub fn icache_preload_done(&self) -> ICACHE_PRELOAD_DONE_R {
24        ICACHE_PRELOAD_DONE_R::new(((self.bits >> 1) & 1) != 0)
25    }
26    #[doc = "Bit 2 - The bit is used to configure the direction of preload operation. 1: descending, 0: ascending."]
27    #[inline(always)]
28    pub fn icache_preload_order(&self) -> ICACHE_PRELOAD_ORDER_R {
29        ICACHE_PRELOAD_ORDER_R::new(((self.bits >> 2) & 1) != 0)
30    }
31}
32#[cfg(feature = "impl-register-debug")]
33impl core::fmt::Debug for R {
34    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
35        f.debug_struct("ICACHE_PRELOAD_CTRL")
36            .field("icache_preload_ena", &self.icache_preload_ena())
37            .field("icache_preload_done", &self.icache_preload_done())
38            .field("icache_preload_order", &self.icache_preload_order())
39            .finish()
40    }
41}
42impl W {
43    #[doc = "Bit 0 - The bit is used to enable preload operation. It will be cleared by hardware after preload operation done."]
44    #[inline(always)]
45    pub fn icache_preload_ena(&mut self) -> ICACHE_PRELOAD_ENA_W<ICACHE_PRELOAD_CTRL_SPEC> {
46        ICACHE_PRELOAD_ENA_W::new(self, 0)
47    }
48    #[doc = "Bit 2 - The bit is used to configure the direction of preload operation. 1: descending, 0: ascending."]
49    #[inline(always)]
50    pub fn icache_preload_order(&mut self) -> ICACHE_PRELOAD_ORDER_W<ICACHE_PRELOAD_CTRL_SPEC> {
51        ICACHE_PRELOAD_ORDER_W::new(self, 2)
52    }
53}
54#[doc = "******* Description ***********\n\nYou can [`read`](crate::Reg::read) this register and get [`icache_preload_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`icache_preload_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct ICACHE_PRELOAD_CTRL_SPEC;
56impl crate::RegisterSpec for ICACHE_PRELOAD_CTRL_SPEC {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [`icache_preload_ctrl::R`](R) reader structure"]
60impl crate::Readable for ICACHE_PRELOAD_CTRL_SPEC {}
61#[doc = "`write(|w| ..)` method takes [`icache_preload_ctrl::W`](W) writer structure"]
62impl crate::Writable for ICACHE_PRELOAD_CTRL_SPEC {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets ICACHE_PRELOAD_CTRL to value 0x02"]
68impl crate::Resettable for ICACHE_PRELOAD_CTRL_SPEC {
69    const RESET_VALUE: u32 = 0x02;
70}