pub type R = crate::R<IMRrs>;
pub type W = crate::W<IMRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum INTERRUPT_MASK {
Masked = 0,
Unmasked = 1,
}
impl From<INTERRUPT_MASK> for bool {
#[inline(always)]
fn from(variant: INTERRUPT_MASK) -> Self {
variant as u8 != 0
}
}
pub type MR_R = crate::BitReader<INTERRUPT_MASK>;
impl MR_R {
#[inline(always)]
pub const fn variant(&self) -> INTERRUPT_MASK {
match self.bits {
false => INTERRUPT_MASK::Masked,
true => INTERRUPT_MASK::Unmasked,
}
}
#[inline(always)]
pub fn is_masked(&self) -> bool {
*self == INTERRUPT_MASK::Masked
}
#[inline(always)]
pub fn is_unmasked(&self) -> bool {
*self == INTERRUPT_MASK::Unmasked
}
}
pub type MR_W<'a, REG> = crate::BitWriter<'a, REG, INTERRUPT_MASK>;
impl<'a, REG> MR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn masked(self) -> &'a mut crate::W<REG> {
self.variant(INTERRUPT_MASK::Masked)
}
#[inline(always)]
pub fn unmasked(self) -> &'a mut crate::W<REG> {
self.variant(INTERRUPT_MASK::Unmasked)
}
}
impl R {
#[inline(always)]
pub fn mr(&self, n: u8) -> MR_R {
#[allow(clippy::no_effect)]
[(); 23][n as usize];
MR_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn mr_iter(&self) -> impl Iterator<Item = MR_R> + '_ {
(0..23).map(move |n| MR_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn mr0(&self) -> MR_R {
MR_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn mr1(&self) -> MR_R {
MR_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn mr2(&self) -> MR_R {
MR_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn mr3(&self) -> MR_R {
MR_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn mr4(&self) -> MR_R {
MR_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn mr5(&self) -> MR_R {
MR_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn mr6(&self) -> MR_R {
MR_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn mr7(&self) -> MR_R {
MR_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn mr8(&self) -> MR_R {
MR_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn mr9(&self) -> MR_R {
MR_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn mr10(&self) -> MR_R {
MR_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn mr11(&self) -> MR_R {
MR_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn mr12(&self) -> MR_R {
MR_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn mr13(&self) -> MR_R {
MR_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn mr14(&self) -> MR_R {
MR_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn mr15(&self) -> MR_R {
MR_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn mr16(&self) -> MR_R {
MR_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn mr17(&self) -> MR_R {
MR_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn mr18(&self) -> MR_R {
MR_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn mr19(&self) -> MR_R {
MR_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn mr20(&self) -> MR_R {
MR_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn mr21(&self) -> MR_R {
MR_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn mr22(&self) -> MR_R {
MR_R::new(((self.bits >> 22) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("IMR")
.field("mr0", &self.mr0())
.field("mr1", &self.mr1())
.field("mr2", &self.mr2())
.field("mr3", &self.mr3())
.field("mr4", &self.mr4())
.field("mr5", &self.mr5())
.field("mr6", &self.mr6())
.field("mr7", &self.mr7())
.field("mr8", &self.mr8())
.field("mr9", &self.mr9())
.field("mr10", &self.mr10())
.field("mr11", &self.mr11())
.field("mr12", &self.mr12())
.field("mr13", &self.mr13())
.field("mr14", &self.mr14())
.field("mr15", &self.mr15())
.field("mr16", &self.mr16())
.field("mr17", &self.mr17())
.field("mr18", &self.mr18())
.field("mr19", &self.mr19())
.field("mr20", &self.mr20())
.field("mr21", &self.mr21())
.field("mr22", &self.mr22())
.finish()
}
}
impl W {
#[inline(always)]
pub fn mr(&mut self, n: u8) -> MR_W<IMRrs> {
#[allow(clippy::no_effect)]
[(); 23][n as usize];
MR_W::new(self, n)
}
#[inline(always)]
pub fn mr0(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 0)
}
#[inline(always)]
pub fn mr1(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 1)
}
#[inline(always)]
pub fn mr2(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 2)
}
#[inline(always)]
pub fn mr3(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 3)
}
#[inline(always)]
pub fn mr4(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 4)
}
#[inline(always)]
pub fn mr5(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 5)
}
#[inline(always)]
pub fn mr6(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 6)
}
#[inline(always)]
pub fn mr7(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 7)
}
#[inline(always)]
pub fn mr8(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 8)
}
#[inline(always)]
pub fn mr9(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 9)
}
#[inline(always)]
pub fn mr10(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 10)
}
#[inline(always)]
pub fn mr11(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 11)
}
#[inline(always)]
pub fn mr12(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 12)
}
#[inline(always)]
pub fn mr13(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 13)
}
#[inline(always)]
pub fn mr14(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 14)
}
#[inline(always)]
pub fn mr15(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 15)
}
#[inline(always)]
pub fn mr16(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 16)
}
#[inline(always)]
pub fn mr17(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 17)
}
#[inline(always)]
pub fn mr18(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 18)
}
#[inline(always)]
pub fn mr19(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 19)
}
#[inline(always)]
pub fn mr20(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 20)
}
#[inline(always)]
pub fn mr21(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 21)
}
#[inline(always)]
pub fn mr22(&mut self) -> MR_W<IMRrs> {
MR_W::new(self, 22)
}
}
pub struct IMRrs;
impl crate::RegisterSpec for IMRrs {
type Ux = u32;
}
impl crate::Readable for IMRrs {}
impl crate::Writable for IMRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for IMRrs {}