pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DBG_SLEEP {
Disabled = 0,
Enabled = 1,
}
impl From<DBG_SLEEP> for bool {
#[inline(always)]
fn from(variant: DBG_SLEEP) -> Self {
variant as u8 != 0
}
}
pub type DBG_SLEEP_R = crate::BitReader<DBG_SLEEP>;
impl DBG_SLEEP_R {
#[inline(always)]
pub const fn variant(&self) -> DBG_SLEEP {
match self.bits {
false => DBG_SLEEP::Disabled,
true => DBG_SLEEP::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DBG_SLEEP::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DBG_SLEEP::Enabled
}
}
pub type DBG_SLEEP_W<'a, REG> = crate::BitWriter<'a, REG, DBG_SLEEP>;
impl<'a, REG> DBG_SLEEP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DBG_SLEEP::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DBG_SLEEP::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DBG_STOP {
Disabled = 0,
Enabled = 1,
}
impl From<DBG_STOP> for bool {
#[inline(always)]
fn from(variant: DBG_STOP) -> Self {
variant as u8 != 0
}
}
pub type DBG_STOP_R = crate::BitReader<DBG_STOP>;
impl DBG_STOP_R {
#[inline(always)]
pub const fn variant(&self) -> DBG_STOP {
match self.bits {
false => DBG_STOP::Disabled,
true => DBG_STOP::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DBG_STOP::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DBG_STOP::Enabled
}
}
pub type DBG_STOP_W<'a, REG> = crate::BitWriter<'a, REG, DBG_STOP>;
impl<'a, REG> DBG_STOP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DBG_STOP::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DBG_STOP::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DBG_STANDBY {
Disabled = 0,
Enabled = 1,
}
impl From<DBG_STANDBY> for bool {
#[inline(always)]
fn from(variant: DBG_STANDBY) -> Self {
variant as u8 != 0
}
}
pub type DBG_STANDBY_R = crate::BitReader<DBG_STANDBY>;
impl DBG_STANDBY_R {
#[inline(always)]
pub const fn variant(&self) -> DBG_STANDBY {
match self.bits {
false => DBG_STANDBY::Disabled,
true => DBG_STANDBY::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DBG_STANDBY::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DBG_STANDBY::Enabled
}
}
pub type DBG_STANDBY_W<'a, REG> = crate::BitWriter<'a, REG, DBG_STANDBY>;
impl<'a, REG> DBG_STANDBY_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DBG_STANDBY::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DBG_STANDBY::Enabled)
}
}
impl R {
#[inline(always)]
pub fn dbg_sleep(&self) -> DBG_SLEEP_R {
DBG_SLEEP_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn dbg_stop(&self) -> DBG_STOP_R {
DBG_STOP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn dbg_standby(&self) -> DBG_STANDBY_R {
DBG_STANDBY_R::new(((self.bits >> 2) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("dbg_stop", &self.dbg_stop())
.field("dbg_standby", &self.dbg_standby())
.field("dbg_sleep", &self.dbg_sleep())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dbg_sleep(&mut self) -> DBG_SLEEP_W<CRrs> {
DBG_SLEEP_W::new(self, 0)
}
#[inline(always)]
pub fn dbg_stop(&mut self) -> DBG_STOP_W<CRrs> {
DBG_STOP_W::new(self, 1)
}
#[inline(always)]
pub fn dbg_standby(&mut self) -> DBG_STANDBY_W<CRrs> {
DBG_STANDBY_W::new(self, 2)
}
}
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
type Ux = u32;
}
impl crate::Readable for CRrs {}
impl crate::Writable for CRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRrs {}