1#[doc = "Register `SSTATUS` reader"]
2pub type R = crate::R<SstatusSpec>;
3#[doc = "Register `SSTATUS` writer"]
4pub type W = crate::W<SstatusSpec>;
5#[doc = "Field `STNOTSTOP` reader - Status not stop"]
6pub type StnotstopR = crate::BitReader;
7#[doc = "Field `STMSG` reader - Status message"]
8pub type StmsgR = crate::BitReader;
9#[doc = "Field `STCCCH` reader - Status Common Command Code Handler"]
10pub type StccchR = crate::BitReader;
11#[doc = "Field `STREQRD` reader - Status required"]
12pub type StreqrdR = crate::BitReader;
13#[doc = "Field `STREQWR` reader - Status request write"]
14pub type StreqwrR = crate::BitReader;
15#[doc = "Field `STDAA` reader - Status Dynamic Address Assignment"]
16pub type StdaaR = crate::BitReader;
17#[doc = "Field `STHDR` reader - Status High Data Rate"]
18pub type SthdrR = crate::BitReader;
19#[doc = "Field `START` reader - Start"]
20pub type StartR = crate::BitReader;
21#[doc = "Field `START` writer - Start"]
22pub type StartW<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `MATCHED` reader - Matched"]
24pub type MatchedR = crate::BitReader;
25#[doc = "Field `MATCHED` writer - Matched"]
26pub type MatchedW<'a, REG> = crate::BitWriter<'a, REG>;
27#[doc = "Field `STOP` reader - Stop"]
28pub type StopR = crate::BitReader;
29#[doc = "Field `STOP` writer - Stop"]
30pub type StopW<'a, REG> = crate::BitWriter<'a, REG>;
31#[doc = "Field `RX_PEND` reader - Received message pending"]
32pub type RxPendR = crate::BitReader;
33#[doc = "Field `TXNOTFULL` reader - Transmit buffer is not full"]
34pub type TxnotfullR = crate::BitReader;
35#[doc = "Field `DACHG` reader - DACHG"]
36pub type DachgR = crate::BitReader;
37#[doc = "Field `DACHG` writer - DACHG"]
38pub type DachgW<'a, REG> = crate::BitWriter<'a, REG>;
39#[doc = "Field `CCC` reader - Common Command Code"]
40pub type CccR = crate::BitReader;
41#[doc = "Field `CCC` writer - Common Command Code"]
42pub type CccW<'a, REG> = crate::BitWriter<'a, REG>;
43#[doc = "Field `ERRWARN` reader - Error warning"]
44pub type ErrwarnR = crate::BitReader;
45#[doc = "Field `HDRMATCH` reader - High Data Rate command match"]
46pub type HdrmatchR = crate::BitReader;
47#[doc = "Field `HDRMATCH` writer - High Data Rate command match"]
48pub type HdrmatchW<'a, REG> = crate::BitWriter<'a, REG>;
49#[doc = "Field `CHANDLED` reader - Common-Command-Code handled"]
50pub type ChandledR = crate::BitReader;
51#[doc = "Field `CHANDLED` writer - Common-Command-Code handled"]
52pub type ChandledW<'a, REG> = crate::BitWriter<'a, REG>;
53#[doc = "Field `EVENT` reader - Event"]
54pub type EventR = crate::BitReader;
55#[doc = "Field `EVENT` writer - Event"]
56pub type EventW<'a, REG> = crate::BitWriter<'a, REG>;
57#[doc = "Event details\n\nValue on reset: 0"]
58#[cfg_attr(feature = "defmt", derive(defmt::Format))]
59#[derive(Clone, Copy, Debug, PartialEq, Eq)]
60#[repr(u8)]
61pub enum Evdet {
62 #[doc = "0: NONE: no event or no pending event"]
63 None = 0,
64 #[doc = "1: NO_REQUEST: Request not sent yet. Either there was no START yet, or is waiting for Bus-Available or Bus-Idle (HJ)."]
65 NoRequest = 1,
66 #[doc = "2: NACKED: Not acknowledged(Request sent and NACKed); the module will try again."]
67 Nacked = 2,
68 #[doc = "3: ACKED: Acknowledged (Request sent and ACKed), so Done (unless the time control data is still being sent)."]
69 Acked = 3,
70}
71impl From<Evdet> for u8 {
72 #[inline(always)]
73 fn from(variant: Evdet) -> Self {
74 variant as _
75 }
76}
77impl crate::FieldSpec for Evdet {
78 type Ux = u8;
79}
80impl crate::IsEnum for Evdet {}
81#[doc = "Field `EVDET` reader - Event details"]
82pub type EvdetR = crate::FieldReader<Evdet>;
83impl EvdetR {
84 #[doc = "Get enumerated values variant"]
85 #[inline(always)]
86 pub const fn variant(&self) -> Evdet {
87 match self.bits {
88 0 => Evdet::None,
89 1 => Evdet::NoRequest,
90 2 => Evdet::Nacked,
91 3 => Evdet::Acked,
92 _ => unreachable!(),
93 }
94 }
95 #[doc = "NONE: no event or no pending event"]
96 #[inline(always)]
97 pub fn is_none(&self) -> bool {
98 *self == Evdet::None
99 }
100 #[doc = "NO_REQUEST: Request not sent yet. Either there was no START yet, or is waiting for Bus-Available or Bus-Idle (HJ)."]
101 #[inline(always)]
102 pub fn is_no_request(&self) -> bool {
103 *self == Evdet::NoRequest
104 }
105 #[doc = "NACKED: Not acknowledged(Request sent and NACKed); the module will try again."]
106 #[inline(always)]
107 pub fn is_nacked(&self) -> bool {
108 *self == Evdet::Nacked
109 }
110 #[doc = "ACKED: Acknowledged (Request sent and ACKed), so Done (unless the time control data is still being sent)."]
111 #[inline(always)]
112 pub fn is_acked(&self) -> bool {
113 *self == Evdet::Acked
114 }
115}
116#[doc = "Field `IBIDIS` reader - In-Band Interrupts are disabled"]
117pub type IbidisR = crate::BitReader;
118#[doc = "Field `MRDIS` reader - Master requests are disabled"]
119pub type MrdisR = crate::BitReader;
120#[doc = "Field `HJDIS` reader - Hot-Join is disabled"]
121pub type HjdisR = crate::BitReader;
122#[doc = "Activity state from Common Command Codes (CCC)\n\nValue on reset: 0"]
123#[cfg_attr(feature = "defmt", derive(defmt::Format))]
124#[derive(Clone, Copy, Debug, PartialEq, Eq)]
125#[repr(u8)]
126pub enum Actstate {
127 #[doc = "0: NO_LATENCY: normal bus operations"]
128 NoLatency = 0,
129 #[doc = "1: LATENCY_1MS: 1 ms of latency"]
130 Latency1ms = 1,
131 #[doc = "2: LATENCY_100MS: 100 ms of latency"]
132 Latency100ms = 2,
133 #[doc = "3: LATENCY_10S: 10 seconds of latency"]
134 Latency10s = 3,
135}
136impl From<Actstate> for u8 {
137 #[inline(always)]
138 fn from(variant: Actstate) -> Self {
139 variant as _
140 }
141}
142impl crate::FieldSpec for Actstate {
143 type Ux = u8;
144}
145impl crate::IsEnum for Actstate {}
146#[doc = "Field `ACTSTATE` reader - Activity state from Common Command Codes (CCC)"]
147pub type ActstateR = crate::FieldReader<Actstate>;
148impl ActstateR {
149 #[doc = "Get enumerated values variant"]
150 #[inline(always)]
151 pub const fn variant(&self) -> Actstate {
152 match self.bits {
153 0 => Actstate::NoLatency,
154 1 => Actstate::Latency1ms,
155 2 => Actstate::Latency100ms,
156 3 => Actstate::Latency10s,
157 _ => unreachable!(),
158 }
159 }
160 #[doc = "NO_LATENCY: normal bus operations"]
161 #[inline(always)]
162 pub fn is_no_latency(&self) -> bool {
163 *self == Actstate::NoLatency
164 }
165 #[doc = "LATENCY_1MS: 1 ms of latency"]
166 #[inline(always)]
167 pub fn is_latency_1ms(&self) -> bool {
168 *self == Actstate::Latency1ms
169 }
170 #[doc = "LATENCY_100MS: 100 ms of latency"]
171 #[inline(always)]
172 pub fn is_latency_100ms(&self) -> bool {
173 *self == Actstate::Latency100ms
174 }
175 #[doc = "LATENCY_10S: 10 seconds of latency"]
176 #[inline(always)]
177 pub fn is_latency_10s(&self) -> bool {
178 *self == Actstate::Latency10s
179 }
180}
181#[doc = "Time control\n\nValue on reset: 0"]
182#[cfg_attr(feature = "defmt", derive(defmt::Format))]
183#[derive(Clone, Copy, Debug, PartialEq, Eq)]
184#[repr(u8)]
185pub enum Timectrl {
186 #[doc = "0: NO_TIME_CONTROL: No time control is enabled"]
187 NoTimeControl = 0,
188 #[doc = "2: ASYNC_MODE: Asynchronous standard mode (0) is enabled"]
189 AsyncMode = 2,
190}
191impl From<Timectrl> for u8 {
192 #[inline(always)]
193 fn from(variant: Timectrl) -> Self {
194 variant as _
195 }
196}
197impl crate::FieldSpec for Timectrl {
198 type Ux = u8;
199}
200impl crate::IsEnum for Timectrl {}
201#[doc = "Field `TIMECTRL` reader - Time control"]
202pub type TimectrlR = crate::FieldReader<Timectrl>;
203impl TimectrlR {
204 #[doc = "Get enumerated values variant"]
205 #[inline(always)]
206 pub const fn variant(&self) -> Option<Timectrl> {
207 match self.bits {
208 0 => Some(Timectrl::NoTimeControl),
209 2 => Some(Timectrl::AsyncMode),
210 _ => None,
211 }
212 }
213 #[doc = "NO_TIME_CONTROL: No time control is enabled"]
214 #[inline(always)]
215 pub fn is_no_time_control(&self) -> bool {
216 *self == Timectrl::NoTimeControl
217 }
218 #[doc = "ASYNC_MODE: Asynchronous standard mode (0) is enabled"]
219 #[inline(always)]
220 pub fn is_async_mode(&self) -> bool {
221 *self == Timectrl::AsyncMode
222 }
223}
224impl R {
225 #[doc = "Bit 0 - Status not stop"]
226 #[inline(always)]
227 pub fn stnotstop(&self) -> StnotstopR {
228 StnotstopR::new((self.bits & 1) != 0)
229 }
230 #[doc = "Bit 1 - Status message"]
231 #[inline(always)]
232 pub fn stmsg(&self) -> StmsgR {
233 StmsgR::new(((self.bits >> 1) & 1) != 0)
234 }
235 #[doc = "Bit 2 - Status Common Command Code Handler"]
236 #[inline(always)]
237 pub fn stccch(&self) -> StccchR {
238 StccchR::new(((self.bits >> 2) & 1) != 0)
239 }
240 #[doc = "Bit 3 - Status required"]
241 #[inline(always)]
242 pub fn streqrd(&self) -> StreqrdR {
243 StreqrdR::new(((self.bits >> 3) & 1) != 0)
244 }
245 #[doc = "Bit 4 - Status request write"]
246 #[inline(always)]
247 pub fn streqwr(&self) -> StreqwrR {
248 StreqwrR::new(((self.bits >> 4) & 1) != 0)
249 }
250 #[doc = "Bit 5 - Status Dynamic Address Assignment"]
251 #[inline(always)]
252 pub fn stdaa(&self) -> StdaaR {
253 StdaaR::new(((self.bits >> 5) & 1) != 0)
254 }
255 #[doc = "Bit 6 - Status High Data Rate"]
256 #[inline(always)]
257 pub fn sthdr(&self) -> SthdrR {
258 SthdrR::new(((self.bits >> 6) & 1) != 0)
259 }
260 #[doc = "Bit 8 - Start"]
261 #[inline(always)]
262 pub fn start(&self) -> StartR {
263 StartR::new(((self.bits >> 8) & 1) != 0)
264 }
265 #[doc = "Bit 9 - Matched"]
266 #[inline(always)]
267 pub fn matched(&self) -> MatchedR {
268 MatchedR::new(((self.bits >> 9) & 1) != 0)
269 }
270 #[doc = "Bit 10 - Stop"]
271 #[inline(always)]
272 pub fn stop(&self) -> StopR {
273 StopR::new(((self.bits >> 10) & 1) != 0)
274 }
275 #[doc = "Bit 11 - Received message pending"]
276 #[inline(always)]
277 pub fn rx_pend(&self) -> RxPendR {
278 RxPendR::new(((self.bits >> 11) & 1) != 0)
279 }
280 #[doc = "Bit 12 - Transmit buffer is not full"]
281 #[inline(always)]
282 pub fn txnotfull(&self) -> TxnotfullR {
283 TxnotfullR::new(((self.bits >> 12) & 1) != 0)
284 }
285 #[doc = "Bit 13 - DACHG"]
286 #[inline(always)]
287 pub fn dachg(&self) -> DachgR {
288 DachgR::new(((self.bits >> 13) & 1) != 0)
289 }
290 #[doc = "Bit 14 - Common Command Code"]
291 #[inline(always)]
292 pub fn ccc(&self) -> CccR {
293 CccR::new(((self.bits >> 14) & 1) != 0)
294 }
295 #[doc = "Bit 15 - Error warning"]
296 #[inline(always)]
297 pub fn errwarn(&self) -> ErrwarnR {
298 ErrwarnR::new(((self.bits >> 15) & 1) != 0)
299 }
300 #[doc = "Bit 16 - High Data Rate command match"]
301 #[inline(always)]
302 pub fn hdrmatch(&self) -> HdrmatchR {
303 HdrmatchR::new(((self.bits >> 16) & 1) != 0)
304 }
305 #[doc = "Bit 17 - Common-Command-Code handled"]
306 #[inline(always)]
307 pub fn chandled(&self) -> ChandledR {
308 ChandledR::new(((self.bits >> 17) & 1) != 0)
309 }
310 #[doc = "Bit 18 - Event"]
311 #[inline(always)]
312 pub fn event(&self) -> EventR {
313 EventR::new(((self.bits >> 18) & 1) != 0)
314 }
315 #[doc = "Bits 20:21 - Event details"]
316 #[inline(always)]
317 pub fn evdet(&self) -> EvdetR {
318 EvdetR::new(((self.bits >> 20) & 3) as u8)
319 }
320 #[doc = "Bit 24 - In-Band Interrupts are disabled"]
321 #[inline(always)]
322 pub fn ibidis(&self) -> IbidisR {
323 IbidisR::new(((self.bits >> 24) & 1) != 0)
324 }
325 #[doc = "Bit 25 - Master requests are disabled"]
326 #[inline(always)]
327 pub fn mrdis(&self) -> MrdisR {
328 MrdisR::new(((self.bits >> 25) & 1) != 0)
329 }
330 #[doc = "Bit 27 - Hot-Join is disabled"]
331 #[inline(always)]
332 pub fn hjdis(&self) -> HjdisR {
333 HjdisR::new(((self.bits >> 27) & 1) != 0)
334 }
335 #[doc = "Bits 28:29 - Activity state from Common Command Codes (CCC)"]
336 #[inline(always)]
337 pub fn actstate(&self) -> ActstateR {
338 ActstateR::new(((self.bits >> 28) & 3) as u8)
339 }
340 #[doc = "Bits 30:31 - Time control"]
341 #[inline(always)]
342 pub fn timectrl(&self) -> TimectrlR {
343 TimectrlR::new(((self.bits >> 30) & 3) as u8)
344 }
345}
346#[cfg(feature = "debug")]
347impl core::fmt::Debug for R {
348 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
349 f.debug_struct("SSTATUS")
350 .field("stnotstop", &self.stnotstop())
351 .field("stmsg", &self.stmsg())
352 .field("stccch", &self.stccch())
353 .field("streqrd", &self.streqrd())
354 .field("streqwr", &self.streqwr())
355 .field("stdaa", &self.stdaa())
356 .field("sthdr", &self.sthdr())
357 .field("start", &self.start())
358 .field("matched", &self.matched())
359 .field("stop", &self.stop())
360 .field("rx_pend", &self.rx_pend())
361 .field("txnotfull", &self.txnotfull())
362 .field("dachg", &self.dachg())
363 .field("ccc", &self.ccc())
364 .field("errwarn", &self.errwarn())
365 .field("hdrmatch", &self.hdrmatch())
366 .field("chandled", &self.chandled())
367 .field("event", &self.event())
368 .field("evdet", &self.evdet())
369 .field("ibidis", &self.ibidis())
370 .field("mrdis", &self.mrdis())
371 .field("hjdis", &self.hjdis())
372 .field("actstate", &self.actstate())
373 .field("timectrl", &self.timectrl())
374 .finish()
375 }
376}
377impl W {
378 #[doc = "Bit 8 - Start"]
379 #[inline(always)]
380 pub fn start(&mut self) -> StartW<SstatusSpec> {
381 StartW::new(self, 8)
382 }
383 #[doc = "Bit 9 - Matched"]
384 #[inline(always)]
385 pub fn matched(&mut self) -> MatchedW<SstatusSpec> {
386 MatchedW::new(self, 9)
387 }
388 #[doc = "Bit 10 - Stop"]
389 #[inline(always)]
390 pub fn stop(&mut self) -> StopW<SstatusSpec> {
391 StopW::new(self, 10)
392 }
393 #[doc = "Bit 13 - DACHG"]
394 #[inline(always)]
395 pub fn dachg(&mut self) -> DachgW<SstatusSpec> {
396 DachgW::new(self, 13)
397 }
398 #[doc = "Bit 14 - Common Command Code"]
399 #[inline(always)]
400 pub fn ccc(&mut self) -> CccW<SstatusSpec> {
401 CccW::new(self, 14)
402 }
403 #[doc = "Bit 16 - High Data Rate command match"]
404 #[inline(always)]
405 pub fn hdrmatch(&mut self) -> HdrmatchW<SstatusSpec> {
406 HdrmatchW::new(self, 16)
407 }
408 #[doc = "Bit 17 - Common-Command-Code handled"]
409 #[inline(always)]
410 pub fn chandled(&mut self) -> ChandledW<SstatusSpec> {
411 ChandledW::new(self, 17)
412 }
413 #[doc = "Bit 18 - Event"]
414 #[inline(always)]
415 pub fn event(&mut self) -> EventW<SstatusSpec> {
416 EventW::new(self, 18)
417 }
418}
419#[doc = "Slave Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`sstatus::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sstatus::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
420pub struct SstatusSpec;
421impl crate::RegisterSpec for SstatusSpec {
422 type Ux = u32;
423}
424#[doc = "`read()` method returns [`sstatus::R`](R) reader structure"]
425impl crate::Readable for SstatusSpec {}
426#[doc = "`write(|w| ..)` method takes [`sstatus::W`](W) writer structure"]
427impl crate::Writable for SstatusSpec {
428 type Safety = crate::Unsafe;
429 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
430 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
431}
432#[doc = "`reset()` method sets SSTATUS to value 0x1000"]
433impl crate::Resettable for SstatusSpec {
434 const RESET_VALUE: u32 = 0x1000;
435}