atsamd11c/sercom0/i2cm/
baud.rs

1#[doc = "Register `BAUD` reader"]
2pub type R = crate::R<BaudSpec>;
3#[doc = "Register `BAUD` writer"]
4pub type W = crate::W<BaudSpec>;
5#[doc = "Field `BAUD` reader - Baud Rate Value"]
6pub type BaudR = crate::FieldReader;
7#[doc = "Field `BAUD` writer - Baud Rate Value"]
8pub type BaudW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `BAUDLOW` reader - Baud Rate Value Low"]
10pub type BaudlowR = crate::FieldReader;
11#[doc = "Field `BAUDLOW` writer - Baud Rate Value Low"]
12pub type BaudlowW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `HSBAUD` reader - High Speed Baud Rate Value"]
14pub type HsbaudR = crate::FieldReader;
15#[doc = "Field `HSBAUD` writer - High Speed Baud Rate Value"]
16pub type HsbaudW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17#[doc = "Field `HSBAUDLOW` reader - High Speed Baud Rate Value Low"]
18pub type HsbaudlowR = crate::FieldReader;
19#[doc = "Field `HSBAUDLOW` writer - High Speed Baud Rate Value Low"]
20pub type HsbaudlowW<'a, REG> = crate::FieldWriter<'a, REG, 8>;
21impl R {
22    #[doc = "Bits 0:7 - Baud Rate Value"]
23    #[inline(always)]
24    pub fn baud(&self) -> BaudR {
25        BaudR::new((self.bits & 0xff) as u8)
26    }
27    #[doc = "Bits 8:15 - Baud Rate Value Low"]
28    #[inline(always)]
29    pub fn baudlow(&self) -> BaudlowR {
30        BaudlowR::new(((self.bits >> 8) & 0xff) as u8)
31    }
32    #[doc = "Bits 16:23 - High Speed Baud Rate Value"]
33    #[inline(always)]
34    pub fn hsbaud(&self) -> HsbaudR {
35        HsbaudR::new(((self.bits >> 16) & 0xff) as u8)
36    }
37    #[doc = "Bits 24:31 - High Speed Baud Rate Value Low"]
38    #[inline(always)]
39    pub fn hsbaudlow(&self) -> HsbaudlowR {
40        HsbaudlowR::new(((self.bits >> 24) & 0xff) as u8)
41    }
42}
43impl W {
44    #[doc = "Bits 0:7 - Baud Rate Value"]
45    #[inline(always)]
46    #[must_use]
47    pub fn baud(&mut self) -> BaudW<BaudSpec> {
48        BaudW::new(self, 0)
49    }
50    #[doc = "Bits 8:15 - Baud Rate Value Low"]
51    #[inline(always)]
52    #[must_use]
53    pub fn baudlow(&mut self) -> BaudlowW<BaudSpec> {
54        BaudlowW::new(self, 8)
55    }
56    #[doc = "Bits 16:23 - High Speed Baud Rate Value"]
57    #[inline(always)]
58    #[must_use]
59    pub fn hsbaud(&mut self) -> HsbaudW<BaudSpec> {
60        HsbaudW::new(self, 16)
61    }
62    #[doc = "Bits 24:31 - High Speed Baud Rate Value Low"]
63    #[inline(always)]
64    #[must_use]
65    pub fn hsbaudlow(&mut self) -> HsbaudlowW<BaudSpec> {
66        HsbaudlowW::new(self, 24)
67    }
68}
69#[doc = "I2CM Baud Rate\n\nYou can [`read`](crate::Reg::read) this register and get [`baud::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`baud::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct BaudSpec;
71impl crate::RegisterSpec for BaudSpec {
72    type Ux = u32;
73}
74#[doc = "`read()` method returns [`baud::R`](R) reader structure"]
75impl crate::Readable for BaudSpec {}
76#[doc = "`write(|w| ..)` method takes [`baud::W`](W) writer structure"]
77impl crate::Writable for BaudSpec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81}
82#[doc = "`reset()` method sets BAUD to value 0"]
83impl crate::Resettable for BaudSpec {
84    const RESET_VALUE: u32 = 0;
85}