pub type R = crate::R<IRCTRLrs>;
pub type W = crate::W<IRCTRLrs>;
pub type IrenR = crate::BitReader;
pub type IrenW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IRPW {
One = 0,
Two = 1,
Three = 2,
Four = 3,
}
impl From<IRPW> for u8 {
#[inline(always)]
fn from(variant: IRPW) -> Self {
variant as _
}
}
impl crate::FieldSpec for IRPW {
type Ux = u8;
}
impl crate::IsEnum for IRPW {}
pub type IrpwR = crate::FieldReader<IRPW>;
impl IrpwR {
#[inline(always)]
pub const fn variant(&self) -> IRPW {
match self.bits {
0 => IRPW::One,
1 => IRPW::Two,
2 => IRPW::Three,
3 => IRPW::Four,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_one(&self) -> bool {
*self == IRPW::One
}
#[inline(always)]
pub fn is_two(&self) -> bool {
*self == IRPW::Two
}
#[inline(always)]
pub fn is_three(&self) -> bool {
*self == IRPW::Three
}
#[inline(always)]
pub fn is_four(&self) -> bool {
*self == IRPW::Four
}
}
pub type IrpwW<'a, REG> = crate::FieldWriter<'a, REG, 2, IRPW, crate::Safe>;
impl<'a, REG> IrpwW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn one(self) -> &'a mut crate::W<REG> {
self.variant(IRPW::One)
}
#[inline(always)]
pub fn two(self) -> &'a mut crate::W<REG> {
self.variant(IRPW::Two)
}
#[inline(always)]
pub fn three(self) -> &'a mut crate::W<REG> {
self.variant(IRPW::Three)
}
#[inline(always)]
pub fn four(self) -> &'a mut crate::W<REG> {
self.variant(IRPW::Four)
}
}
pub type IrfiltR = crate::BitReader;
pub type IrfiltW<'a, REG> = crate::BitWriter<'a, REG>;
pub type IrprsenR = crate::BitReader;
pub type IrprsenW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum IRPRSSEL {
Prsch0 = 0,
Prsch1 = 1,
Prsch2 = 2,
Prsch3 = 3,
Prsch4 = 4,
Prsch5 = 5,
Prsch6 = 6,
Prsch7 = 7,
Prsch8 = 8,
Prsch9 = 9,
Prsch10 = 10,
Prsch11 = 11,
}
impl From<IRPRSSEL> for u8 {
#[inline(always)]
fn from(variant: IRPRSSEL) -> Self {
variant as _
}
}
impl crate::FieldSpec for IRPRSSEL {
type Ux = u8;
}
impl crate::IsEnum for IRPRSSEL {}
pub type IrprsselR = crate::FieldReader<IRPRSSEL>;
impl IrprsselR {
#[inline(always)]
pub const fn variant(&self) -> Option<IRPRSSEL> {
match self.bits {
0 => Some(IRPRSSEL::Prsch0),
1 => Some(IRPRSSEL::Prsch1),
2 => Some(IRPRSSEL::Prsch2),
3 => Some(IRPRSSEL::Prsch3),
4 => Some(IRPRSSEL::Prsch4),
5 => Some(IRPRSSEL::Prsch5),
6 => Some(IRPRSSEL::Prsch6),
7 => Some(IRPRSSEL::Prsch7),
8 => Some(IRPRSSEL::Prsch8),
9 => Some(IRPRSSEL::Prsch9),
10 => Some(IRPRSSEL::Prsch10),
11 => Some(IRPRSSEL::Prsch11),
_ => None,
}
}
#[inline(always)]
pub fn is_prsch0(&self) -> bool {
*self == IRPRSSEL::Prsch0
}
#[inline(always)]
pub fn is_prsch1(&self) -> bool {
*self == IRPRSSEL::Prsch1
}
#[inline(always)]
pub fn is_prsch2(&self) -> bool {
*self == IRPRSSEL::Prsch2
}
#[inline(always)]
pub fn is_prsch3(&self) -> bool {
*self == IRPRSSEL::Prsch3
}
#[inline(always)]
pub fn is_prsch4(&self) -> bool {
*self == IRPRSSEL::Prsch4
}
#[inline(always)]
pub fn is_prsch5(&self) -> bool {
*self == IRPRSSEL::Prsch5
}
#[inline(always)]
pub fn is_prsch6(&self) -> bool {
*self == IRPRSSEL::Prsch6
}
#[inline(always)]
pub fn is_prsch7(&self) -> bool {
*self == IRPRSSEL::Prsch7
}
#[inline(always)]
pub fn is_prsch8(&self) -> bool {
*self == IRPRSSEL::Prsch8
}
#[inline(always)]
pub fn is_prsch9(&self) -> bool {
*self == IRPRSSEL::Prsch9
}
#[inline(always)]
pub fn is_prsch10(&self) -> bool {
*self == IRPRSSEL::Prsch10
}
#[inline(always)]
pub fn is_prsch11(&self) -> bool {
*self == IRPRSSEL::Prsch11
}
}
pub type IrprsselW<'a, REG> = crate::FieldWriter<'a, REG, 4, IRPRSSEL>;
impl<'a, REG> IrprsselW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn prsch0(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch0)
}
#[inline(always)]
pub fn prsch1(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch1)
}
#[inline(always)]
pub fn prsch2(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch2)
}
#[inline(always)]
pub fn prsch3(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch3)
}
#[inline(always)]
pub fn prsch4(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch4)
}
#[inline(always)]
pub fn prsch5(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch5)
}
#[inline(always)]
pub fn prsch6(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch6)
}
#[inline(always)]
pub fn prsch7(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch7)
}
#[inline(always)]
pub fn prsch8(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch8)
}
#[inline(always)]
pub fn prsch9(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch9)
}
#[inline(always)]
pub fn prsch10(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch10)
}
#[inline(always)]
pub fn prsch11(self) -> &'a mut crate::W<REG> {
self.variant(IRPRSSEL::Prsch11)
}
}
impl R {
#[inline(always)]
pub fn iren(&self) -> IrenR {
IrenR::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn irpw(&self) -> IrpwR {
IrpwR::new(((self.bits >> 1) & 3) as u8)
}
#[inline(always)]
pub fn irfilt(&self) -> IrfiltR {
IrfiltR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn irprsen(&self) -> IrprsenR {
IrprsenR::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn irprssel(&self) -> IrprsselR {
IrprsselR::new(((self.bits >> 8) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("IRCTRL")
.field("iren", &self.iren())
.field("irpw", &self.irpw())
.field("irfilt", &self.irfilt())
.field("irprsen", &self.irprsen())
.field("irprssel", &self.irprssel())
.finish()
}
}
impl W {
#[inline(always)]
pub fn iren(&mut self) -> IrenW<'_, IRCTRLrs> {
IrenW::new(self, 0)
}
#[inline(always)]
pub fn irpw(&mut self) -> IrpwW<'_, IRCTRLrs> {
IrpwW::new(self, 1)
}
#[inline(always)]
pub fn irfilt(&mut self) -> IrfiltW<'_, IRCTRLrs> {
IrfiltW::new(self, 3)
}
#[inline(always)]
pub fn irprsen(&mut self) -> IrprsenW<'_, IRCTRLrs> {
IrprsenW::new(self, 7)
}
#[inline(always)]
pub fn irprssel(&mut self) -> IrprsselW<'_, IRCTRLrs> {
IrprsselW::new(self, 8)
}
}
pub struct IRCTRLrs;
impl crate::RegisterSpec for IRCTRLrs {
type Ux = u32;
}
impl crate::Readable for IRCTRLrs {}
impl crate::Writable for IRCTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for IRCTRLrs {}