#[doc = "Register `LFCLKSTAT` reader"] pub struct R(crate::R); impl core::ops::Deref for R { type Target = crate::R; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From> for R { #[inline(always)] fn from(reader: crate::R) -> Self { R(reader) } } #[doc = "Field `SRC` reader - Active clock source"] pub type SRC_R = crate::FieldReader; #[doc = "Active clock source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum SRC_A { #[doc = "0: Reserved for future use"] RFU = 0, #[doc = "1: 32.768 kHz RC oscillator"] LFRC = 1, #[doc = "2: 32.768 kHz crystal oscillator"] LFXO = 2, } impl From for u8 { #[inline(always)] fn from(variant: SRC_A) -> Self { variant as _ } } impl SRC_R { #[doc = "Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> Option { match self.bits { 0 => Some(SRC_A::RFU), 1 => Some(SRC_A::LFRC), 2 => Some(SRC_A::LFXO), _ => None, } } #[doc = "Checks if the value of the field is `RFU`"] #[inline(always)] pub fn is_rfu(&self) -> bool { *self == SRC_A::RFU } #[doc = "Checks if the value of the field is `LFRC`"] #[inline(always)] pub fn is_lfrc(&self) -> bool { *self == SRC_A::LFRC } #[doc = "Checks if the value of the field is `LFXO`"] #[inline(always)] pub fn is_lfxo(&self) -> bool { *self == SRC_A::LFXO } } #[doc = "Field `STATE` reader - LFCLK state"] pub type STATE_R = crate::BitReader; #[doc = "LFCLK state\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum STATE_A { #[doc = "0: Requested LFCLK source has not been started or LFCLKSTOP task has been triggered"] NOT_RUNNING = 0, #[doc = "1: Requested LFCLK source has been started (LFCLKSTARTED event has been generated)"] RUNNING = 1, } impl From for bool { #[inline(always)] fn from(variant: STATE_A) -> Self { variant as u8 != 0 } } impl STATE_R { #[doc = "Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> STATE_A { match self.bits { false => STATE_A::NOT_RUNNING, true => STATE_A::RUNNING, } } #[doc = "Checks if the value of the field is `NOT_RUNNING`"] #[inline(always)] pub fn is_not_running(&self) -> bool { *self == STATE_A::NOT_RUNNING } #[doc = "Checks if the value of the field is `RUNNING`"] #[inline(always)] pub fn is_running(&self) -> bool { *self == STATE_A::RUNNING } } impl R { #[doc = "Bits 0:1 - Active clock source"] #[inline(always)] pub fn src(&self) -> SRC_R { SRC_R::new((self.bits & 3) as u8) } #[doc = "Bit 16 - LFCLK state"] #[inline(always)] pub fn state(&self) -> STATE_R { STATE_R::new(((self.bits >> 16) & 1) != 0) } } #[doc = "The register shows which LFCLK source has been requested (SRC) when triggering LFCLKSTART task and if the source has been started (STATE)\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lfclkstat](index.html) module"] pub struct LFCLKSTAT_SPEC; impl crate::RegisterSpec for LFCLKSTAT_SPEC { type Ux = u32; } #[doc = "`read()` method returns [lfclkstat::R](R) reader structure"] impl crate::Readable for LFCLKSTAT_SPEC { type Reader = R; } #[doc = "`reset()` method sets LFCLKSTAT to value 0"] impl crate::Resettable for LFCLKSTAT_SPEC { #[inline(always)] fn reset_value() -> Self::Ux { 0 } }