pub type R = crate::R<APB2_FZrs>;
pub type W = crate::W<APB2_FZrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DBG_TIMER21_STOP {
Continue = 0,
Stop = 1,
}
impl From<DBG_TIMER21_STOP> for bool {
#[inline(always)]
fn from(variant: DBG_TIMER21_STOP) -> Self {
variant as u8 != 0
}
}
pub type DBG_TIMER21_STOP_R = crate::BitReader<DBG_TIMER21_STOP>;
impl DBG_TIMER21_STOP_R {
#[inline(always)]
pub const fn variant(&self) -> DBG_TIMER21_STOP {
match self.bits {
false => DBG_TIMER21_STOP::Continue,
true => DBG_TIMER21_STOP::Stop,
}
}
#[inline(always)]
pub fn is_continue(&self) -> bool {
*self == DBG_TIMER21_STOP::Continue
}
#[inline(always)]
pub fn is_stop(&self) -> bool {
*self == DBG_TIMER21_STOP::Stop
}
}
pub type DBG_TIMER21_STOP_W<'a, REG> = crate::BitWriter<'a, REG, DBG_TIMER21_STOP>;
impl<'a, REG> DBG_TIMER21_STOP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn continue_(self) -> &'a mut crate::W<REG> {
self.variant(DBG_TIMER21_STOP::Continue)
}
#[inline(always)]
pub fn stop(self) -> &'a mut crate::W<REG> {
self.variant(DBG_TIMER21_STOP::Stop)
}
}
pub type DBG_TIMER22_STO_R = crate::BitReader;
pub type DBG_TIMER22_STO_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn dbg_timer21_stop(&self) -> DBG_TIMER21_STOP_R {
DBG_TIMER21_STOP_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn dbg_timer22_sto(&self) -> DBG_TIMER22_STO_R {
DBG_TIMER22_STO_R::new(((self.bits >> 6) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB2_FZ")
.field("dbg_timer21_stop", &self.dbg_timer21_stop())
.field("dbg_timer22_sto", &self.dbg_timer22_sto())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dbg_timer21_stop(&mut self) -> DBG_TIMER21_STOP_W<APB2_FZrs> {
DBG_TIMER21_STOP_W::new(self, 2)
}
#[inline(always)]
pub fn dbg_timer22_sto(&mut self) -> DBG_TIMER22_STO_W<APB2_FZrs> {
DBG_TIMER22_STO_W::new(self, 6)
}
}
pub struct APB2_FZrs;
impl crate::RegisterSpec for APB2_FZrs {
type Ux = u32;
}
impl crate::Readable for APB2_FZrs {}
impl crate::Writable for APB2_FZrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB2_FZrs {}