stm32f4_staging/stm32f413/fmpi2c1/
cr2.rs

1///Register `CR2` reader
2pub type R = crate::R<CR2rs>;
3///Register `CR2` writer
4pub type W = crate::W<CR2rs>;
5///Field `SADD` reader - Slave address bit 0
6pub type SADD_R = crate::FieldReader<u16>;
7///Field `SADD` writer - Slave address bit 0
8pub type SADD_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16, crate::Safe>;
9/**Transfer direction
10
11Value on reset: 0*/
12#[cfg_attr(feature = "defmt", derive(defmt::Format))]
13#[derive(Clone, Copy, Debug, PartialEq, Eq)]
14pub enum RD_WRN {
15    ///0: Master requests a write transfer
16    Write = 0,
17    ///1: Master requests a read transfer
18    Read = 1,
19}
20impl From<RD_WRN> for bool {
21    #[inline(always)]
22    fn from(variant: RD_WRN) -> Self {
23        variant as u8 != 0
24    }
25}
26///Field `RD_WRN` reader - Transfer direction
27pub type RD_WRN_R = crate::BitReader<RD_WRN>;
28impl RD_WRN_R {
29    ///Get enumerated values variant
30    #[inline(always)]
31    pub const fn variant(&self) -> RD_WRN {
32        match self.bits {
33            false => RD_WRN::Write,
34            true => RD_WRN::Read,
35        }
36    }
37    ///Master requests a write transfer
38    #[inline(always)]
39    pub fn is_write(&self) -> bool {
40        *self == RD_WRN::Write
41    }
42    ///Master requests a read transfer
43    #[inline(always)]
44    pub fn is_read(&self) -> bool {
45        *self == RD_WRN::Read
46    }
47}
48///Field `RD_WRN` writer - Transfer direction
49pub type RD_WRN_W<'a, REG> = crate::BitWriter<'a, REG, RD_WRN>;
50impl<'a, REG> RD_WRN_W<'a, REG>
51where
52    REG: crate::Writable + crate::RegisterSpec,
53{
54    ///Master requests a write transfer
55    #[inline(always)]
56    pub fn write(self) -> &'a mut crate::W<REG> {
57        self.variant(RD_WRN::Write)
58    }
59    ///Master requests a read transfer
60    #[inline(always)]
61    pub fn read(self) -> &'a mut crate::W<REG> {
62        self.variant(RD_WRN::Read)
63    }
64}
65/**10-bit addressing mode
66
67Value on reset: 0*/
68#[cfg_attr(feature = "defmt", derive(defmt::Format))]
69#[derive(Clone, Copy, Debug, PartialEq, Eq)]
70pub enum ADD10 {
71    ///0: The master operates in 7-bit addressing mode
72    Bit7 = 0,
73    ///1: The master operates in 10-bit addressing mode
74    Bit10 = 1,
75}
76impl From<ADD10> for bool {
77    #[inline(always)]
78    fn from(variant: ADD10) -> Self {
79        variant as u8 != 0
80    }
81}
82///Field `ADD10` reader - 10-bit addressing mode
83pub type ADD10_R = crate::BitReader<ADD10>;
84impl ADD10_R {
85    ///Get enumerated values variant
86    #[inline(always)]
87    pub const fn variant(&self) -> ADD10 {
88        match self.bits {
89            false => ADD10::Bit7,
90            true => ADD10::Bit10,
91        }
92    }
93    ///The master operates in 7-bit addressing mode
94    #[inline(always)]
95    pub fn is_bit7(&self) -> bool {
96        *self == ADD10::Bit7
97    }
98    ///The master operates in 10-bit addressing mode
99    #[inline(always)]
100    pub fn is_bit10(&self) -> bool {
101        *self == ADD10::Bit10
102    }
103}
104///Field `ADD10` writer - 10-bit addressing mode
105pub type ADD10_W<'a, REG> = crate::BitWriter<'a, REG, ADD10>;
106impl<'a, REG> ADD10_W<'a, REG>
107where
108    REG: crate::Writable + crate::RegisterSpec,
109{
110    ///The master operates in 7-bit addressing mode
111    #[inline(always)]
112    pub fn bit7(self) -> &'a mut crate::W<REG> {
113        self.variant(ADD10::Bit7)
114    }
115    ///The master operates in 10-bit addressing mode
116    #[inline(always)]
117    pub fn bit10(self) -> &'a mut crate::W<REG> {
118        self.variant(ADD10::Bit10)
119    }
120}
121/**10-bit address header only read direction
122
123Value on reset: 0*/
124#[cfg_attr(feature = "defmt", derive(defmt::Format))]
125#[derive(Clone, Copy, Debug, PartialEq, Eq)]
126pub enum HEAD10R {
127    ///0: The master sends the complete 10 bit slave address read sequence
128    Complete = 0,
129    ///1: The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction
130    Partial = 1,
131}
132impl From<HEAD10R> for bool {
133    #[inline(always)]
134    fn from(variant: HEAD10R) -> Self {
135        variant as u8 != 0
136    }
137}
138///Field `HEAD10R` reader - 10-bit address header only read direction
139pub type HEAD10R_R = crate::BitReader<HEAD10R>;
140impl HEAD10R_R {
141    ///Get enumerated values variant
142    #[inline(always)]
143    pub const fn variant(&self) -> HEAD10R {
144        match self.bits {
145            false => HEAD10R::Complete,
146            true => HEAD10R::Partial,
147        }
148    }
149    ///The master sends the complete 10 bit slave address read sequence
150    #[inline(always)]
151    pub fn is_complete(&self) -> bool {
152        *self == HEAD10R::Complete
153    }
154    ///The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction
155    #[inline(always)]
156    pub fn is_partial(&self) -> bool {
157        *self == HEAD10R::Partial
158    }
159}
160///Field `HEAD10R` writer - 10-bit address header only read direction
161pub type HEAD10R_W<'a, REG> = crate::BitWriter<'a, REG, HEAD10R>;
162impl<'a, REG> HEAD10R_W<'a, REG>
163where
164    REG: crate::Writable + crate::RegisterSpec,
165{
166    ///The master sends the complete 10 bit slave address read sequence
167    #[inline(always)]
168    pub fn complete(self) -> &'a mut crate::W<REG> {
169        self.variant(HEAD10R::Complete)
170    }
171    ///The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction
172    #[inline(always)]
173    pub fn partial(self) -> &'a mut crate::W<REG> {
174        self.variant(HEAD10R::Partial)
175    }
176}
177/**Start generation
178
179Value on reset: 0*/
180#[cfg_attr(feature = "defmt", derive(defmt::Format))]
181#[derive(Clone, Copy, Debug, PartialEq, Eq)]
182pub enum STARTR {
183    ///0: No Start generation
184    NoStart = 0,
185    ///1: Restart/Start generation
186    Start = 1,
187}
188impl From<STARTR> for bool {
189    #[inline(always)]
190    fn from(variant: STARTR) -> Self {
191        variant as u8 != 0
192    }
193}
194///Field `START` reader - Start generation
195pub type START_R = crate::BitReader<STARTR>;
196impl START_R {
197    ///Get enumerated values variant
198    #[inline(always)]
199    pub const fn variant(&self) -> STARTR {
200        match self.bits {
201            false => STARTR::NoStart,
202            true => STARTR::Start,
203        }
204    }
205    ///No Start generation
206    #[inline(always)]
207    pub fn is_no_start(&self) -> bool {
208        *self == STARTR::NoStart
209    }
210    ///Restart/Start generation
211    #[inline(always)]
212    pub fn is_start(&self) -> bool {
213        *self == STARTR::Start
214    }
215}
216/**Start generation
217
218Value on reset: 0*/
219#[cfg_attr(feature = "defmt", derive(defmt::Format))]
220#[derive(Clone, Copy, Debug, PartialEq, Eq)]
221pub enum STARTW {
222    ///1: Restart/Start generation
223    Start = 1,
224}
225impl From<STARTW> for bool {
226    #[inline(always)]
227    fn from(variant: STARTW) -> Self {
228        variant as u8 != 0
229    }
230}
231///Field `START` writer - Start generation
232pub type START_W<'a, REG> = crate::BitWriter1S<'a, REG, STARTW>;
233impl<'a, REG> START_W<'a, REG>
234where
235    REG: crate::Writable + crate::RegisterSpec,
236{
237    ///Restart/Start generation
238    #[inline(always)]
239    pub fn start(self) -> &'a mut crate::W<REG> {
240        self.variant(STARTW::Start)
241    }
242}
243/**Stop generation
244
245Value on reset: 0*/
246#[cfg_attr(feature = "defmt", derive(defmt::Format))]
247#[derive(Clone, Copy, Debug, PartialEq, Eq)]
248pub enum STOPR {
249    ///0: No Stop generation
250    NoStop = 0,
251    ///1: Stop generation after current byte transfer
252    Stop = 1,
253}
254impl From<STOPR> for bool {
255    #[inline(always)]
256    fn from(variant: STOPR) -> Self {
257        variant as u8 != 0
258    }
259}
260///Field `STOP` reader - Stop generation
261pub type STOP_R = crate::BitReader<STOPR>;
262impl STOP_R {
263    ///Get enumerated values variant
264    #[inline(always)]
265    pub const fn variant(&self) -> STOPR {
266        match self.bits {
267            false => STOPR::NoStop,
268            true => STOPR::Stop,
269        }
270    }
271    ///No Stop generation
272    #[inline(always)]
273    pub fn is_no_stop(&self) -> bool {
274        *self == STOPR::NoStop
275    }
276    ///Stop generation after current byte transfer
277    #[inline(always)]
278    pub fn is_stop(&self) -> bool {
279        *self == STOPR::Stop
280    }
281}
282/**Stop generation
283
284Value on reset: 0*/
285#[cfg_attr(feature = "defmt", derive(defmt::Format))]
286#[derive(Clone, Copy, Debug, PartialEq, Eq)]
287pub enum STOPW {
288    ///1: Stop generation after current byte transfer
289    Stop = 1,
290}
291impl From<STOPW> for bool {
292    #[inline(always)]
293    fn from(variant: STOPW) -> Self {
294        variant as u8 != 0
295    }
296}
297///Field `STOP` writer - Stop generation
298pub type STOP_W<'a, REG> = crate::BitWriter1S<'a, REG, STOPW>;
299impl<'a, REG> STOP_W<'a, REG>
300where
301    REG: crate::Writable + crate::RegisterSpec,
302{
303    ///Stop generation after current byte transfer
304    #[inline(always)]
305    pub fn stop(self) -> &'a mut crate::W<REG> {
306        self.variant(STOPW::Stop)
307    }
308}
309/**NACK generation
310
311Value on reset: 0*/
312#[cfg_attr(feature = "defmt", derive(defmt::Format))]
313#[derive(Clone, Copy, Debug, PartialEq, Eq)]
314pub enum NACKR {
315    ///0: an ACK is sent after current received byte
316    Ack = 0,
317    ///1: a NACK is sent after current received byte
318    Nack = 1,
319}
320impl From<NACKR> for bool {
321    #[inline(always)]
322    fn from(variant: NACKR) -> Self {
323        variant as u8 != 0
324    }
325}
326///Field `NACK` reader - NACK generation
327pub type NACK_R = crate::BitReader<NACKR>;
328impl NACK_R {
329    ///Get enumerated values variant
330    #[inline(always)]
331    pub const fn variant(&self) -> NACKR {
332        match self.bits {
333            false => NACKR::Ack,
334            true => NACKR::Nack,
335        }
336    }
337    ///an ACK is sent after current received byte
338    #[inline(always)]
339    pub fn is_ack(&self) -> bool {
340        *self == NACKR::Ack
341    }
342    ///a NACK is sent after current received byte
343    #[inline(always)]
344    pub fn is_nack(&self) -> bool {
345        *self == NACKR::Nack
346    }
347}
348/**NACK generation
349
350Value on reset: 0*/
351#[cfg_attr(feature = "defmt", derive(defmt::Format))]
352#[derive(Clone, Copy, Debug, PartialEq, Eq)]
353pub enum NACKW {
354    ///1: a NACK is sent after current received byte
355    Nack = 1,
356}
357impl From<NACKW> for bool {
358    #[inline(always)]
359    fn from(variant: NACKW) -> Self {
360        variant as u8 != 0
361    }
362}
363///Field `NACK` writer - NACK generation
364pub type NACK_W<'a, REG> = crate::BitWriter1S<'a, REG, NACKW>;
365impl<'a, REG> NACK_W<'a, REG>
366where
367    REG: crate::Writable + crate::RegisterSpec,
368{
369    ///a NACK is sent after current received byte
370    #[inline(always)]
371    pub fn nack(self) -> &'a mut crate::W<REG> {
372        self.variant(NACKW::Nack)
373    }
374}
375///Field `NBYTES` reader - Number of bytes
376pub type NBYTES_R = crate::FieldReader;
377///Field `NBYTES` writer - Number of bytes
378pub type NBYTES_W<'a, REG> = crate::FieldWriter<'a, REG, 8, u8, crate::Safe>;
379/**NBYTES reload mode
380
381Value on reset: 0*/
382#[cfg_attr(feature = "defmt", derive(defmt::Format))]
383#[derive(Clone, Copy, Debug, PartialEq, Eq)]
384pub enum RELOAD {
385    ///0: The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)
386    Completed = 0,
387    ///1: The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)
388    NotCompleted = 1,
389}
390impl From<RELOAD> for bool {
391    #[inline(always)]
392    fn from(variant: RELOAD) -> Self {
393        variant as u8 != 0
394    }
395}
396///Field `RELOAD` reader - NBYTES reload mode
397pub type RELOAD_R = crate::BitReader<RELOAD>;
398impl RELOAD_R {
399    ///Get enumerated values variant
400    #[inline(always)]
401    pub const fn variant(&self) -> RELOAD {
402        match self.bits {
403            false => RELOAD::Completed,
404            true => RELOAD::NotCompleted,
405        }
406    }
407    ///The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)
408    #[inline(always)]
409    pub fn is_completed(&self) -> bool {
410        *self == RELOAD::Completed
411    }
412    ///The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)
413    #[inline(always)]
414    pub fn is_not_completed(&self) -> bool {
415        *self == RELOAD::NotCompleted
416    }
417}
418///Field `RELOAD` writer - NBYTES reload mode
419pub type RELOAD_W<'a, REG> = crate::BitWriter<'a, REG, RELOAD>;
420impl<'a, REG> RELOAD_W<'a, REG>
421where
422    REG: crate::Writable + crate::RegisterSpec,
423{
424    ///The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)
425    #[inline(always)]
426    pub fn completed(self) -> &'a mut crate::W<REG> {
427        self.variant(RELOAD::Completed)
428    }
429    ///The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)
430    #[inline(always)]
431    pub fn not_completed(self) -> &'a mut crate::W<REG> {
432        self.variant(RELOAD::NotCompleted)
433    }
434}
435/**Automatic end mode
436
437Value on reset: 0*/
438#[cfg_attr(feature = "defmt", derive(defmt::Format))]
439#[derive(Clone, Copy, Debug, PartialEq, Eq)]
440pub enum AUTOEND {
441    ///0: Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low
442    Software = 0,
443    ///1: Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred
444    Automatic = 1,
445}
446impl From<AUTOEND> for bool {
447    #[inline(always)]
448    fn from(variant: AUTOEND) -> Self {
449        variant as u8 != 0
450    }
451}
452///Field `AUTOEND` reader - Automatic end mode
453pub type AUTOEND_R = crate::BitReader<AUTOEND>;
454impl AUTOEND_R {
455    ///Get enumerated values variant
456    #[inline(always)]
457    pub const fn variant(&self) -> AUTOEND {
458        match self.bits {
459            false => AUTOEND::Software,
460            true => AUTOEND::Automatic,
461        }
462    }
463    ///Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low
464    #[inline(always)]
465    pub fn is_software(&self) -> bool {
466        *self == AUTOEND::Software
467    }
468    ///Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred
469    #[inline(always)]
470    pub fn is_automatic(&self) -> bool {
471        *self == AUTOEND::Automatic
472    }
473}
474///Field `AUTOEND` writer - Automatic end mode
475pub type AUTOEND_W<'a, REG> = crate::BitWriter<'a, REG, AUTOEND>;
476impl<'a, REG> AUTOEND_W<'a, REG>
477where
478    REG: crate::Writable + crate::RegisterSpec,
479{
480    ///Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low
481    #[inline(always)]
482    pub fn software(self) -> &'a mut crate::W<REG> {
483        self.variant(AUTOEND::Software)
484    }
485    ///Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred
486    #[inline(always)]
487    pub fn automatic(self) -> &'a mut crate::W<REG> {
488        self.variant(AUTOEND::Automatic)
489    }
490}
491/**Packet error checking byte
492
493Value on reset: 0*/
494#[cfg_attr(feature = "defmt", derive(defmt::Format))]
495#[derive(Clone, Copy, Debug, PartialEq, Eq)]
496pub enum PECBYTER {
497    ///0: No PEC transfer
498    NoPec = 0,
499    ///1: PEC transmission/reception is requested
500    Pec = 1,
501}
502impl From<PECBYTER> for bool {
503    #[inline(always)]
504    fn from(variant: PECBYTER) -> Self {
505        variant as u8 != 0
506    }
507}
508///Field `PECBYTE` reader - Packet error checking byte
509pub type PECBYTE_R = crate::BitReader<PECBYTER>;
510impl PECBYTE_R {
511    ///Get enumerated values variant
512    #[inline(always)]
513    pub const fn variant(&self) -> PECBYTER {
514        match self.bits {
515            false => PECBYTER::NoPec,
516            true => PECBYTER::Pec,
517        }
518    }
519    ///No PEC transfer
520    #[inline(always)]
521    pub fn is_no_pec(&self) -> bool {
522        *self == PECBYTER::NoPec
523    }
524    ///PEC transmission/reception is requested
525    #[inline(always)]
526    pub fn is_pec(&self) -> bool {
527        *self == PECBYTER::Pec
528    }
529}
530/**Packet error checking byte
531
532Value on reset: 0*/
533#[cfg_attr(feature = "defmt", derive(defmt::Format))]
534#[derive(Clone, Copy, Debug, PartialEq, Eq)]
535pub enum PECBYTEW {
536    ///1: PEC transmission/reception is requested
537    Pec = 1,
538}
539impl From<PECBYTEW> for bool {
540    #[inline(always)]
541    fn from(variant: PECBYTEW) -> Self {
542        variant as u8 != 0
543    }
544}
545///Field `PECBYTE` writer - Packet error checking byte
546pub type PECBYTE_W<'a, REG> = crate::BitWriter1S<'a, REG, PECBYTEW>;
547impl<'a, REG> PECBYTE_W<'a, REG>
548where
549    REG: crate::Writable + crate::RegisterSpec,
550{
551    ///PEC transmission/reception is requested
552    #[inline(always)]
553    pub fn pec(self) -> &'a mut crate::W<REG> {
554        self.variant(PECBYTEW::Pec)
555    }
556}
557impl R {
558    ///Bits 0:9 - Slave address bit 0
559    #[inline(always)]
560    pub fn sadd(&self) -> SADD_R {
561        SADD_R::new((self.bits & 0x03ff) as u16)
562    }
563    ///Bit 10 - Transfer direction
564    #[inline(always)]
565    pub fn rd_wrn(&self) -> RD_WRN_R {
566        RD_WRN_R::new(((self.bits >> 10) & 1) != 0)
567    }
568    ///Bit 11 - 10-bit addressing mode
569    #[inline(always)]
570    pub fn add10(&self) -> ADD10_R {
571        ADD10_R::new(((self.bits >> 11) & 1) != 0)
572    }
573    ///Bit 12 - 10-bit address header only read direction
574    #[inline(always)]
575    pub fn head10r(&self) -> HEAD10R_R {
576        HEAD10R_R::new(((self.bits >> 12) & 1) != 0)
577    }
578    ///Bit 13 - Start generation
579    #[inline(always)]
580    pub fn start(&self) -> START_R {
581        START_R::new(((self.bits >> 13) & 1) != 0)
582    }
583    ///Bit 14 - Stop generation
584    #[inline(always)]
585    pub fn stop(&self) -> STOP_R {
586        STOP_R::new(((self.bits >> 14) & 1) != 0)
587    }
588    ///Bit 15 - NACK generation
589    #[inline(always)]
590    pub fn nack(&self) -> NACK_R {
591        NACK_R::new(((self.bits >> 15) & 1) != 0)
592    }
593    ///Bits 16:23 - Number of bytes
594    #[inline(always)]
595    pub fn nbytes(&self) -> NBYTES_R {
596        NBYTES_R::new(((self.bits >> 16) & 0xff) as u8)
597    }
598    ///Bit 24 - NBYTES reload mode
599    #[inline(always)]
600    pub fn reload(&self) -> RELOAD_R {
601        RELOAD_R::new(((self.bits >> 24) & 1) != 0)
602    }
603    ///Bit 25 - Automatic end mode
604    #[inline(always)]
605    pub fn autoend(&self) -> AUTOEND_R {
606        AUTOEND_R::new(((self.bits >> 25) & 1) != 0)
607    }
608    ///Bit 26 - Packet error checking byte
609    #[inline(always)]
610    pub fn pecbyte(&self) -> PECBYTE_R {
611        PECBYTE_R::new(((self.bits >> 26) & 1) != 0)
612    }
613}
614impl core::fmt::Debug for R {
615    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
616        f.debug_struct("CR2")
617            .field("sadd", &self.sadd())
618            .field("rd_wrn", &self.rd_wrn())
619            .field("add10", &self.add10())
620            .field("head10r", &self.head10r())
621            .field("start", &self.start())
622            .field("stop", &self.stop())
623            .field("nack", &self.nack())
624            .field("nbytes", &self.nbytes())
625            .field("reload", &self.reload())
626            .field("autoend", &self.autoend())
627            .field("pecbyte", &self.pecbyte())
628            .finish()
629    }
630}
631impl W {
632    ///Bits 0:9 - Slave address bit 0
633    #[inline(always)]
634    pub fn sadd(&mut self) -> SADD_W<CR2rs> {
635        SADD_W::new(self, 0)
636    }
637    ///Bit 10 - Transfer direction
638    #[inline(always)]
639    pub fn rd_wrn(&mut self) -> RD_WRN_W<CR2rs> {
640        RD_WRN_W::new(self, 10)
641    }
642    ///Bit 11 - 10-bit addressing mode
643    #[inline(always)]
644    pub fn add10(&mut self) -> ADD10_W<CR2rs> {
645        ADD10_W::new(self, 11)
646    }
647    ///Bit 12 - 10-bit address header only read direction
648    #[inline(always)]
649    pub fn head10r(&mut self) -> HEAD10R_W<CR2rs> {
650        HEAD10R_W::new(self, 12)
651    }
652    ///Bit 13 - Start generation
653    #[inline(always)]
654    pub fn start(&mut self) -> START_W<CR2rs> {
655        START_W::new(self, 13)
656    }
657    ///Bit 14 - Stop generation
658    #[inline(always)]
659    pub fn stop(&mut self) -> STOP_W<CR2rs> {
660        STOP_W::new(self, 14)
661    }
662    ///Bit 15 - NACK generation
663    #[inline(always)]
664    pub fn nack(&mut self) -> NACK_W<CR2rs> {
665        NACK_W::new(self, 15)
666    }
667    ///Bits 16:23 - Number of bytes
668    #[inline(always)]
669    pub fn nbytes(&mut self) -> NBYTES_W<CR2rs> {
670        NBYTES_W::new(self, 16)
671    }
672    ///Bit 24 - NBYTES reload mode
673    #[inline(always)]
674    pub fn reload(&mut self) -> RELOAD_W<CR2rs> {
675        RELOAD_W::new(self, 24)
676    }
677    ///Bit 25 - Automatic end mode
678    #[inline(always)]
679    pub fn autoend(&mut self) -> AUTOEND_W<CR2rs> {
680        AUTOEND_W::new(self, 25)
681    }
682    ///Bit 26 - Packet error checking byte
683    #[inline(always)]
684    pub fn pecbyte(&mut self) -> PECBYTE_W<CR2rs> {
685        PECBYTE_W::new(self, 26)
686    }
687}
688/**Control register 2
689
690You can [`read`](crate::Reg::read) this register and get [`cr2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
691
692See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F413.html#FMPI2C1:CR2)*/
693pub struct CR2rs;
694impl crate::RegisterSpec for CR2rs {
695    type Ux = u32;
696}
697///`read()` method returns [`cr2::R`](R) reader structure
698impl crate::Readable for CR2rs {}
699///`write(|w| ..)` method takes [`cr2::W`](W) writer structure
700impl crate::Writable for CR2rs {
701    type Safety = crate::Unsafe;
702    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x0400_e000;
703}
704///`reset()` method sets CR2 to value 0
705impl crate::Resettable for CR2rs {}