1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"Memory Mirror Function"]
28unsafe impl ::core::marker::Send for super::Mmf {}
29unsafe impl ::core::marker::Sync for super::Mmf {}
30impl super::Mmf {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36
37 #[doc = "MemMirror Special Function Register"]
38 #[inline(always)]
39 pub const fn mmsfr(&self) -> &'static crate::common::Reg<self::Mmsfr_SPEC, crate::common::RW> {
40 unsafe {
41 crate::common::Reg::<self::Mmsfr_SPEC, crate::common::RW>::from_ptr(
42 self._svd2pac_as_ptr().add(0usize),
43 )
44 }
45 }
46
47 #[doc = "MemMirror Enable Register"]
48 #[inline(always)]
49 pub const fn mmen(&self) -> &'static crate::common::Reg<self::Mmen_SPEC, crate::common::RW> {
50 unsafe {
51 crate::common::Reg::<self::Mmen_SPEC, crate::common::RW>::from_ptr(
52 self._svd2pac_as_ptr().add(4usize),
53 )
54 }
55 }
56}
57#[doc(hidden)]
58#[derive(Copy, Clone, Eq, PartialEq)]
59pub struct Mmsfr_SPEC;
60impl crate::sealed::RegSpec for Mmsfr_SPEC {
61 type DataType = u32;
62}
63
64#[doc = "MemMirror Special Function Register"]
65pub type Mmsfr = crate::RegValueT<Mmsfr_SPEC>;
66
67impl Mmsfr {
68 #[doc = "MMSFR Key Code"]
69 #[inline(always)]
70 pub fn key(
71 self,
72 ) -> crate::common::RegisterField<
73 24,
74 0xff,
75 1,
76 0,
77 mmsfr::Key,
78 mmsfr::Key,
79 Mmsfr_SPEC,
80 crate::common::W,
81 > {
82 crate::common::RegisterField::<
83 24,
84 0xff,
85 1,
86 0,
87 mmsfr::Key,
88 mmsfr::Key,
89 Mmsfr_SPEC,
90 crate::common::W,
91 >::from_register(self, 0)
92 }
93
94 #[doc = "Specifies the memory mirror address.NOTE: A value cannot be set in the low-order 7 bits. These bits are fixed to 0."]
95 #[inline(always)]
96 pub fn memmiraddr(
97 self,
98 ) -> crate::common::RegisterField<7, 0xffff, 1, 0, u16, u16, Mmsfr_SPEC, crate::common::RW>
99 {
100 crate::common::RegisterField::<7,0xffff,1,0,u16,u16,Mmsfr_SPEC,crate::common::RW>::from_register(self,0)
101 }
102
103 #[doc = "These bits are read as 0000000. The write value should be 0000000."]
104 #[inline(always)]
105 pub fn reserved(
106 self,
107 ) -> crate::common::RegisterField<0, 0x7f, 1, 0, u8, u8, Mmsfr_SPEC, crate::common::RW> {
108 crate::common::RegisterField::<0,0x7f,1,0,u8,u8,Mmsfr_SPEC,crate::common::RW>::from_register(self,0)
109 }
110}
111impl ::core::default::Default for Mmsfr {
112 #[inline(always)]
113 fn default() -> Mmsfr {
114 <crate::RegValueT<Mmsfr_SPEC> as RegisterValue<_>>::new(0)
115 }
116}
117pub mod mmsfr {
118
119 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
120 pub struct Key_SPEC;
121 pub type Key = crate::EnumBitfieldStruct<u8, Key_SPEC>;
122 impl Key {
123 #[doc = "Writing to the MEMMIRADDR bits are valid, when the KEY bits are written 0xDB."]
124 pub const _0_X_DB: Self = Self::new(219);
125 }
126}
127#[doc(hidden)]
128#[derive(Copy, Clone, Eq, PartialEq)]
129pub struct Mmen_SPEC;
130impl crate::sealed::RegSpec for Mmen_SPEC {
131 type DataType = u32;
132}
133
134#[doc = "MemMirror Enable Register"]
135pub type Mmen = crate::RegValueT<Mmen_SPEC>;
136
137impl Mmen {
138 #[doc = "MMEN Key Code"]
139 #[inline(always)]
140 pub fn key(
141 self,
142 ) -> crate::common::RegisterField<
143 24,
144 0xff,
145 1,
146 0,
147 mmen::Key,
148 mmen::Key,
149 Mmen_SPEC,
150 crate::common::W,
151 > {
152 crate::common::RegisterField::<
153 24,
154 0xff,
155 1,
156 0,
157 mmen::Key,
158 mmen::Key,
159 Mmen_SPEC,
160 crate::common::W,
161 >::from_register(self, 0)
162 }
163
164 #[doc = "These bits are read as 00000000000000000000000. The write value should be 00000000000000000000000."]
165 #[inline(always)]
166 pub fn reserved(
167 self,
168 ) -> crate::common::RegisterField<1, 0x7fffff, 1, 0, u32, u32, Mmen_SPEC, crate::common::RW>
169 {
170 crate::common::RegisterField::<1,0x7fffff,1,0,u32,u32,Mmen_SPEC,crate::common::RW>::from_register(self,0)
171 }
172
173 #[doc = "Memory Mirror Function Enable"]
174 #[inline(always)]
175 pub fn en(
176 self,
177 ) -> crate::common::RegisterField<0, 0x1, 1, 0, mmen::En, mmen::En, Mmen_SPEC, crate::common::RW>
178 {
179 crate::common::RegisterField::<0,0x1,1,0,mmen::En,mmen::En,Mmen_SPEC,crate::common::RW>::from_register(self,0)
180 }
181}
182impl ::core::default::Default for Mmen {
183 #[inline(always)]
184 fn default() -> Mmen {
185 <crate::RegValueT<Mmen_SPEC> as RegisterValue<_>>::new(0)
186 }
187}
188pub mod mmen {
189
190 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
191 pub struct Key_SPEC;
192 pub type Key = crate::EnumBitfieldStruct<u8, Key_SPEC>;
193 impl Key {
194 #[doc = "Writing to the EN bit is valid, when the KEY bits are written 0xDB."]
195 pub const _0_X_DB: Self = Self::new(219);
196 }
197 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
198 pub struct En_SPEC;
199 pub type En = crate::EnumBitfieldStruct<u8, En_SPEC>;
200 impl En {
201 #[doc = "Memory Mirror Function is enabled."]
202 pub const _1: Self = Self::new(1);
203
204 #[doc = "Memory Mirror Function is disabled."]
205 pub const _0: Self = Self::new(0);
206 }
207}