pub type R = crate::R<LPMCSRrs>;
pub type W = crate::W<LPMCSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LPMEN {
Disabled = 0,
Enabled = 1,
}
impl From<LPMEN> for bool {
#[inline(always)]
fn from(variant: LPMEN) -> Self {
variant as u8 != 0
}
}
pub type LPMEN_R = crate::BitReader<LPMEN>;
impl LPMEN_R {
#[inline(always)]
pub const fn variant(&self) -> LPMEN {
match self.bits {
false => LPMEN::Disabled,
true => LPMEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LPMEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == LPMEN::Enabled
}
}
pub type LPMEN_W<'a, REG> = crate::BitWriter<'a, REG, LPMEN>;
impl<'a, REG> LPMEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LPMEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(LPMEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LPMACK {
Nyet = 0,
Ack = 1,
}
impl From<LPMACK> for bool {
#[inline(always)]
fn from(variant: LPMACK) -> Self {
variant as u8 != 0
}
}
pub type LPMACK_R = crate::BitReader<LPMACK>;
impl LPMACK_R {
#[inline(always)]
pub const fn variant(&self) -> LPMACK {
match self.bits {
false => LPMACK::Nyet,
true => LPMACK::Ack,
}
}
#[inline(always)]
pub fn is_nyet(&self) -> bool {
*self == LPMACK::Nyet
}
#[inline(always)]
pub fn is_ack(&self) -> bool {
*self == LPMACK::Ack
}
}
pub type LPMACK_W<'a, REG> = crate::BitWriter<'a, REG, LPMACK>;
impl<'a, REG> LPMACK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn nyet(self) -> &'a mut crate::W<REG> {
self.variant(LPMACK::Nyet)
}
#[inline(always)]
pub fn ack(self) -> &'a mut crate::W<REG> {
self.variant(LPMACK::Ack)
}
}
pub type REMWAKE_R = crate::BitReader;
pub type REMWAKE_W<'a, REG> = crate::BitWriter<'a, REG>;
pub type BESL_R = crate::FieldReader;
impl R {
#[inline(always)]
pub fn lpmen(&self) -> LPMEN_R {
LPMEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn lpmack(&self) -> LPMACK_R {
LPMACK_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn remwake(&self) -> REMWAKE_R {
REMWAKE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn besl(&self) -> BESL_R {
BESL_R::new(((self.bits >> 4) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("LPMCSR")
.field("lpmen", &self.lpmen())
.field("lpmack", &self.lpmack())
.field("remwake", &self.remwake())
.field("besl", &self.besl())
.finish()
}
}
impl W {
#[inline(always)]
pub fn lpmen(&mut self) -> LPMEN_W<LPMCSRrs> {
LPMEN_W::new(self, 0)
}
#[inline(always)]
pub fn lpmack(&mut self) -> LPMACK_W<LPMCSRrs> {
LPMACK_W::new(self, 1)
}
#[inline(always)]
pub fn remwake(&mut self) -> REMWAKE_W<LPMCSRrs> {
REMWAKE_W::new(self, 3)
}
}
pub struct LPMCSRrs;
impl crate::RegisterSpec for LPMCSRrs {
type Ux = u16;
}
impl crate::Readable for LPMCSRrs {}
impl crate::Writable for LPMCSRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for LPMCSRrs {}