pub type R = crate::R<SRCRrs>;
pub type W = crate::W<SRCRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IMR {
NoEffect = 0,
Reload = 1,
}
impl From<IMR> for bool {
#[inline(always)]
fn from(variant: IMR) -> Self {
variant as u8 != 0
}
}
pub type IMR_R = crate::BitReader<IMR>;
impl IMR_R {
#[inline(always)]
pub const fn variant(&self) -> IMR {
match self.bits {
false => IMR::NoEffect,
true => IMR::Reload,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == IMR::NoEffect
}
#[inline(always)]
pub fn is_reload(&self) -> bool {
*self == IMR::Reload
}
}
pub type IMR_W<'a, REG> = crate::BitWriter<'a, REG, IMR>;
impl<'a, REG> IMR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(IMR::NoEffect)
}
#[inline(always)]
pub fn reload(self) -> &'a mut crate::W<REG> {
self.variant(IMR::Reload)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VBR {
NoEffect = 0,
Reload = 1,
}
impl From<VBR> for bool {
#[inline(always)]
fn from(variant: VBR) -> Self {
variant as u8 != 0
}
}
pub type VBR_R = crate::BitReader<VBR>;
impl VBR_R {
#[inline(always)]
pub const fn variant(&self) -> VBR {
match self.bits {
false => VBR::NoEffect,
true => VBR::Reload,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == VBR::NoEffect
}
#[inline(always)]
pub fn is_reload(&self) -> bool {
*self == VBR::Reload
}
}
pub type VBR_W<'a, REG> = crate::BitWriter<'a, REG, VBR>;
impl<'a, REG> VBR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(VBR::NoEffect)
}
#[inline(always)]
pub fn reload(self) -> &'a mut crate::W<REG> {
self.variant(VBR::Reload)
}
}
impl R {
#[inline(always)]
pub fn imr(&self) -> IMR_R {
IMR_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn vbr(&self) -> VBR_R {
VBR_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("SRCR")
.field("vbr", &self.vbr())
.field("imr", &self.imr())
.finish()
}
}
impl W {
#[inline(always)]
pub fn imr(&mut self) -> IMR_W<SRCRrs> {
IMR_W::new(self, 0)
}
#[inline(always)]
pub fn vbr(&mut self) -> VBR_W<SRCRrs> {
VBR_W::new(self, 1)
}
}
pub struct SRCRrs;
impl crate::RegisterSpec for SRCRrs {
type Ux = u32;
}
impl crate::Readable for SRCRrs {}
impl crate::Writable for SRCRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for SRCRrs {}