#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::SHIFTR {
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = r"Proxy"]
pub struct _ADD1SW<'a> {
w: &'a mut W,
}
impl<'a> _ADD1SW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(0x01 << 31);
self.w.bits |= ((value as u32) & 0x01) << 31;
self.w
}
}
#[doc = r"Proxy"]
pub struct _SUBFSW<'a> {
w: &'a mut W,
}
impl<'a> _SUBFSW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits &= !(0x7fff << 0);
self.w.bits |= ((value as u32) & 0x7fff) << 0;
self.w
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 31 - ADD1S"]
#[inline(always)]
pub fn add1s(&mut self) -> _ADD1SW {
_ADD1SW { w: self }
}
#[doc = "Bits 0:14 - Subtract a fraction of a second"]
#[inline(always)]
pub fn subfs(&mut self) -> _SUBFSW {
_SUBFSW { w: self }
}
}