1#[doc = "Register `MPUCR` reader"]
2pub struct R(crate::R<MPUCR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<MPUCR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<MPUCR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<MPUCR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `MPUCR` writer"]
17pub struct W(crate::W<MPUCR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<MPUCR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<MPUCR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<MPUCR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `RCS1_0` reader - RCS1_0 field"]
38pub type RCS1_0_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `RCS1_0` writer - RCS1_0 field"]
40pub type RCS1_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPUCR_SPEC, u8, u8, 5, O>;
41#[doc = "Field `RDHOLD` reader - RDHOLD field"]
42pub type RDHOLD_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `RDHOLD` writer - RDHOLD field"]
44pub type RDHOLD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPUCR_SPEC, u8, u8, 5, O>;
45#[doc = "Field `WCS1_0` reader - WCS1_0 field"]
46pub type WCS1_0_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `WCS1_0` writer - WCS1_0 field"]
48pub type WCS1_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPUCR_SPEC, u8, u8, 4, O>;
49#[doc = "Field `WR1CS1` reader - WR1CS1 field"]
50pub type WR1CS1_R = crate::FieldReader<u8, u8>;
51#[doc = "Field `WR1CS1` writer - WR1CS1 field"]
52pub type WR1CS1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPUCR_SPEC, u8, u8, 2, O>;
53#[doc = "Field `WRHOLD` reader - WRHOLD field"]
54pub type WRHOLD_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `WRHOLD` writer - WRHOLD field"]
56pub type WRHOLD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPUCR_SPEC, u8, u8, 4, O>;
57#[doc = "Field `CS0WR0` reader - CS0WR0 field"]
58pub type CS0WR0_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `CS0WR0` writer - CS0WR0 field"]
60pub type CS0WR0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPUCR_SPEC, u8, u8, 2, O>;
61impl R {
62 #[doc = "Bits 0:4 - RCS1_0 field"]
63 #[inline(always)]
64 pub fn rcs1_0(&self) -> RCS1_0_R {
65 RCS1_0_R::new((self.bits & 0x1f) as u8)
66 }
67 #[doc = "Bits 5:9 - RDHOLD field"]
68 #[inline(always)]
69 pub fn rdhold(&self) -> RDHOLD_R {
70 RDHOLD_R::new(((self.bits >> 5) & 0x1f) as u8)
71 }
72 #[doc = "Bits 10:13 - WCS1_0 field"]
73 #[inline(always)]
74 pub fn wcs1_0(&self) -> WCS1_0_R {
75 WCS1_0_R::new(((self.bits >> 10) & 0x0f) as u8)
76 }
77 #[doc = "Bits 14:15 - WR1CS1 field"]
78 #[inline(always)]
79 pub fn wr1cs1(&self) -> WR1CS1_R {
80 WR1CS1_R::new(((self.bits >> 14) & 3) as u8)
81 }
82 #[doc = "Bits 16:19 - WRHOLD field"]
83 #[inline(always)]
84 pub fn wrhold(&self) -> WRHOLD_R {
85 WRHOLD_R::new(((self.bits >> 16) & 0x0f) as u8)
86 }
87 #[doc = "Bits 20:21 - CS0WR0 field"]
88 #[inline(always)]
89 pub fn cs0wr0(&self) -> CS0WR0_R {
90 CS0WR0_R::new(((self.bits >> 20) & 3) as u8)
91 }
92}
93impl W {
94 #[doc = "Bits 0:4 - RCS1_0 field"]
95 #[inline(always)]
96 pub fn rcs1_0(&mut self) -> RCS1_0_W<0> {
97 RCS1_0_W::new(self)
98 }
99 #[doc = "Bits 5:9 - RDHOLD field"]
100 #[inline(always)]
101 pub fn rdhold(&mut self) -> RDHOLD_W<5> {
102 RDHOLD_W::new(self)
103 }
104 #[doc = "Bits 10:13 - WCS1_0 field"]
105 #[inline(always)]
106 pub fn wcs1_0(&mut self) -> WCS1_0_W<10> {
107 WCS1_0_W::new(self)
108 }
109 #[doc = "Bits 14:15 - WR1CS1 field"]
110 #[inline(always)]
111 pub fn wr1cs1(&mut self) -> WR1CS1_W<14> {
112 WR1CS1_W::new(self)
113 }
114 #[doc = "Bits 16:19 - WRHOLD field"]
115 #[inline(always)]
116 pub fn wrhold(&mut self) -> WRHOLD_W<16> {
117 WRHOLD_W::new(self)
118 }
119 #[doc = "Bits 20:21 - CS0WR0 field"]
120 #[inline(always)]
121 pub fn cs0wr0(&mut self) -> CS0WR0_W<20> {
122 CS0WR0_W::new(self)
123 }
124 #[doc = "Writes raw bits to the register."]
125 #[inline(always)]
126 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
127 self.0.bits(bits);
128 self
129 }
130}
131#[doc = "MPUCR register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mpucr](index.html) module"]
132pub struct MPUCR_SPEC;
133impl crate::RegisterSpec for MPUCR_SPEC {
134 type Ux = u32;
135}
136#[doc = "`read()` method returns [mpucr::R](R) reader structure"]
137impl crate::Readable for MPUCR_SPEC {
138 type Reader = R;
139}
140#[doc = "`write(|w| ..)` method takes [mpucr::W](W) writer structure"]
141impl crate::Writable for MPUCR_SPEC {
142 type Writer = W;
143}
144#[doc = "`reset()` method sets MPUCR to value 0"]
145impl crate::Resettable for MPUCR_SPEC {
146 #[inline(always)]
147 fn reset_value() -> Self::Ux {
148 0
149 }
150}