pub type R = crate::R<EMR2rs>;
pub type W = crate::W<EMR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EVENT_MASK {
Masked = 0,
Unmasked = 1,
}
impl From<EVENT_MASK> for bool {
#[inline(always)]
fn from(variant: EVENT_MASK) -> Self {
variant as u8 != 0
}
}
pub type MR32_R = crate::BitReader<EVENT_MASK>;
impl MR32_R {
#[inline(always)]
pub const fn variant(&self) -> EVENT_MASK {
match self.bits {
false => EVENT_MASK::Masked,
true => EVENT_MASK::Unmasked,
}
}
#[inline(always)]
pub fn is_masked(&self) -> bool {
*self == EVENT_MASK::Masked
}
#[inline(always)]
pub fn is_unmasked(&self) -> bool {
*self == EVENT_MASK::Unmasked
}
}
pub type MR32_W<'a, REG> = crate::BitWriter<'a, REG, EVENT_MASK>;
impl<'a, REG> MR32_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn masked(self) -> &'a mut crate::W<REG> {
self.variant(EVENT_MASK::Masked)
}
#[inline(always)]
pub fn unmasked(self) -> &'a mut crate::W<REG> {
self.variant(EVENT_MASK::Unmasked)
}
}
pub use MR32_R as MR33_R;
pub use MR32_R as MR34_R;
pub use MR32_R as MR35_R;
pub use MR32_R as MR36_R;
pub use MR32_R as MR37_R;
pub use MR32_R as MR38_R;
pub use MR32_R as MR39_R;
pub use MR32_W as MR33_W;
pub use MR32_W as MR34_W;
pub use MR32_W as MR35_W;
pub use MR32_W as MR36_W;
pub use MR32_W as MR37_W;
pub use MR32_W as MR38_W;
pub use MR32_W as MR39_W;
impl R {
#[inline(always)]
pub fn mr32(&self) -> MR32_R {
MR32_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn mr33(&self) -> MR33_R {
MR33_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn mr34(&self) -> MR34_R {
MR34_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn mr35(&self) -> MR35_R {
MR35_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn mr36(&self) -> MR36_R {
MR36_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn mr37(&self) -> MR37_R {
MR37_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn mr38(&self) -> MR38_R {
MR38_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn mr39(&self) -> MR39_R {
MR39_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("EMR2")
.field("mr32", &self.mr32())
.field("mr33", &self.mr33())
.field("mr34", &self.mr34())
.field("mr35", &self.mr35())
.field("mr36", &self.mr36())
.field("mr37", &self.mr37())
.field("mr38", &self.mr38())
.field("mr39", &self.mr39())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mr32(&mut self) -> MR32_W<EMR2rs> {
MR32_W::new(self, 0)
}
#[inline(always)]
pub fn mr33(&mut self) -> MR33_W<EMR2rs> {
MR33_W::new(self, 1)
}
#[inline(always)]
pub fn mr34(&mut self) -> MR34_W<EMR2rs> {
MR34_W::new(self, 2)
}
#[inline(always)]
pub fn mr35(&mut self) -> MR35_W<EMR2rs> {
MR35_W::new(self, 3)
}
#[inline(always)]
pub fn mr36(&mut self) -> MR36_W<EMR2rs> {
MR36_W::new(self, 4)
}
#[inline(always)]
pub fn mr37(&mut self) -> MR37_W<EMR2rs> {
MR37_W::new(self, 5)
}
#[inline(always)]
pub fn mr38(&mut self) -> MR38_W<EMR2rs> {
MR38_W::new(self, 6)
}
#[inline(always)]
pub fn mr39(&mut self) -> MR39_W<EMR2rs> {
MR39_W::new(self, 7)
}
}
pub struct EMR2rs;
impl crate::RegisterSpec for EMR2rs {
type Ux = u32;
}
impl crate::Readable for EMR2rs {}
impl crate::Writable for EMR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for EMR2rs {}