pub type R = crate::R<LFECLKSELrs>;
pub type W = crate::W<LFECLKSELrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LFE {
Disabled = 0,
Lfrco = 1,
Lfxo = 2,
Ulfrco = 4,
}
impl From<LFE> for u8 {
#[inline(always)]
fn from(variant: LFE) -> Self {
variant as _
}
}
impl crate::FieldSpec for LFE {
type Ux = u8;
}
impl crate::IsEnum for LFE {}
pub type LfeR = crate::FieldReader<LFE>;
impl LfeR {
#[inline(always)]
pub const fn variant(&self) -> Option<LFE> {
match self.bits {
0 => Some(LFE::Disabled),
1 => Some(LFE::Lfrco),
2 => Some(LFE::Lfxo),
4 => Some(LFE::Ulfrco),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LFE::Disabled
}
#[inline(always)]
pub fn is_lfrco(&self) -> bool {
*self == LFE::Lfrco
}
#[inline(always)]
pub fn is_lfxo(&self) -> bool {
*self == LFE::Lfxo
}
#[inline(always)]
pub fn is_ulfrco(&self) -> bool {
*self == LFE::Ulfrco
}
}
pub type LfeW<'a, REG> = crate::FieldWriter<'a, REG, 3, LFE>;
impl<'a, REG> LfeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LFE::Disabled)
}
#[inline(always)]
pub fn lfrco(self) -> &'a mut crate::W<REG> {
self.variant(LFE::Lfrco)
}
#[inline(always)]
pub fn lfxo(self) -> &'a mut crate::W<REG> {
self.variant(LFE::Lfxo)
}
#[inline(always)]
pub fn ulfrco(self) -> &'a mut crate::W<REG> {
self.variant(LFE::Ulfrco)
}
}
impl R {
#[inline(always)]
pub fn lfe(&self) -> LfeR {
LfeR::new((self.bits & 7) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LFECLKSEL")
.field("lfe", &self.lfe())
.finish()
}
}
impl W {
#[inline(always)]
pub fn lfe(&mut self) -> LfeW<'_, LFECLKSELrs> {
LfeW::new(self, 0)
}
}
pub struct LFECLKSELrs;
impl crate::RegisterSpec for LFECLKSELrs {
type Ux = u32;
}
impl crate::Readable for LFECLKSELrs {}
impl crate::Writable for LFECLKSELrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for LFECLKSELrs {}