py32f0/py32f040/usart1/
brr.rs1pub struct R(crate::R<BRR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<BRR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<BRR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<BRR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<BRR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<BRR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<BRR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<BRR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type DIV_FRACTION_R = crate::FieldReader<u8, u8>;
39pub type DIV_FRACTION_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, BRR_SPEC, u8, u8, 4, O>;
41pub type DIV_MANTISSA_R = crate::FieldReader<u16, u16>;
43pub type DIV_MANTISSA_W<'a, const O: u8> =
45 crate::FieldWriterSafe<'a, u32, BRR_SPEC, u16, u16, 12, O>;
46impl R {
47 #[inline(always)]
49 pub fn div_fraction(&self) -> DIV_FRACTION_R {
50 DIV_FRACTION_R::new((self.bits & 0x0f) as u8)
51 }
52 #[inline(always)]
54 pub fn div_mantissa(&self) -> DIV_MANTISSA_R {
55 DIV_MANTISSA_R::new(((self.bits >> 4) & 0x0fff) as u16)
56 }
57}
58impl W {
59 #[inline(always)]
61 #[must_use]
62 pub fn div_fraction(&mut self) -> DIV_FRACTION_W<0> {
63 DIV_FRACTION_W::new(self)
64 }
65 #[inline(always)]
67 #[must_use]
68 pub fn div_mantissa(&mut self) -> DIV_MANTISSA_W<4> {
69 DIV_MANTISSA_W::new(self)
70 }
71 #[inline(always)]
73 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
74 self.0.bits(bits);
75 self
76 }
77}
78pub struct BRR_SPEC;
84impl crate::RegisterSpec for BRR_SPEC {
85 type Ux = u32;
86}
87impl crate::Readable for BRR_SPEC {
89 type Reader = R;
90}
91impl crate::Writable for BRR_SPEC {
93 type Writer = W;
94 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
95 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
96}
97impl crate::Resettable for BRR_SPEC {
99 const RESET_VALUE: Self::Ux = 0;
100}