pub type R = crate::R<BDMUPRrs>;
pub type W = crate::W<BDMUPRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MCR {
NotUpdated = 0,
Updated = 1,
}
impl From<MCR> for bool {
#[inline(always)]
fn from(variant: MCR) -> Self {
variant as u8 != 0
}
}
pub type MCR_R = crate::BitReader<MCR>;
impl MCR_R {
#[inline(always)]
pub const fn variant(&self) -> MCR {
match self.bits {
false => MCR::NotUpdated,
true => MCR::Updated,
}
}
#[inline(always)]
pub fn is_not_updated(&self) -> bool {
*self == MCR::NotUpdated
}
#[inline(always)]
pub fn is_updated(&self) -> bool {
*self == MCR::Updated
}
}
pub type MCR_W<'a, REG> = crate::BitWriter<'a, REG, MCR>;
impl<'a, REG> MCR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn not_updated(self) -> &'a mut crate::W<REG> {
self.variant(MCR::NotUpdated)
}
#[inline(always)]
pub fn updated(self) -> &'a mut crate::W<REG> {
self.variant(MCR::Updated)
}
}
pub use MCR_R as MICR_R;
pub use MCR_R as MDIER_R;
pub use MCR_R as MCNT_R;
pub use MCR_R as MPER_R;
pub use MCR_R as MREP_R;
pub use MCR_R as MCMP1_R;
pub use MCR_R as MCMP2_R;
pub use MCR_R as MCMP3_R;
pub use MCR_R as MCMP4_R;
pub use MCR_W as MICR_W;
pub use MCR_W as MDIER_W;
pub use MCR_W as MCNT_W;
pub use MCR_W as MPER_W;
pub use MCR_W as MREP_W;
pub use MCR_W as MCMP1_W;
pub use MCR_W as MCMP2_W;
pub use MCR_W as MCMP3_W;
pub use MCR_W as MCMP4_W;
impl R {
#[inline(always)]
pub fn mcr(&self) -> MCR_R {
MCR_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn micr(&self) -> MICR_R {
MICR_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn mdier(&self) -> MDIER_R {
MDIER_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn mcnt(&self) -> MCNT_R {
MCNT_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn mper(&self) -> MPER_R {
MPER_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn mrep(&self) -> MREP_R {
MREP_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn mcmp1(&self) -> MCMP1_R {
MCMP1_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn mcmp2(&self) -> MCMP2_R {
MCMP2_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn mcmp3(&self) -> MCMP3_R {
MCMP3_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn mcmp4(&self) -> MCMP4_R {
MCMP4_R::new(((self.bits >> 9) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("BDMUPR")
.field("mcr", &self.mcr())
.field("mcmp4", &self.mcmp4())
.field("mcmp3", &self.mcmp3())
.field("mcmp2", &self.mcmp2())
.field("mcmp1", &self.mcmp1())
.field("mrep", &self.mrep())
.field("mper", &self.mper())
.field("mcnt", &self.mcnt())
.field("mdier", &self.mdier())
.field("micr", &self.micr())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mcr(&mut self) -> MCR_W<BDMUPRrs> {
MCR_W::new(self, 0)
}
#[inline(always)]
pub fn micr(&mut self) -> MICR_W<BDMUPRrs> {
MICR_W::new(self, 1)
}
#[inline(always)]
pub fn mdier(&mut self) -> MDIER_W<BDMUPRrs> {
MDIER_W::new(self, 2)
}
#[inline(always)]
pub fn mcnt(&mut self) -> MCNT_W<BDMUPRrs> {
MCNT_W::new(self, 3)
}
#[inline(always)]
pub fn mper(&mut self) -> MPER_W<BDMUPRrs> {
MPER_W::new(self, 4)
}
#[inline(always)]
pub fn mrep(&mut self) -> MREP_W<BDMUPRrs> {
MREP_W::new(self, 5)
}
#[inline(always)]
pub fn mcmp1(&mut self) -> MCMP1_W<BDMUPRrs> {
MCMP1_W::new(self, 6)
}
#[inline(always)]
pub fn mcmp2(&mut self) -> MCMP2_W<BDMUPRrs> {
MCMP2_W::new(self, 7)
}
#[inline(always)]
pub fn mcmp3(&mut self) -> MCMP3_W<BDMUPRrs> {
MCMP3_W::new(self, 8)
}
#[inline(always)]
pub fn mcmp4(&mut self) -> MCMP4_W<BDMUPRrs> {
MCMP4_W::new(self, 9)
}
}
pub struct BDMUPRrs;
impl crate::RegisterSpec for BDMUPRrs {
type Ux = u32;
}
impl crate::Readable for BDMUPRrs {}
impl crate::Writable for BDMUPRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for BDMUPRrs {}