mcxa_pac/sgi0/
sgi_ctrl2.rs1#[doc = "Register `sgi_ctrl2` reader"]
2pub type R = crate::R<SgiCtrl2Spec>;
3#[doc = "Register `sgi_ctrl2` writer"]
4pub type W = crate::W<SgiCtrl2Spec>;
5#[doc = "Field `flush` writer - Start Full SGI Flush"]
6pub type FlushW<'a, REG> = crate::BitWriter<'a, REG>;
7#[doc = "Field `key_flush` writer - Start KEY register-bank Flush"]
8pub type KeyFlushW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `datin_flush` writer - Start DATIN register-bank Flush"]
10pub type DatinFlushW<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `incr` reader - Increment(Triggered by SFR write)"]
12pub type IncrR = crate::BitReader;
13#[doc = "Field `incr` writer - Increment(Triggered by SFR write)"]
14pub type IncrW<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `xorwr` reader - Write-XOR control"]
16pub type XorwrR = crate::BitReader;
17#[doc = "Field `xorwr` writer - Write-XOR control"]
18pub type XorwrW<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `flushwr` reader - Flush Write control"]
20pub type FlushwrR = crate::BitReader;
21#[doc = "Field `flushwr` writer - Flush Write control"]
22pub type FlushwrW<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `incr_cin` reader - Increment Carry-In control"]
24pub type IncrCinR = crate::BitReader;
25#[doc = "Field `incr_cin` writer - Increment Carry-In control"]
26pub type IncrCinW<'a, REG> = crate::BitWriter<'a, REG>;
27#[doc = "Field `ctrl2_rsvd3` reader - reserved"]
28pub type Ctrl2Rsvd3R = crate::BitReader;
29#[doc = "Field `smasken` reader - SFRMASK Enable"]
30pub type SmaskenR = crate::BitReader;
31#[doc = "Field `smasken` writer - SFRMASK Enable"]
32pub type SmaskenW<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `smaskstep` reader - SFRSEED increment control"]
34pub type SmaskstepR = crate::BitReader;
35#[doc = "Field `smaskstep` writer - SFRSEED increment control"]
36pub type SmaskstepW<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `smasksw` reader - SFRMASK MASK control"]
38pub type SmaskswR = crate::BitReader;
39#[doc = "Field `smasksw` writer - SFRMASK MASK control"]
40pub type SmaskswW<'a, REG> = crate::BitWriter<'a, REG>;
41#[doc = "Field `ctrl2_rsvd2` reader - reserved"]
42pub type Ctrl2Rsvd2R = crate::BitReader;
43#[doc = "Field `movem` reader - 4-bit optional input for MOVEM feature"]
44pub type MovemR = crate::FieldReader;
45#[doc = "Field `movem` writer - 4-bit optional input for MOVEM feature"]
46pub type MovemW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
47#[doc = "Field `keyres` reader - Selects key registers to be updated when rkey=1"]
48pub type KeyresR = crate::FieldReader;
49#[doc = "Field `keyres` writer - Selects key registers to be updated when rkey=1"]
50pub type KeyresW<'a, REG> = crate::FieldWriter<'a, REG, 5>;
51#[doc = "Field `rkey` reader - Crypto result location"]
52pub type RkeyR = crate::BitReader;
53#[doc = "Field `rkey` writer - Crypto result location"]
54pub type RkeyW<'a, REG> = crate::BitWriter<'a, REG>;
55#[doc = "Field `bytes_order` reader - Byte order of regbank read/write data"]
56pub type BytesOrderR = crate::BitReader;
57#[doc = "Field `bytes_order` writer - Byte order of regbank read/write data"]
58pub type BytesOrderW<'a, REG> = crate::BitWriter<'a, REG>;
59#[doc = "Field `gcm_inxor` reader - GCM INXOR"]
60pub type GcmInxorR = crate::BitReader;
61#[doc = "Field `gcm_inxor` writer - GCM INXOR"]
62pub type GcmInxorW<'a, REG> = crate::BitWriter<'a, REG>;
63#[doc = "Field `ctrl2_rsvd1` reader - reserved"]
64pub type Ctrl2Rsvd1R = crate::FieldReader;
65impl R {
66 #[doc = "Bit 3 - Increment(Triggered by SFR write)"]
67 #[inline(always)]
68 pub fn incr(&self) -> IncrR {
69 IncrR::new(((self.bits >> 3) & 1) != 0)
70 }
71 #[doc = "Bit 4 - Write-XOR control"]
72 #[inline(always)]
73 pub fn xorwr(&self) -> XorwrR {
74 XorwrR::new(((self.bits >> 4) & 1) != 0)
75 }
76 #[doc = "Bit 5 - Flush Write control"]
77 #[inline(always)]
78 pub fn flushwr(&self) -> FlushwrR {
79 FlushwrR::new(((self.bits >> 5) & 1) != 0)
80 }
81 #[doc = "Bit 6 - Increment Carry-In control"]
82 #[inline(always)]
83 pub fn incr_cin(&self) -> IncrCinR {
84 IncrCinR::new(((self.bits >> 6) & 1) != 0)
85 }
86 #[doc = "Bit 7 - reserved"]
87 #[inline(always)]
88 pub fn ctrl2_rsvd3(&self) -> Ctrl2Rsvd3R {
89 Ctrl2Rsvd3R::new(((self.bits >> 7) & 1) != 0)
90 }
91 #[doc = "Bit 8 - SFRMASK Enable"]
92 #[inline(always)]
93 pub fn smasken(&self) -> SmaskenR {
94 SmaskenR::new(((self.bits >> 8) & 1) != 0)
95 }
96 #[doc = "Bit 9 - SFRSEED increment control"]
97 #[inline(always)]
98 pub fn smaskstep(&self) -> SmaskstepR {
99 SmaskstepR::new(((self.bits >> 9) & 1) != 0)
100 }
101 #[doc = "Bit 10 - SFRMASK MASK control"]
102 #[inline(always)]
103 pub fn smasksw(&self) -> SmaskswR {
104 SmaskswR::new(((self.bits >> 10) & 1) != 0)
105 }
106 #[doc = "Bit 11 - reserved"]
107 #[inline(always)]
108 pub fn ctrl2_rsvd2(&self) -> Ctrl2Rsvd2R {
109 Ctrl2Rsvd2R::new(((self.bits >> 11) & 1) != 0)
110 }
111 #[doc = "Bits 12:15 - 4-bit optional input for MOVEM feature"]
112 #[inline(always)]
113 pub fn movem(&self) -> MovemR {
114 MovemR::new(((self.bits >> 12) & 0x0f) as u8)
115 }
116 #[doc = "Bits 16:20 - Selects key registers to be updated when rkey=1"]
117 #[inline(always)]
118 pub fn keyres(&self) -> KeyresR {
119 KeyresR::new(((self.bits >> 16) & 0x1f) as u8)
120 }
121 #[doc = "Bit 21 - Crypto result location"]
122 #[inline(always)]
123 pub fn rkey(&self) -> RkeyR {
124 RkeyR::new(((self.bits >> 21) & 1) != 0)
125 }
126 #[doc = "Bit 22 - Byte order of regbank read/write data"]
127 #[inline(always)]
128 pub fn bytes_order(&self) -> BytesOrderR {
129 BytesOrderR::new(((self.bits >> 22) & 1) != 0)
130 }
131 #[doc = "Bit 23 - GCM INXOR"]
132 #[inline(always)]
133 pub fn gcm_inxor(&self) -> GcmInxorR {
134 GcmInxorR::new(((self.bits >> 23) & 1) != 0)
135 }
136 #[doc = "Bits 24:31 - reserved"]
137 #[inline(always)]
138 pub fn ctrl2_rsvd1(&self) -> Ctrl2Rsvd1R {
139 Ctrl2Rsvd1R::new(((self.bits >> 24) & 0xff) as u8)
140 }
141}
142#[cfg(feature = "debug")]
143impl core::fmt::Debug for R {
144 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
145 f.debug_struct("sgi_ctrl2")
146 .field("incr", &self.incr())
147 .field("xorwr", &self.xorwr())
148 .field("flushwr", &self.flushwr())
149 .field("incr_cin", &self.incr_cin())
150 .field("ctrl2_rsvd3", &self.ctrl2_rsvd3())
151 .field("smasken", &self.smasken())
152 .field("smaskstep", &self.smaskstep())
153 .field("smasksw", &self.smasksw())
154 .field("ctrl2_rsvd2", &self.ctrl2_rsvd2())
155 .field("movem", &self.movem())
156 .field("keyres", &self.keyres())
157 .field("rkey", &self.rkey())
158 .field("bytes_order", &self.bytes_order())
159 .field("gcm_inxor", &self.gcm_inxor())
160 .field("ctrl2_rsvd1", &self.ctrl2_rsvd1())
161 .finish()
162 }
163}
164impl W {
165 #[doc = "Bit 0 - Start Full SGI Flush"]
166 #[inline(always)]
167 pub fn flush(&mut self) -> FlushW<'_, SgiCtrl2Spec> {
168 FlushW::new(self, 0)
169 }
170 #[doc = "Bit 1 - Start KEY register-bank Flush"]
171 #[inline(always)]
172 pub fn key_flush(&mut self) -> KeyFlushW<'_, SgiCtrl2Spec> {
173 KeyFlushW::new(self, 1)
174 }
175 #[doc = "Bit 2 - Start DATIN register-bank Flush"]
176 #[inline(always)]
177 pub fn datin_flush(&mut self) -> DatinFlushW<'_, SgiCtrl2Spec> {
178 DatinFlushW::new(self, 2)
179 }
180 #[doc = "Bit 3 - Increment(Triggered by SFR write)"]
181 #[inline(always)]
182 pub fn incr(&mut self) -> IncrW<'_, SgiCtrl2Spec> {
183 IncrW::new(self, 3)
184 }
185 #[doc = "Bit 4 - Write-XOR control"]
186 #[inline(always)]
187 pub fn xorwr(&mut self) -> XorwrW<'_, SgiCtrl2Spec> {
188 XorwrW::new(self, 4)
189 }
190 #[doc = "Bit 5 - Flush Write control"]
191 #[inline(always)]
192 pub fn flushwr(&mut self) -> FlushwrW<'_, SgiCtrl2Spec> {
193 FlushwrW::new(self, 5)
194 }
195 #[doc = "Bit 6 - Increment Carry-In control"]
196 #[inline(always)]
197 pub fn incr_cin(&mut self) -> IncrCinW<'_, SgiCtrl2Spec> {
198 IncrCinW::new(self, 6)
199 }
200 #[doc = "Bit 8 - SFRMASK Enable"]
201 #[inline(always)]
202 pub fn smasken(&mut self) -> SmaskenW<'_, SgiCtrl2Spec> {
203 SmaskenW::new(self, 8)
204 }
205 #[doc = "Bit 9 - SFRSEED increment control"]
206 #[inline(always)]
207 pub fn smaskstep(&mut self) -> SmaskstepW<'_, SgiCtrl2Spec> {
208 SmaskstepW::new(self, 9)
209 }
210 #[doc = "Bit 10 - SFRMASK MASK control"]
211 #[inline(always)]
212 pub fn smasksw(&mut self) -> SmaskswW<'_, SgiCtrl2Spec> {
213 SmaskswW::new(self, 10)
214 }
215 #[doc = "Bits 12:15 - 4-bit optional input for MOVEM feature"]
216 #[inline(always)]
217 pub fn movem(&mut self) -> MovemW<'_, SgiCtrl2Spec> {
218 MovemW::new(self, 12)
219 }
220 #[doc = "Bits 16:20 - Selects key registers to be updated when rkey=1"]
221 #[inline(always)]
222 pub fn keyres(&mut self) -> KeyresW<'_, SgiCtrl2Spec> {
223 KeyresW::new(self, 16)
224 }
225 #[doc = "Bit 21 - Crypto result location"]
226 #[inline(always)]
227 pub fn rkey(&mut self) -> RkeyW<'_, SgiCtrl2Spec> {
228 RkeyW::new(self, 21)
229 }
230 #[doc = "Bit 22 - Byte order of regbank read/write data"]
231 #[inline(always)]
232 pub fn bytes_order(&mut self) -> BytesOrderW<'_, SgiCtrl2Spec> {
233 BytesOrderW::new(self, 22)
234 }
235 #[doc = "Bit 23 - GCM INXOR"]
236 #[inline(always)]
237 pub fn gcm_inxor(&mut self) -> GcmInxorW<'_, SgiCtrl2Spec> {
238 GcmInxorW::new(self, 23)
239 }
240}
241#[doc = "SGI Control register 2\n\nYou can [`read`](crate::Reg::read) this register and get [`sgi_ctrl2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sgi_ctrl2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
242pub struct SgiCtrl2Spec;
243impl crate::RegisterSpec for SgiCtrl2Spec {
244 type Ux = u32;
245}
246#[doc = "`read()` method returns [`sgi_ctrl2::R`](R) reader structure"]
247impl crate::Readable for SgiCtrl2Spec {}
248#[doc = "`write(|w| ..)` method takes [`sgi_ctrl2::W`](W) writer structure"]
249impl crate::Writable for SgiCtrl2Spec {
250 type Safety = crate::Unsafe;
251}
252#[doc = "`reset()` method sets sgi_ctrl2 to value 0"]
253impl crate::Resettable for SgiCtrl2Spec {}