pub type R = crate::R<CSRrs>;
pub type W = crate::W<CSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LSION {
Off = 0,
On = 1,
}
impl From<LSION> for bool {
#[inline(always)]
fn from(variant: LSION) -> Self {
variant as u8 != 0
}
}
pub type LSION_R = crate::BitReader<LSION>;
impl LSION_R {
#[inline(always)]
pub const fn variant(&self) -> LSION {
match self.bits {
false => LSION::Off,
true => LSION::On,
}
}
#[inline(always)]
pub fn is_off(&self) -> bool {
*self == LSION::Off
}
#[inline(always)]
pub fn is_on(&self) -> bool {
*self == LSION::On
}
}
pub type LSION_W<'a, REG> = crate::BitWriter<'a, REG, LSION>;
impl<'a, REG> LSION_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn off(self) -> &'a mut crate::W<REG> {
self.variant(LSION::Off)
}
#[inline(always)]
pub fn on(self) -> &'a mut crate::W<REG> {
self.variant(LSION::On)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LSIRDYR {
NotReady = 0,
Ready = 1,
}
impl From<LSIRDYR> for bool {
#[inline(always)]
fn from(variant: LSIRDYR) -> Self {
variant as u8 != 0
}
}
pub type LSIRDY_R = crate::BitReader<LSIRDYR>;
impl LSIRDY_R {
#[inline(always)]
pub const fn variant(&self) -> LSIRDYR {
match self.bits {
false => LSIRDYR::NotReady,
true => LSIRDYR::Ready,
}
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == LSIRDYR::NotReady
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == LSIRDYR::Ready
}
}
pub type LSIRDY_W<'a, REG> = crate::BitWriter<'a, REG, LSIRDYR>;
impl<'a, REG> LSIRDY_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_ready(self) -> &'a mut crate::W<REG> {
self.variant(LSIRDYR::NotReady)
}
#[inline(always)]
pub fn ready(self) -> &'a mut crate::W<REG> {
self.variant(LSIRDYR::Ready)
}
}
impl R {
#[inline(always)]
pub fn lsion(&self) -> LSION_R {
LSION_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn lsirdy(&self) -> LSIRDY_R {
LSIRDY_R::new(((self.bits >> 1) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSR")
.field("lsion", &self.lsion())
.field("lsirdy", &self.lsirdy())
.finish()
}
}
impl W {
#[inline(always)]
pub fn lsion(&mut self) -> LSION_W<CSRrs> {
LSION_W::new(self, 0)
}
#[inline(always)]
pub fn lsirdy(&mut self) -> LSIRDY_W<CSRrs> {
LSIRDY_W::new(self, 1)
}
}
pub struct CSRrs;
impl crate::RegisterSpec for CSRrs {
type Ux = u32;
}
impl crate::Readable for CSRrs {}
impl crate::Writable for CSRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CSRrs {}