atsams70j21/usart0/
us_linbrr.rs1#[doc = "Register `US_LINBRR` reader"]
2pub struct R(crate::R<US_LINBRR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<US_LINBRR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<US_LINBRR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<US_LINBRR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `LINCD` reader - Clock Divider after Synchronization"]
17pub struct LINCD_R(crate::FieldReader<u16, u16>);
18impl LINCD_R {
19 #[inline(always)]
20 pub(crate) fn new(bits: u16) -> Self {
21 LINCD_R(crate::FieldReader::new(bits))
22 }
23}
24impl core::ops::Deref for LINCD_R {
25 type Target = crate::FieldReader<u16, u16>;
26 #[inline(always)]
27 fn deref(&self) -> &Self::Target {
28 &self.0
29 }
30}
31#[doc = "Field `LINFP` reader - Fractional Part after Synchronization"]
32pub struct LINFP_R(crate::FieldReader<u8, u8>);
33impl LINFP_R {
34 #[inline(always)]
35 pub(crate) fn new(bits: u8) -> Self {
36 LINFP_R(crate::FieldReader::new(bits))
37 }
38}
39impl core::ops::Deref for LINFP_R {
40 type Target = crate::FieldReader<u8, u8>;
41 #[inline(always)]
42 fn deref(&self) -> &Self::Target {
43 &self.0
44 }
45}
46impl R {
47 #[doc = "Bits 0:15 - Clock Divider after Synchronization"]
48 #[inline(always)]
49 pub fn lincd(&self) -> LINCD_R {
50 LINCD_R::new((self.bits & 0xffff) as u16)
51 }
52 #[doc = "Bits 16:18 - Fractional Part after Synchronization"]
53 #[inline(always)]
54 pub fn linfp(&self) -> LINFP_R {
55 LINFP_R::new(((self.bits >> 16) & 0x07) as u8)
56 }
57}
58#[doc = "LIN Baud Rate Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [us_linbrr](index.html) module"]
59pub struct US_LINBRR_SPEC;
60impl crate::RegisterSpec for US_LINBRR_SPEC {
61 type Ux = u32;
62}
63#[doc = "`read()` method returns [us_linbrr::R](R) reader structure"]
64impl crate::Readable for US_LINBRR_SPEC {
65 type Reader = R;
66}
67#[doc = "`reset()` method sets US_LINBRR to value 0"]
68impl crate::Resettable for US_LINBRR_SPEC {
69 #[inline(always)]
70 fn reset_value() -> Self::Ux {
71 0
72 }
73}