atsamd11d/sercom0/usart/
baud_frac_mode.rs
1#[doc = "Register `BAUD_FRAC_MODE` reader"]
2pub type R = crate::R<BaudFracModeSpec>;
3#[doc = "Register `BAUD_FRAC_MODE` writer"]
4pub type W = crate::W<BaudFracModeSpec>;
5#[doc = "Field `BAUD` reader - Baud Rate Value"]
6pub type BaudR = crate::FieldReader<u16>;
7#[doc = "Field `BAUD` writer - Baud Rate Value"]
8pub type BaudW<'a, REG> = crate::FieldWriter<'a, REG, 13, u16>;
9#[doc = "Field `FP` reader - Fractional Part"]
10pub type FpR = crate::FieldReader;
11#[doc = "Field `FP` writer - Fractional Part"]
12pub type FpW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13impl R {
14 #[doc = "Bits 0:12 - Baud Rate Value"]
15 #[inline(always)]
16 pub fn baud(&self) -> BaudR {
17 BaudR::new(self.bits & 0x1fff)
18 }
19 #[doc = "Bits 13:15 - Fractional Part"]
20 #[inline(always)]
21 pub fn fp(&self) -> FpR {
22 FpR::new(((self.bits >> 13) & 7) as u8)
23 }
24}
25impl W {
26 #[doc = "Bits 0:12 - Baud Rate Value"]
27 #[inline(always)]
28 #[must_use]
29 pub fn baud(&mut self) -> BaudW<BaudFracModeSpec> {
30 BaudW::new(self, 0)
31 }
32 #[doc = "Bits 13:15 - Fractional Part"]
33 #[inline(always)]
34 #[must_use]
35 pub fn fp(&mut self) -> FpW<BaudFracModeSpec> {
36 FpW::new(self, 13)
37 }
38}
39#[doc = "USART Baud Rate\n\nYou can [`read`](crate::Reg::read) this register and get [`baud_frac_mode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`baud_frac_mode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct BaudFracModeSpec;
41impl crate::RegisterSpec for BaudFracModeSpec {
42 type Ux = u16;
43}
44#[doc = "`read()` method returns [`baud_frac_mode::R`](R) reader structure"]
45impl crate::Readable for BaudFracModeSpec {}
46#[doc = "`write(|w| ..)` method takes [`baud_frac_mode::W`](W) writer structure"]
47impl crate::Writable for BaudFracModeSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
51}
52#[doc = "`reset()` method sets BAUD_FRAC_MODE to value 0"]
53impl crate::Resettable for BaudFracModeSpec {
54 const RESET_VALUE: u16 = 0;
55}