stm32f1_staging/stm32f101/usart1/
brr.rs1pub type R = crate::R<BRRrs>;
3pub type W = crate::W<BRRrs>;
5pub type DIV_FRACTION_R = crate::FieldReader;
7pub type DIV_FRACTION_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
9pub type DIV_MANTISSA_R = crate::FieldReader<u16>;
11pub type DIV_MANTISSA_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
13impl R {
14 #[inline(always)]
16 pub fn div_fraction(&self) -> DIV_FRACTION_R {
17 DIV_FRACTION_R::new((self.bits & 0x0f) as u8)
18 }
19 #[inline(always)]
21 pub fn div_mantissa(&self) -> DIV_MANTISSA_R {
22 DIV_MANTISSA_R::new((self.bits >> 4) & 0x0fff)
23 }
24}
25impl core::fmt::Debug for R {
26 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27 f.debug_struct("BRR")
28 .field("div_mantissa", &self.div_mantissa())
29 .field("div_fraction", &self.div_fraction())
30 .finish()
31 }
32}
33impl W {
34 #[inline(always)]
36 pub fn div_fraction(&mut self) -> DIV_FRACTION_W<BRRrs> {
37 DIV_FRACTION_W::new(self, 0)
38 }
39 #[inline(always)]
41 pub fn div_mantissa(&mut self) -> DIV_MANTISSA_W<BRRrs> {
42 DIV_MANTISSA_W::new(self, 4)
43 }
44}
45pub struct BRRrs;
51impl crate::RegisterSpec for BRRrs {
52 type Ux = u16;
53}
54impl crate::Readable for BRRrs {}
56impl crate::Writable for BRRrs {
58 type Safety = crate::Unsafe;
59}
60impl crate::Resettable for BRRrs {}