stm32f1_staging/stm32f103/uart4/
brr.rspub type R = crate::R<BRRrs>;
pub type W = crate::W<BRRrs>;
pub type DIV_FRACTION_R = crate::FieldReader;
pub type DIV_FRACTION_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type DIV_MANTISSA_R = crate::FieldReader<u16>;
pub type DIV_MANTISSA_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16, crate::Safe>;
impl R {
#[inline(always)]
pub fn div_fraction(&self) -> DIV_FRACTION_R {
DIV_FRACTION_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn div_mantissa(&self) -> DIV_MANTISSA_R {
DIV_MANTISSA_R::new(((self.bits >> 4) & 0x0fff) as u16)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("BRR")
.field("div_fraction", &self.div_fraction())
.field("div_mantissa", &self.div_mantissa())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn div_fraction(&mut self) -> DIV_FRACTION_W<BRRrs> {
DIV_FRACTION_W::new(self, 0)
}
#[inline(always)]
#[must_use]
pub fn div_mantissa(&mut self) -> DIV_MANTISSA_W<BRRrs> {
DIV_MANTISSA_W::new(self, 4)
}
}
pub struct BRRrs;
impl crate::RegisterSpec for BRRrs {
type Ux = u32;
}
impl crate::Readable for BRRrs {}
impl crate::Writable for BRRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for BRRrs {
const RESET_VALUE: u32 = 0;
}