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}
103impl ::core::default::Default for Mmsfr {
104 #[inline(always)]
105 fn default() -> Mmsfr {
106 <crate::RegValueT<Mmsfr_SPEC> as RegisterValue<_>>::new(0)
107 }
108}
109pub mod mmsfr {
110
111 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
112 pub struct Key_SPEC;
113 pub type Key = crate::EnumBitfieldStruct<u8, Key_SPEC>;
114 impl Key {
115 #[doc = "Writing to the MEMMIRADDR bits are valid, when the KEY bits are written 0xDB."]
116 pub const _0_X_DB: Self = Self::new(219);
117 }
118}
119#[doc(hidden)]
120#[derive(Copy, Clone, Eq, PartialEq)]
121pub struct Mmen_SPEC;
122impl crate::sealed::RegSpec for Mmen_SPEC {
123 type DataType = u32;
124}
125
126#[doc = "MemMirror Enable Register"]
127pub type Mmen = crate::RegValueT<Mmen_SPEC>;
128
129impl Mmen {
130 #[doc = "MMEN Key Code"]
131 #[inline(always)]
132 pub fn key(
133 self,
134 ) -> crate::common::RegisterField<
135 24,
136 0xff,
137 1,
138 0,
139 mmen::Key,
140 mmen::Key,
141 Mmen_SPEC,
142 crate::common::W,
143 > {
144 crate::common::RegisterField::<
145 24,
146 0xff,
147 1,
148 0,
149 mmen::Key,
150 mmen::Key,
151 Mmen_SPEC,
152 crate::common::W,
153 >::from_register(self, 0)
154 }
155
156 #[doc = "Memory Mirror Function Enable"]
157 #[inline(always)]
158 pub fn en(
159 self,
160 ) -> crate::common::RegisterField<0, 0x1, 1, 0, mmen::En, mmen::En, Mmen_SPEC, crate::common::RW>
161 {
162 crate::common::RegisterField::<0,0x1,1,0,mmen::En,mmen::En,Mmen_SPEC,crate::common::RW>::from_register(self,0)
163 }
164}
165impl ::core::default::Default for Mmen {
166 #[inline(always)]
167 fn default() -> Mmen {
168 <crate::RegValueT<Mmen_SPEC> as RegisterValue<_>>::new(0)
169 }
170}
171pub mod mmen {
172
173 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
174 pub struct Key_SPEC;
175 pub type Key = crate::EnumBitfieldStruct<u8, Key_SPEC>;
176 impl Key {
177 #[doc = "Writing to the EN bit is valid, when the KEY bits are written 0xDB."]
178 pub const _0_X_DB: Self = Self::new(219);
179 }
180 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
181 pub struct En_SPEC;
182 pub type En = crate::EnumBitfieldStruct<u8, En_SPEC>;
183 impl En {
184 #[doc = "Memory Mirror Function is enabled."]
185 pub const _1: Self = Self::new(1);
186
187 #[doc = "Memory Mirror Function is disabled."]
188 pub const _0: Self = Self::new(0);
189 }
190}