#[doc = "Reader of register ICSR"]
pub type R = crate::R<u32, super::ICSR>;
#[doc = "Writer for register ICSR"]
pub type W = crate::W<u32, super::ICSR>;
#[doc = "Register ICSR `reset()`'s with value 0x07"]
impl crate::ResetValue for super::ICSR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0x07
}
}
#[doc = "Reader of field `ALRAWF`"]
pub type ALRAWF_R = crate::R<bool, bool>;
#[doc = "Reader of field `ALRBWF`"]
pub type ALRBWF_R = crate::R<bool, bool>;
#[doc = "Reader of field `WUTWF`"]
pub type WUTWF_R = crate::R<bool, bool>;
#[doc = "Reader of field `SHPF`"]
pub type SHPF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SHPF`"]
pub struct SHPF_W<'a> {
w: &'a mut W,
}
impl<'a> SHPF_W<'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 = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
self.w
}
}
#[doc = "Reader of field `INITS`"]
pub type INITS_R = crate::R<bool, bool>;
#[doc = "Reader of field `RSF`"]
pub type RSF_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `RSF`"]
pub struct RSF_W<'a> {
w: &'a mut W,
}
impl<'a> RSF_W<'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 = (self.w.bits & !(0x01 << 5)) | (((value as u32) & 0x01) << 5);
self.w
}
}
#[doc = "Reader of field `INITF`"]
pub type INITF_R = crate::R<bool, bool>;
#[doc = "Reader of field `INIT`"]
pub type INIT_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `INIT`"]
pub struct INIT_W<'a> {
w: &'a mut W,
}
impl<'a> INIT_W<'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 = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
self.w
}
}
#[doc = "Reader of field `RECALPF`"]
pub type RECALPF_R = crate::R<bool, bool>;
impl R {
#[doc = "Bit 0 - Alarm A write flag"]
#[inline(always)]
pub fn alrawf(&self) -> ALRAWF_R {
ALRAWF_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Alarm B write flag"]
#[inline(always)]
pub fn alrbwf(&self) -> ALRBWF_R {
ALRBWF_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 2 - Wakeup timer write flag"]
#[inline(always)]
pub fn wutwf(&self) -> WUTWF_R {
WUTWF_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - Shift operation pending"]
#[inline(always)]
pub fn shpf(&self) -> SHPF_R {
SHPF_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - Initialization status flag"]
#[inline(always)]
pub fn inits(&self) -> INITS_R {
INITS_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - Registers synchronization flag"]
#[inline(always)]
pub fn rsf(&self) -> RSF_R {
RSF_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 6 - Initialization flag"]
#[inline(always)]
pub fn initf(&self) -> INITF_R {
INITF_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Initialization mode"]
#[inline(always)]
pub fn init(&self) -> INIT_R {
INIT_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 16 - Recalibration pending Flag"]
#[inline(always)]
pub fn recalpf(&self) -> RECALPF_R {
RECALPF_R::new(((self.bits >> 16) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 3 - Shift operation pending"]
#[inline(always)]
pub fn shpf(&mut self) -> SHPF_W {
SHPF_W { w: self }
}
#[doc = "Bit 5 - Registers synchronization flag"]
#[inline(always)]
pub fn rsf(&mut self) -> RSF_W {
RSF_W { w: self }
}
#[doc = "Bit 7 - Initialization mode"]
#[inline(always)]
pub fn init(&mut self) -> INIT_W {
INIT_W { w: self }
}
}