esp32s3/extmem/
dcache_lock_ctrl.rs

1#[doc = "Register `DCACHE_LOCK_CTRL` reader"]
2pub type R = crate::R<DCACHE_LOCK_CTRL_SPEC>;
3#[doc = "Register `DCACHE_LOCK_CTRL` writer"]
4pub type W = crate::W<DCACHE_LOCK_CTRL_SPEC>;
5#[doc = "Field `DCACHE_LOCK_ENA` reader - The bit is used to enable lock operation. It will be cleared by hardware after lock operation done."]
6pub type DCACHE_LOCK_ENA_R = crate::BitReader;
7#[doc = "Field `DCACHE_LOCK_ENA` writer - The bit is used to enable lock operation. It will be cleared by hardware after lock operation done."]
8pub type DCACHE_LOCK_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `DCACHE_UNLOCK_ENA` reader - The bit is used to enable unlock operation. It will be cleared by hardware after unlock operation done."]
10pub type DCACHE_UNLOCK_ENA_R = crate::BitReader;
11#[doc = "Field `DCACHE_UNLOCK_ENA` writer - The bit is used to enable unlock operation. It will be cleared by hardware after unlock operation done."]
12pub type DCACHE_UNLOCK_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `DCACHE_LOCK_DONE` reader - The bit is used to indicate unlock/lock operation is finished."]
14pub type DCACHE_LOCK_DONE_R = crate::BitReader;
15impl R {
16    #[doc = "Bit 0 - The bit is used to enable lock operation. It will be cleared by hardware after lock operation done."]
17    #[inline(always)]
18    pub fn dcache_lock_ena(&self) -> DCACHE_LOCK_ENA_R {
19        DCACHE_LOCK_ENA_R::new((self.bits & 1) != 0)
20    }
21    #[doc = "Bit 1 - The bit is used to enable unlock operation. It will be cleared by hardware after unlock operation done."]
22    #[inline(always)]
23    pub fn dcache_unlock_ena(&self) -> DCACHE_UNLOCK_ENA_R {
24        DCACHE_UNLOCK_ENA_R::new(((self.bits >> 1) & 1) != 0)
25    }
26    #[doc = "Bit 2 - The bit is used to indicate unlock/lock operation is finished."]
27    #[inline(always)]
28    pub fn dcache_lock_done(&self) -> DCACHE_LOCK_DONE_R {
29        DCACHE_LOCK_DONE_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("DCACHE_LOCK_CTRL")
36            .field("dcache_lock_ena", &self.dcache_lock_ena())
37            .field("dcache_unlock_ena", &self.dcache_unlock_ena())
38            .field("dcache_lock_done", &self.dcache_lock_done())
39            .finish()
40    }
41}
42impl W {
43    #[doc = "Bit 0 - The bit is used to enable lock operation. It will be cleared by hardware after lock operation done."]
44    #[inline(always)]
45    pub fn dcache_lock_ena(&mut self) -> DCACHE_LOCK_ENA_W<DCACHE_LOCK_CTRL_SPEC> {
46        DCACHE_LOCK_ENA_W::new(self, 0)
47    }
48    #[doc = "Bit 1 - The bit is used to enable unlock operation. It will be cleared by hardware after unlock operation done."]
49    #[inline(always)]
50    pub fn dcache_unlock_ena(&mut self) -> DCACHE_UNLOCK_ENA_W<DCACHE_LOCK_CTRL_SPEC> {
51        DCACHE_UNLOCK_ENA_W::new(self, 1)
52    }
53}
54#[doc = "******* Description ***********\n\nYou can [`read`](crate::Reg::read) this register and get [`dcache_lock_ctrl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dcache_lock_ctrl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct DCACHE_LOCK_CTRL_SPEC;
56impl crate::RegisterSpec for DCACHE_LOCK_CTRL_SPEC {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [`dcache_lock_ctrl::R`](R) reader structure"]
60impl crate::Readable for DCACHE_LOCK_CTRL_SPEC {}
61#[doc = "`write(|w| ..)` method takes [`dcache_lock_ctrl::W`](W) writer structure"]
62impl crate::Writable for DCACHE_LOCK_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 DCACHE_LOCK_CTRL to value 0x04"]
68impl crate::Resettable for DCACHE_LOCK_CTRL_SPEC {
69    const RESET_VALUE: u32 = 0x04;
70}