1#[doc = "Register `STS1` reader"]
2pub type R = crate::R<STS1_SPEC>;
3#[doc = "Register `STS1` writer"]
4pub type W = crate::W<STS1_SPEC>;
5#[doc = "Start bit (Master mode)\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum STARTF_A {
8 #[doc = "0: No Start condition"]
9 NoStart = 0,
10 #[doc = "1: Start condition generated"]
11 Start = 1,
12}
13impl From<STARTF_A> for bool {
14 #[inline(always)]
15 fn from(variant: STARTF_A) -> Self {
16 variant as u8 != 0
17 }
18}
19#[doc = "Field `STARTF` reader - Start bit (Master mode)"]
20pub type STARTF_R = crate::BitReader<STARTF_A>;
21impl STARTF_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> STARTF_A {
25 match self.bits {
26 false => STARTF_A::NoStart,
27 true => STARTF_A::Start,
28 }
29 }
30 #[doc = "No Start condition"]
31 #[inline(always)]
32 pub fn is_no_start(&self) -> bool {
33 *self == STARTF_A::NoStart
34 }
35 #[doc = "Start condition generated"]
36 #[inline(always)]
37 pub fn is_start(&self) -> bool {
38 *self == STARTF_A::Start
39 }
40}
41#[doc = "Address sent (master mode)/matched (slave mode)\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum ADDR7F_A {
44 #[doc = "0: Adress mismatched or not received"]
45 NotMatch = 0,
46 #[doc = "1: Received slave address matched with one of the enabled slave addresses"]
47 Match = 1,
48}
49impl From<ADDR7F_A> for bool {
50 #[inline(always)]
51 fn from(variant: ADDR7F_A) -> Self {
52 variant as u8 != 0
53 }
54}
55#[doc = "Field `ADDR7F` reader - Address sent (master mode)/matched (slave mode)"]
56pub type ADDR7F_R = crate::BitReader<ADDR7F_A>;
57impl ADDR7F_R {
58 #[doc = "Get enumerated values variant"]
59 #[inline(always)]
60 pub const fn variant(&self) -> ADDR7F_A {
61 match self.bits {
62 false => ADDR7F_A::NotMatch,
63 true => ADDR7F_A::Match,
64 }
65 }
66 #[doc = "Adress mismatched or not received"]
67 #[inline(always)]
68 pub fn is_not_match(&self) -> bool {
69 *self == ADDR7F_A::NotMatch
70 }
71 #[doc = "Received slave address matched with one of the enabled slave addresses"]
72 #[inline(always)]
73 pub fn is_match(&self) -> bool {
74 *self == ADDR7F_A::Match
75 }
76}
77#[doc = "Transmit data complete\n\nValue on reset: 0"]
78#[derive(Clone, Copy, Debug, PartialEq, Eq)]
79pub enum TDC_A {
80 #[doc = "0: Data byte transfer not done"]
81 NotFinished = 0,
82 #[doc = "1: Data byte transfer successful"]
83 Finished = 1,
84}
85impl From<TDC_A> for bool {
86 #[inline(always)]
87 fn from(variant: TDC_A) -> Self {
88 variant as u8 != 0
89 }
90}
91#[doc = "Field `TDC` reader - Transmit data complete"]
92pub type TDC_R = crate::BitReader<TDC_A>;
93impl TDC_R {
94 #[doc = "Get enumerated values variant"]
95 #[inline(always)]
96 pub const fn variant(&self) -> TDC_A {
97 match self.bits {
98 false => TDC_A::NotFinished,
99 true => TDC_A::Finished,
100 }
101 }
102 #[doc = "Data byte transfer not done"]
103 #[inline(always)]
104 pub fn is_not_finished(&self) -> bool {
105 *self == TDC_A::NotFinished
106 }
107 #[doc = "Data byte transfer successful"]
108 #[inline(always)]
109 pub fn is_finished(&self) -> bool {
110 *self == TDC_A::Finished
111 }
112}
113#[doc = "address header match (Master mode)\n\nValue on reset: 0"]
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub enum ADDRHF_A {
116 #[doc = "0: Master 9~8 bit address head mismatch"]
117 NotMatch = 0,
118 #[doc = "1: Master 9~8 bit address head match"]
119 Match = 1,
120}
121impl From<ADDRHF_A> for bool {
122 #[inline(always)]
123 fn from(variant: ADDRHF_A) -> Self {
124 variant as u8 != 0
125 }
126}
127#[doc = "Field `ADDRHF` reader - address header match (Master mode)"]
128pub type ADDRHF_R = crate::BitReader<ADDRHF_A>;
129impl ADDRHF_R {
130 #[doc = "Get enumerated values variant"]
131 #[inline(always)]
132 pub const fn variant(&self) -> ADDRHF_A {
133 match self.bits {
134 false => ADDRHF_A::NotMatch,
135 true => ADDRHF_A::Match,
136 }
137 }
138 #[doc = "Master 9~8 bit address head mismatch"]
139 #[inline(always)]
140 pub fn is_not_match(&self) -> bool {
141 *self == ADDRHF_A::NotMatch
142 }
143 #[doc = "Master 9~8 bit address head match"]
144 #[inline(always)]
145 pub fn is_match(&self) -> bool {
146 *self == ADDRHF_A::Match
147 }
148}
149#[doc = "Stop detection (slave mode)\n\nValue on reset: 0"]
150#[derive(Clone, Copy, Debug, PartialEq, Eq)]
151pub enum STOPF_A {
152 #[doc = "0: No Stop condition detected"]
153 NoStop = 0,
154 #[doc = "1: Stop condition detected"]
155 Stop = 1,
156}
157impl From<STOPF_A> for bool {
158 #[inline(always)]
159 fn from(variant: STOPF_A) -> Self {
160 variant as u8 != 0
161 }
162}
163#[doc = "Field `STOPF` reader - Stop detection (slave mode)"]
164pub type STOPF_R = crate::BitReader<STOPF_A>;
165impl STOPF_R {
166 #[doc = "Get enumerated values variant"]
167 #[inline(always)]
168 pub const fn variant(&self) -> STOPF_A {
169 match self.bits {
170 false => STOPF_A::NoStop,
171 true => STOPF_A::Stop,
172 }
173 }
174 #[doc = "No Stop condition detected"]
175 #[inline(always)]
176 pub fn is_no_stop(&self) -> bool {
177 *self == STOPF_A::NoStop
178 }
179 #[doc = "Stop condition detected"]
180 #[inline(always)]
181 pub fn is_stop(&self) -> bool {
182 *self == STOPF_A::Stop
183 }
184}
185#[doc = "Receive data buffer full (receivers)\n\nValue on reset: 0"]
186#[derive(Clone, Copy, Debug, PartialEq, Eq)]
187pub enum RDBF_A {
188 #[doc = "0: Data register empty"]
189 Empty = 0,
190 #[doc = "1: Data register not empty"]
191 NotEmpty = 1,
192}
193impl From<RDBF_A> for bool {
194 #[inline(always)]
195 fn from(variant: RDBF_A) -> Self {
196 variant as u8 != 0
197 }
198}
199#[doc = "Field `RDBF` reader - Receive data buffer full (receivers)"]
200pub type RDBF_R = crate::BitReader<RDBF_A>;
201impl RDBF_R {
202 #[doc = "Get enumerated values variant"]
203 #[inline(always)]
204 pub const fn variant(&self) -> RDBF_A {
205 match self.bits {
206 false => RDBF_A::Empty,
207 true => RDBF_A::NotEmpty,
208 }
209 }
210 #[doc = "Data register empty"]
211 #[inline(always)]
212 pub fn is_empty(&self) -> bool {
213 *self == RDBF_A::Empty
214 }
215 #[doc = "Data register not empty"]
216 #[inline(always)]
217 pub fn is_not_empty(&self) -> bool {
218 *self == RDBF_A::NotEmpty
219 }
220}
221#[doc = "Transmit data buffer empty (transmitters)\n\nValue on reset: 0"]
222#[derive(Clone, Copy, Debug, PartialEq, Eq)]
223pub enum TDBE_A {
224 #[doc = "0: Data register not empty"]
225 NotEmpty = 0,
226 #[doc = "1: Data register empty"]
227 Empty = 1,
228}
229impl From<TDBE_A> for bool {
230 #[inline(always)]
231 fn from(variant: TDBE_A) -> Self {
232 variant as u8 != 0
233 }
234}
235#[doc = "Field `TDBE` reader - Transmit data buffer empty (transmitters)"]
236pub type TDBE_R = crate::BitReader<TDBE_A>;
237impl TDBE_R {
238 #[doc = "Get enumerated values variant"]
239 #[inline(always)]
240 pub const fn variant(&self) -> TDBE_A {
241 match self.bits {
242 false => TDBE_A::NotEmpty,
243 true => TDBE_A::Empty,
244 }
245 }
246 #[doc = "Data register not empty"]
247 #[inline(always)]
248 pub fn is_not_empty(&self) -> bool {
249 *self == TDBE_A::NotEmpty
250 }
251 #[doc = "Data register empty"]
252 #[inline(always)]
253 pub fn is_empty(&self) -> bool {
254 *self == TDBE_A::Empty
255 }
256}
257#[doc = "Bus error\n\nValue on reset: 0"]
258#[derive(Clone, Copy, Debug, PartialEq, Eq)]
259pub enum Buserrr {
260 #[doc = "0: No misplaced Start or Stop condition"]
261 NoError = 0,
262 #[doc = "1: Misplaced Start or Stop condition"]
263 Error = 1,
264}
265impl From<Buserrr> for bool {
266 #[inline(always)]
267 fn from(variant: Buserrr) -> Self {
268 variant as u8 != 0
269 }
270}
271#[doc = "Field `BUSERR` reader - Bus error"]
272pub type BUSERR_R = crate::BitReader<Buserrr>;
273impl BUSERR_R {
274 #[doc = "Get enumerated values variant"]
275 #[inline(always)]
276 pub const fn variant(&self) -> Buserrr {
277 match self.bits {
278 false => Buserrr::NoError,
279 true => Buserrr::Error,
280 }
281 }
282 #[doc = "No misplaced Start or Stop condition"]
283 #[inline(always)]
284 pub fn is_no_error(&self) -> bool {
285 *self == Buserrr::NoError
286 }
287 #[doc = "Misplaced Start or Stop condition"]
288 #[inline(always)]
289 pub fn is_error(&self) -> bool {
290 *self == Buserrr::Error
291 }
292}
293#[doc = "Bus error\n\nValue on reset: 0"]
294#[derive(Clone, Copy, Debug, PartialEq, Eq)]
295pub enum BuserrwWO {
296 #[doc = "0: Clear flag"]
297 Clear = 0,
298}
299impl From<BuserrwWO> for bool {
300 #[inline(always)]
301 fn from(variant: BuserrwWO) -> Self {
302 variant as u8 != 0
303 }
304}
305#[doc = "Field `BUSERR` writer - Bus error"]
306pub type BUSERR_W<'a, REG> = crate::BitWriter0C<'a, REG, BuserrwWO>;
307impl<'a, REG> BUSERR_W<'a, REG>
308where
309 REG: crate::Writable + crate::RegisterSpec,
310{
311 #[doc = "Clear flag"]
312 #[inline(always)]
313 pub fn clear(self) -> &'a mut crate::W<REG> {
314 self.variant(BuserrwWO::Clear)
315 }
316}
317#[doc = "Arbitration lost (master mode)\n\nValue on reset: 0"]
318#[derive(Clone, Copy, Debug, PartialEq, Eq)]
319pub enum Arlostr {
320 #[doc = "0: No Arbitration Lost detected"]
321 NoLost = 0,
322 #[doc = "1: Arbitration Lost detected"]
323 Lost = 1,
324}
325impl From<Arlostr> for bool {
326 #[inline(always)]
327 fn from(variant: Arlostr) -> Self {
328 variant as u8 != 0
329 }
330}
331#[doc = "Field `ARLOST` reader - Arbitration lost (master mode)"]
332pub type ARLOST_R = crate::BitReader<Arlostr>;
333impl ARLOST_R {
334 #[doc = "Get enumerated values variant"]
335 #[inline(always)]
336 pub const fn variant(&self) -> Arlostr {
337 match self.bits {
338 false => Arlostr::NoLost,
339 true => Arlostr::Lost,
340 }
341 }
342 #[doc = "No Arbitration Lost detected"]
343 #[inline(always)]
344 pub fn is_no_lost(&self) -> bool {
345 *self == Arlostr::NoLost
346 }
347 #[doc = "Arbitration Lost detected"]
348 #[inline(always)]
349 pub fn is_lost(&self) -> bool {
350 *self == Arlostr::Lost
351 }
352}
353#[doc = "Arbitration lost (master mode)\n\nValue on reset: 0"]
354#[derive(Clone, Copy, Debug, PartialEq, Eq)]
355pub enum ArlostwWO {
356 #[doc = "0: Clear flag"]
357 Clear = 0,
358}
359impl From<ArlostwWO> for bool {
360 #[inline(always)]
361 fn from(variant: ArlostwWO) -> Self {
362 variant as u8 != 0
363 }
364}
365#[doc = "Field `ARLOST` writer - Arbitration lost (master mode)"]
366pub type ARLOST_W<'a, REG> = crate::BitWriter0C<'a, REG, ArlostwWO>;
367impl<'a, REG> ARLOST_W<'a, REG>
368where
369 REG: crate::Writable + crate::RegisterSpec,
370{
371 #[doc = "Clear flag"]
372 #[inline(always)]
373 pub fn clear(self) -> &'a mut crate::W<REG> {
374 self.variant(ArlostwWO::Clear)
375 }
376}
377#[doc = "Acknowledge failure\n\nValue on reset: 0"]
378#[derive(Clone, Copy, Debug, PartialEq, Eq)]
379pub enum Ackfailr {
380 #[doc = "0: No acknowledge failure"]
381 NoFailure = 0,
382 #[doc = "1: Acknowledge failure"]
383 Failure = 1,
384}
385impl From<Ackfailr> for bool {
386 #[inline(always)]
387 fn from(variant: Ackfailr) -> Self {
388 variant as u8 != 0
389 }
390}
391#[doc = "Field `ACKFAIL` reader - Acknowledge failure"]
392pub type ACKFAIL_R = crate::BitReader<Ackfailr>;
393impl ACKFAIL_R {
394 #[doc = "Get enumerated values variant"]
395 #[inline(always)]
396 pub const fn variant(&self) -> Ackfailr {
397 match self.bits {
398 false => Ackfailr::NoFailure,
399 true => Ackfailr::Failure,
400 }
401 }
402 #[doc = "No acknowledge failure"]
403 #[inline(always)]
404 pub fn is_no_failure(&self) -> bool {
405 *self == Ackfailr::NoFailure
406 }
407 #[doc = "Acknowledge failure"]
408 #[inline(always)]
409 pub fn is_failure(&self) -> bool {
410 *self == Ackfailr::Failure
411 }
412}
413#[doc = "Acknowledge failure\n\nValue on reset: 0"]
414#[derive(Clone, Copy, Debug, PartialEq, Eq)]
415pub enum AckfailwWO {
416 #[doc = "0: Clear flag"]
417 Clear = 0,
418}
419impl From<AckfailwWO> for bool {
420 #[inline(always)]
421 fn from(variant: AckfailwWO) -> Self {
422 variant as u8 != 0
423 }
424}
425#[doc = "Field `ACKFAIL` writer - Acknowledge failure"]
426pub type ACKFAIL_W<'a, REG> = crate::BitWriter0C<'a, REG, AckfailwWO>;
427impl<'a, REG> ACKFAIL_W<'a, REG>
428where
429 REG: crate::Writable + crate::RegisterSpec,
430{
431 #[doc = "Clear flag"]
432 #[inline(always)]
433 pub fn clear(self) -> &'a mut crate::W<REG> {
434 self.variant(AckfailwWO::Clear)
435 }
436}
437#[doc = "Overflow or underflow\n\nValue on reset: 0"]
438#[derive(Clone, Copy, Debug, PartialEq, Eq)]
439pub enum Oufr {
440 #[doc = "0: No overrun/underrun occured"]
441 NoOverrun = 0,
442 #[doc = "1: Overrun/underrun occured"]
443 Overrun = 1,
444}
445impl From<Oufr> for bool {
446 #[inline(always)]
447 fn from(variant: Oufr) -> Self {
448 variant as u8 != 0
449 }
450}
451#[doc = "Field `OUF` reader - Overflow or underflow"]
452pub type OUF_R = crate::BitReader<Oufr>;
453impl OUF_R {
454 #[doc = "Get enumerated values variant"]
455 #[inline(always)]
456 pub const fn variant(&self) -> Oufr {
457 match self.bits {
458 false => Oufr::NoOverrun,
459 true => Oufr::Overrun,
460 }
461 }
462 #[doc = "No overrun/underrun occured"]
463 #[inline(always)]
464 pub fn is_no_overrun(&self) -> bool {
465 *self == Oufr::NoOverrun
466 }
467 #[doc = "Overrun/underrun occured"]
468 #[inline(always)]
469 pub fn is_overrun(&self) -> bool {
470 *self == Oufr::Overrun
471 }
472}
473#[doc = "Overflow or underflow\n\nValue on reset: 0"]
474#[derive(Clone, Copy, Debug, PartialEq, Eq)]
475pub enum OufwWO {
476 #[doc = "0: Clear flag"]
477 Clear = 0,
478}
479impl From<OufwWO> for bool {
480 #[inline(always)]
481 fn from(variant: OufwWO) -> Self {
482 variant as u8 != 0
483 }
484}
485#[doc = "Field `OUF` writer - Overflow or underflow"]
486pub type OUF_W<'a, REG> = crate::BitWriter0C<'a, REG, OufwWO>;
487impl<'a, REG> OUF_W<'a, REG>
488where
489 REG: crate::Writable + crate::RegisterSpec,
490{
491 #[doc = "Clear flag"]
492 #[inline(always)]
493 pub fn clear(self) -> &'a mut crate::W<REG> {
494 self.variant(OufwWO::Clear)
495 }
496}
497#[doc = "PEC receive error\n\nValue on reset: 0"]
498#[derive(Clone, Copy, Debug, PartialEq, Eq)]
499pub enum Pecerrr {
500 #[doc = "0: no PEC error: receiver returns ACK after PEC reception (if ACK=1)"]
501 NoError = 0,
502 #[doc = "1: PEC error: receiver returns NACK after PEC reception (whatever ACK)"]
503 Error = 1,
504}
505impl From<Pecerrr> for bool {
506 #[inline(always)]
507 fn from(variant: Pecerrr) -> Self {
508 variant as u8 != 0
509 }
510}
511#[doc = "Field `PECERR` reader - PEC receive error"]
512pub type PECERR_R = crate::BitReader<Pecerrr>;
513impl PECERR_R {
514 #[doc = "Get enumerated values variant"]
515 #[inline(always)]
516 pub const fn variant(&self) -> Pecerrr {
517 match self.bits {
518 false => Pecerrr::NoError,
519 true => Pecerrr::Error,
520 }
521 }
522 #[doc = "no PEC error: receiver returns ACK after PEC reception (if ACK=1)"]
523 #[inline(always)]
524 pub fn is_no_error(&self) -> bool {
525 *self == Pecerrr::NoError
526 }
527 #[doc = "PEC error: receiver returns NACK after PEC reception (whatever ACK)"]
528 #[inline(always)]
529 pub fn is_error(&self) -> bool {
530 *self == Pecerrr::Error
531 }
532}
533#[doc = "PEC receive error\n\nValue on reset: 0"]
534#[derive(Clone, Copy, Debug, PartialEq, Eq)]
535pub enum PecerrwWO {
536 #[doc = "0: Clear flag"]
537 Clear = 0,
538}
539impl From<PecerrwWO> for bool {
540 #[inline(always)]
541 fn from(variant: PecerrwWO) -> Self {
542 variant as u8 != 0
543 }
544}
545#[doc = "Field `PECERR` writer - PEC receive error"]
546pub type PECERR_W<'a, REG> = crate::BitWriter0C<'a, REG, PecerrwWO>;
547impl<'a, REG> PECERR_W<'a, REG>
548where
549 REG: crate::Writable + crate::RegisterSpec,
550{
551 #[doc = "Clear flag"]
552 #[inline(always)]
553 pub fn clear(self) -> &'a mut crate::W<REG> {
554 self.variant(PecerrwWO::Clear)
555 }
556}
557#[doc = "Timeout error\n\nValue on reset: 0"]
558#[derive(Clone, Copy, Debug, PartialEq, Eq)]
559pub enum Tmoutr {
560 #[doc = "0: No Timeout error"]
561 NoTimeout = 0,
562 #[doc = "1: SCL remained LOW for 25 ms"]
563 Timeout = 1,
564}
565impl From<Tmoutr> for bool {
566 #[inline(always)]
567 fn from(variant: Tmoutr) -> Self {
568 variant as u8 != 0
569 }
570}
571#[doc = "Field `TMOUT` reader - Timeout error"]
572pub type TMOUT_R = crate::BitReader<Tmoutr>;
573impl TMOUT_R {
574 #[doc = "Get enumerated values variant"]
575 #[inline(always)]
576 pub const fn variant(&self) -> Tmoutr {
577 match self.bits {
578 false => Tmoutr::NoTimeout,
579 true => Tmoutr::Timeout,
580 }
581 }
582 #[doc = "No Timeout error"]
583 #[inline(always)]
584 pub fn is_no_timeout(&self) -> bool {
585 *self == Tmoutr::NoTimeout
586 }
587 #[doc = "SCL remained LOW for 25 ms"]
588 #[inline(always)]
589 pub fn is_timeout(&self) -> bool {
590 *self == Tmoutr::Timeout
591 }
592}
593#[doc = "Timeout error\n\nValue on reset: 0"]
594#[derive(Clone, Copy, Debug, PartialEq, Eq)]
595pub enum TmoutwWO {
596 #[doc = "0: Clear flag"]
597 Clear = 0,
598}
599impl From<TmoutwWO> for bool {
600 #[inline(always)]
601 fn from(variant: TmoutwWO) -> Self {
602 variant as u8 != 0
603 }
604}
605#[doc = "Field `TMOUT` writer - Timeout error"]
606pub type TMOUT_W<'a, REG> = crate::BitWriter0C<'a, REG, TmoutwWO>;
607impl<'a, REG> TMOUT_W<'a, REG>
608where
609 REG: crate::Writable + crate::RegisterSpec,
610{
611 #[doc = "Clear flag"]
612 #[inline(always)]
613 pub fn clear(self) -> &'a mut crate::W<REG> {
614 self.variant(TmoutwWO::Clear)
615 }
616}
617#[doc = "SMBus alert\n\nValue on reset: 0"]
618#[derive(Clone, Copy, Debug, PartialEq, Eq)]
619pub enum Alertfr {
620 #[doc = "0: No SMBALERT occured"]
621 NoAlert = 0,
622 #[doc = "1: SMBALERT occurred"]
623 Alert = 1,
624}
625impl From<Alertfr> for bool {
626 #[inline(always)]
627 fn from(variant: Alertfr) -> Self {
628 variant as u8 != 0
629 }
630}
631#[doc = "Field `ALERTF` reader - SMBus alert"]
632pub type ALERTF_R = crate::BitReader<Alertfr>;
633impl ALERTF_R {
634 #[doc = "Get enumerated values variant"]
635 #[inline(always)]
636 pub const fn variant(&self) -> Alertfr {
637 match self.bits {
638 false => Alertfr::NoAlert,
639 true => Alertfr::Alert,
640 }
641 }
642 #[doc = "No SMBALERT occured"]
643 #[inline(always)]
644 pub fn is_no_alert(&self) -> bool {
645 *self == Alertfr::NoAlert
646 }
647 #[doc = "SMBALERT occurred"]
648 #[inline(always)]
649 pub fn is_alert(&self) -> bool {
650 *self == Alertfr::Alert
651 }
652}
653#[doc = "SMBus alert\n\nValue on reset: 0"]
654#[derive(Clone, Copy, Debug, PartialEq, Eq)]
655pub enum AlertfwWO {
656 #[doc = "0: Clear flag"]
657 Clear = 0,
658}
659impl From<AlertfwWO> for bool {
660 #[inline(always)]
661 fn from(variant: AlertfwWO) -> Self {
662 variant as u8 != 0
663 }
664}
665#[doc = "Field `ALERTF` writer - SMBus alert"]
666pub type ALERTF_W<'a, REG> = crate::BitWriter0C<'a, REG, AlertfwWO>;
667impl<'a, REG> ALERTF_W<'a, REG>
668where
669 REG: crate::Writable + crate::RegisterSpec,
670{
671 #[doc = "Clear flag"]
672 #[inline(always)]
673 pub fn clear(self) -> &'a mut crate::W<REG> {
674 self.variant(AlertfwWO::Clear)
675 }
676}
677impl R {
678 #[doc = "Bit 0 - Start bit (Master mode)"]
679 #[inline(always)]
680 pub fn startf(&self) -> STARTF_R {
681 STARTF_R::new((self.bits & 1) != 0)
682 }
683 #[doc = "Bit 1 - Address sent (master mode)/matched (slave mode)"]
684 #[inline(always)]
685 pub fn addr7f(&self) -> ADDR7F_R {
686 ADDR7F_R::new(((self.bits >> 1) & 1) != 0)
687 }
688 #[doc = "Bit 2 - Transmit data complete"]
689 #[inline(always)]
690 pub fn tdc(&self) -> TDC_R {
691 TDC_R::new(((self.bits >> 2) & 1) != 0)
692 }
693 #[doc = "Bit 3 - address header match (Master mode)"]
694 #[inline(always)]
695 pub fn addrhf(&self) -> ADDRHF_R {
696 ADDRHF_R::new(((self.bits >> 3) & 1) != 0)
697 }
698 #[doc = "Bit 4 - Stop detection (slave mode)"]
699 #[inline(always)]
700 pub fn stopf(&self) -> STOPF_R {
701 STOPF_R::new(((self.bits >> 4) & 1) != 0)
702 }
703 #[doc = "Bit 6 - Receive data buffer full (receivers)"]
704 #[inline(always)]
705 pub fn rdbf(&self) -> RDBF_R {
706 RDBF_R::new(((self.bits >> 6) & 1) != 0)
707 }
708 #[doc = "Bit 7 - Transmit data buffer empty (transmitters)"]
709 #[inline(always)]
710 pub fn tdbe(&self) -> TDBE_R {
711 TDBE_R::new(((self.bits >> 7) & 1) != 0)
712 }
713 #[doc = "Bit 8 - Bus error"]
714 #[inline(always)]
715 pub fn buserr(&self) -> BUSERR_R {
716 BUSERR_R::new(((self.bits >> 8) & 1) != 0)
717 }
718 #[doc = "Bit 9 - Arbitration lost (master mode)"]
719 #[inline(always)]
720 pub fn arlost(&self) -> ARLOST_R {
721 ARLOST_R::new(((self.bits >> 9) & 1) != 0)
722 }
723 #[doc = "Bit 10 - Acknowledge failure"]
724 #[inline(always)]
725 pub fn ackfail(&self) -> ACKFAIL_R {
726 ACKFAIL_R::new(((self.bits >> 10) & 1) != 0)
727 }
728 #[doc = "Bit 11 - Overflow or underflow"]
729 #[inline(always)]
730 pub fn ouf(&self) -> OUF_R {
731 OUF_R::new(((self.bits >> 11) & 1) != 0)
732 }
733 #[doc = "Bit 12 - PEC receive error"]
734 #[inline(always)]
735 pub fn pecerr(&self) -> PECERR_R {
736 PECERR_R::new(((self.bits >> 12) & 1) != 0)
737 }
738 #[doc = "Bit 14 - Timeout error"]
739 #[inline(always)]
740 pub fn tmout(&self) -> TMOUT_R {
741 TMOUT_R::new(((self.bits >> 14) & 1) != 0)
742 }
743 #[doc = "Bit 15 - SMBus alert"]
744 #[inline(always)]
745 pub fn alertf(&self) -> ALERTF_R {
746 ALERTF_R::new(((self.bits >> 15) & 1) != 0)
747 }
748}
749impl core::fmt::Debug for R {
750 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
751 f.debug_struct("STS1")
752 .field("alertf", &self.alertf())
753 .field("tmout", &self.tmout())
754 .field("pecerr", &self.pecerr())
755 .field("ouf", &self.ouf())
756 .field("ackfail", &self.ackfail())
757 .field("arlost", &self.arlost())
758 .field("buserr", &self.buserr())
759 .field("tdbe", &self.tdbe())
760 .field("rdbf", &self.rdbf())
761 .field("stopf", &self.stopf())
762 .field("addrhf", &self.addrhf())
763 .field("tdc", &self.tdc())
764 .field("addr7f", &self.addr7f())
765 .field("startf", &self.startf())
766 .finish()
767 }
768}
769impl W {
770 #[doc = "Bit 8 - Bus error"]
771 #[inline(always)]
772 pub fn buserr(&mut self) -> BUSERR_W<'_, STS1_SPEC> {
773 BUSERR_W::new(self, 8)
774 }
775 #[doc = "Bit 9 - Arbitration lost (master mode)"]
776 #[inline(always)]
777 pub fn arlost(&mut self) -> ARLOST_W<'_, STS1_SPEC> {
778 ARLOST_W::new(self, 9)
779 }
780 #[doc = "Bit 10 - Acknowledge failure"]
781 #[inline(always)]
782 pub fn ackfail(&mut self) -> ACKFAIL_W<'_, STS1_SPEC> {
783 ACKFAIL_W::new(self, 10)
784 }
785 #[doc = "Bit 11 - Overflow or underflow"]
786 #[inline(always)]
787 pub fn ouf(&mut self) -> OUF_W<'_, STS1_SPEC> {
788 OUF_W::new(self, 11)
789 }
790 #[doc = "Bit 12 - PEC receive error"]
791 #[inline(always)]
792 pub fn pecerr(&mut self) -> PECERR_W<'_, STS1_SPEC> {
793 PECERR_W::new(self, 12)
794 }
795 #[doc = "Bit 14 - Timeout error"]
796 #[inline(always)]
797 pub fn tmout(&mut self) -> TMOUT_W<'_, STS1_SPEC> {
798 TMOUT_W::new(self, 14)
799 }
800 #[doc = "Bit 15 - SMBus alert"]
801 #[inline(always)]
802 pub fn alertf(&mut self) -> ALERTF_W<'_, STS1_SPEC> {
803 ALERTF_W::new(self, 15)
804 }
805}
806#[doc = "Status register 1\n\nYou can [`read`](crate::Reg::read) this register and get [`sts1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sts1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
807pub struct STS1_SPEC;
808impl crate::RegisterSpec for STS1_SPEC {
809 type Ux = u32;
810}
811#[doc = "`read()` method returns [`sts1::R`](R) reader structure"]
812impl crate::Readable for STS1_SPEC {}
813#[doc = "`write(|w| ..)` method takes [`sts1::W`](W) writer structure"]
814impl crate::Writable for STS1_SPEC {
815 type Safety = crate::Unsafe;
816 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0xdf00;
817}
818#[doc = "`reset()` method sets STS1 to value 0"]
819impl crate::Resettable for STS1_SPEC {}