esp32c6_lp/lp_apm/region/
pms_attr.rs

1#[doc = "Register `PMS_ATTR` reader"]
2pub type R = crate::R<PMS_ATTR_SPEC>;
3#[doc = "Register `PMS_ATTR` writer"]
4pub type W = crate::W<PMS_ATTR_SPEC>;
5#[doc = "Field `R_PMS_X(0-2)` reader - Region execute authority in REE_MODE%s"]
6pub type R_PMS_X_R = crate::BitReader;
7#[doc = "Field `R_PMS_X(0-2)` writer - Region execute authority in REE_MODE%s"]
8pub type R_PMS_X_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `R_PMS_W(0-2)` reader - Region write authority in REE_MODE%s"]
10pub type R_PMS_W_R = crate::BitReader;
11#[doc = "Field `R_PMS_W(0-2)` writer - Region write authority in REE_MODE%s"]
12pub type R_PMS_W_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `R_PMS_R(0-2)` reader - Region read authority in REE_MODE%s"]
14pub type R_PMS_R_R = crate::BitReader;
15#[doc = "Field `R_PMS_R(0-2)` writer - Region read authority in REE_MODE%s"]
16pub type R_PMS_R_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Region execute authority in REE_MODE(0-2)"]
19    #[doc = ""]
20    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `R0_PMS_X` field.</div>"]
21    #[inline(always)]
22    pub fn r_pms_x(&self, n: u8) -> R_PMS_X_R {
23        #[allow(clippy::no_effect)]
24        [(); 3][n as usize];
25        R_PMS_X_R::new(((self.bits >> (n * 4)) & 1) != 0)
26    }
27    #[doc = "Iterator for array of:"]
28    #[doc = "Region execute authority in REE_MODE(0-2)"]
29    #[inline(always)]
30    pub fn r_pms_x_iter(&self) -> impl Iterator<Item = R_PMS_X_R> + '_ {
31        (0..3).map(move |n| R_PMS_X_R::new(((self.bits >> (n * 4)) & 1) != 0))
32    }
33    #[doc = "Bit 0 - Region execute authority in REE_MODE0"]
34    #[inline(always)]
35    pub fn r0_pms_x(&self) -> R_PMS_X_R {
36        R_PMS_X_R::new((self.bits & 1) != 0)
37    }
38    #[doc = "Bit 4 - Region execute authority in REE_MODE1"]
39    #[inline(always)]
40    pub fn r1_pms_x(&self) -> R_PMS_X_R {
41        R_PMS_X_R::new(((self.bits >> 4) & 1) != 0)
42    }
43    #[doc = "Bit 8 - Region execute authority in REE_MODE2"]
44    #[inline(always)]
45    pub fn r2_pms_x(&self) -> R_PMS_X_R {
46        R_PMS_X_R::new(((self.bits >> 8) & 1) != 0)
47    }
48    #[doc = "Region write authority in REE_MODE(0-2)"]
49    #[doc = ""]
50    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `R0_PMS_W` field.</div>"]
51    #[inline(always)]
52    pub fn r_pms_w(&self, n: u8) -> R_PMS_W_R {
53        #[allow(clippy::no_effect)]
54        [(); 3][n as usize];
55        R_PMS_W_R::new(((self.bits >> (n * 4 + 1)) & 1) != 0)
56    }
57    #[doc = "Iterator for array of:"]
58    #[doc = "Region write authority in REE_MODE(0-2)"]
59    #[inline(always)]
60    pub fn r_pms_w_iter(&self) -> impl Iterator<Item = R_PMS_W_R> + '_ {
61        (0..3).map(move |n| R_PMS_W_R::new(((self.bits >> (n * 4 + 1)) & 1) != 0))
62    }
63    #[doc = "Bit 1 - Region write authority in REE_MODE0"]
64    #[inline(always)]
65    pub fn r0_pms_w(&self) -> R_PMS_W_R {
66        R_PMS_W_R::new(((self.bits >> 1) & 1) != 0)
67    }
68    #[doc = "Bit 5 - Region write authority in REE_MODE1"]
69    #[inline(always)]
70    pub fn r1_pms_w(&self) -> R_PMS_W_R {
71        R_PMS_W_R::new(((self.bits >> 5) & 1) != 0)
72    }
73    #[doc = "Bit 9 - Region write authority in REE_MODE2"]
74    #[inline(always)]
75    pub fn r2_pms_w(&self) -> R_PMS_W_R {
76        R_PMS_W_R::new(((self.bits >> 9) & 1) != 0)
77    }
78    #[doc = "Region read authority in REE_MODE(0-2)"]
79    #[doc = ""]
80    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `R0_PMS_R` field.</div>"]
81    #[inline(always)]
82    pub fn r_pms_r(&self, n: u8) -> R_PMS_R_R {
83        #[allow(clippy::no_effect)]
84        [(); 3][n as usize];
85        R_PMS_R_R::new(((self.bits >> (n * 4 + 2)) & 1) != 0)
86    }
87    #[doc = "Iterator for array of:"]
88    #[doc = "Region read authority in REE_MODE(0-2)"]
89    #[inline(always)]
90    pub fn r_pms_r_iter(&self) -> impl Iterator<Item = R_PMS_R_R> + '_ {
91        (0..3).map(move |n| R_PMS_R_R::new(((self.bits >> (n * 4 + 2)) & 1) != 0))
92    }
93    #[doc = "Bit 2 - Region read authority in REE_MODE0"]
94    #[inline(always)]
95    pub fn r0_pms_r(&self) -> R_PMS_R_R {
96        R_PMS_R_R::new(((self.bits >> 2) & 1) != 0)
97    }
98    #[doc = "Bit 6 - Region read authority in REE_MODE1"]
99    #[inline(always)]
100    pub fn r1_pms_r(&self) -> R_PMS_R_R {
101        R_PMS_R_R::new(((self.bits >> 6) & 1) != 0)
102    }
103    #[doc = "Bit 10 - Region read authority in REE_MODE2"]
104    #[inline(always)]
105    pub fn r2_pms_r(&self) -> R_PMS_R_R {
106        R_PMS_R_R::new(((self.bits >> 10) & 1) != 0)
107    }
108}
109#[cfg(feature = "impl-register-debug")]
110impl core::fmt::Debug for R {
111    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
112        f.debug_struct("PMS_ATTR")
113            .field("r0_pms_x", &self.r0_pms_x())
114            .field("r1_pms_x", &self.r1_pms_x())
115            .field("r2_pms_x", &self.r2_pms_x())
116            .field("r0_pms_w", &self.r0_pms_w())
117            .field("r1_pms_w", &self.r1_pms_w())
118            .field("r2_pms_w", &self.r2_pms_w())
119            .field("r0_pms_r", &self.r0_pms_r())
120            .field("r1_pms_r", &self.r1_pms_r())
121            .field("r2_pms_r", &self.r2_pms_r())
122            .finish()
123    }
124}
125impl W {
126    #[doc = "Region execute authority in REE_MODE(0-2)"]
127    #[doc = ""]
128    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `R0_PMS_X` field.</div>"]
129    #[inline(always)]
130    #[must_use]
131    pub fn r_pms_x(&mut self, n: u8) -> R_PMS_X_W<PMS_ATTR_SPEC> {
132        #[allow(clippy::no_effect)]
133        [(); 3][n as usize];
134        R_PMS_X_W::new(self, n * 4)
135    }
136    #[doc = "Bit 0 - Region execute authority in REE_MODE0"]
137    #[inline(always)]
138    #[must_use]
139    pub fn r0_pms_x(&mut self) -> R_PMS_X_W<PMS_ATTR_SPEC> {
140        R_PMS_X_W::new(self, 0)
141    }
142    #[doc = "Bit 4 - Region execute authority in REE_MODE1"]
143    #[inline(always)]
144    #[must_use]
145    pub fn r1_pms_x(&mut self) -> R_PMS_X_W<PMS_ATTR_SPEC> {
146        R_PMS_X_W::new(self, 4)
147    }
148    #[doc = "Bit 8 - Region execute authority in REE_MODE2"]
149    #[inline(always)]
150    #[must_use]
151    pub fn r2_pms_x(&mut self) -> R_PMS_X_W<PMS_ATTR_SPEC> {
152        R_PMS_X_W::new(self, 8)
153    }
154    #[doc = "Region write authority in REE_MODE(0-2)"]
155    #[doc = ""]
156    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `R0_PMS_W` field.</div>"]
157    #[inline(always)]
158    #[must_use]
159    pub fn r_pms_w(&mut self, n: u8) -> R_PMS_W_W<PMS_ATTR_SPEC> {
160        #[allow(clippy::no_effect)]
161        [(); 3][n as usize];
162        R_PMS_W_W::new(self, n * 4 + 1)
163    }
164    #[doc = "Bit 1 - Region write authority in REE_MODE0"]
165    #[inline(always)]
166    #[must_use]
167    pub fn r0_pms_w(&mut self) -> R_PMS_W_W<PMS_ATTR_SPEC> {
168        R_PMS_W_W::new(self, 1)
169    }
170    #[doc = "Bit 5 - Region write authority in REE_MODE1"]
171    #[inline(always)]
172    #[must_use]
173    pub fn r1_pms_w(&mut self) -> R_PMS_W_W<PMS_ATTR_SPEC> {
174        R_PMS_W_W::new(self, 5)
175    }
176    #[doc = "Bit 9 - Region write authority in REE_MODE2"]
177    #[inline(always)]
178    #[must_use]
179    pub fn r2_pms_w(&mut self) -> R_PMS_W_W<PMS_ATTR_SPEC> {
180        R_PMS_W_W::new(self, 9)
181    }
182    #[doc = "Region read authority in REE_MODE(0-2)"]
183    #[doc = ""]
184    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `R0_PMS_R` field.</div>"]
185    #[inline(always)]
186    #[must_use]
187    pub fn r_pms_r(&mut self, n: u8) -> R_PMS_R_W<PMS_ATTR_SPEC> {
188        #[allow(clippy::no_effect)]
189        [(); 3][n as usize];
190        R_PMS_R_W::new(self, n * 4 + 2)
191    }
192    #[doc = "Bit 2 - Region read authority in REE_MODE0"]
193    #[inline(always)]
194    #[must_use]
195    pub fn r0_pms_r(&mut self) -> R_PMS_R_W<PMS_ATTR_SPEC> {
196        R_PMS_R_W::new(self, 2)
197    }
198    #[doc = "Bit 6 - Region read authority in REE_MODE1"]
199    #[inline(always)]
200    #[must_use]
201    pub fn r1_pms_r(&mut self) -> R_PMS_R_W<PMS_ATTR_SPEC> {
202        R_PMS_R_W::new(self, 6)
203    }
204    #[doc = "Bit 10 - Region read authority in REE_MODE2"]
205    #[inline(always)]
206    #[must_use]
207    pub fn r2_pms_r(&mut self) -> R_PMS_R_W<PMS_ATTR_SPEC> {
208        R_PMS_R_W::new(self, 10)
209    }
210}
211#[doc = "Region access authority attribute register\n\nYou can [`read`](crate::Reg::read) this register and get [`pms_attr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pms_attr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
212pub struct PMS_ATTR_SPEC;
213impl crate::RegisterSpec for PMS_ATTR_SPEC {
214    type Ux = u32;
215}
216#[doc = "`read()` method returns [`pms_attr::R`](R) reader structure"]
217impl crate::Readable for PMS_ATTR_SPEC {}
218#[doc = "`write(|w| ..)` method takes [`pms_attr::W`](W) writer structure"]
219impl crate::Writable for PMS_ATTR_SPEC {
220    type Safety = crate::Unsafe;
221    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
222    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
223}
224#[doc = "`reset()` method sets PMS_ATTR to value 0"]
225impl crate::Resettable for PMS_ATTR_SPEC {
226    const RESET_VALUE: u32 = 0;
227}