stm32f1_staging/stm32f107/i2c1/
sr1.rs

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