pub type R = crate::R<RTSR2rs>;
pub type W = crate::W<RTSR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RISING_TRIGGER {
Disabled = 0,
Enabled = 1,
}
impl From<RISING_TRIGGER> for bool {
#[inline(always)]
fn from(variant: RISING_TRIGGER) -> Self {
variant as u8 != 0
}
}
pub type RT35_R = crate::BitReader<RISING_TRIGGER>;
impl RT35_R {
#[inline(always)]
pub const fn variant(&self) -> RISING_TRIGGER {
match self.bits {
false => RISING_TRIGGER::Disabled,
true => RISING_TRIGGER::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RISING_TRIGGER::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RISING_TRIGGER::Enabled
}
}
pub type RT35_W<'a, REG> = crate::BitWriter<'a, REG, RISING_TRIGGER>;
impl<'a, REG> RT35_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RISING_TRIGGER::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RISING_TRIGGER::Enabled)
}
}
pub use RT35_R as RT36_R;
pub use RT35_R as RT37_R;
pub use RT35_R as RT38_R;
pub use RT35_W as RT36_W;
pub use RT35_W as RT37_W;
pub use RT35_W as RT38_W;
impl R {
#[inline(always)]
pub fn rt35(&self) -> RT35_R {
RT35_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn rt36(&self) -> RT36_R {
RT36_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn rt37(&self) -> RT37_R {
RT37_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn rt38(&self) -> RT38_R {
RT38_R::new(((self.bits >> 6) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RTSR2")
.field("rt35", &self.rt35())
.field("rt36", &self.rt36())
.field("rt37", &self.rt37())
.field("rt38", &self.rt38())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rt35(&mut self) -> RT35_W<RTSR2rs> {
RT35_W::new(self, 3)
}
#[inline(always)]
pub fn rt36(&mut self) -> RT36_W<RTSR2rs> {
RT36_W::new(self, 4)
}
#[inline(always)]
pub fn rt37(&mut self) -> RT37_W<RTSR2rs> {
RT37_W::new(self, 5)
}
#[inline(always)]
pub fn rt38(&mut self) -> RT38_W<RTSR2rs> {
RT38_W::new(self, 6)
}
}
pub struct RTSR2rs;
impl crate::RegisterSpec for RTSR2rs {
type Ux = u32;
}
impl crate::Readable for RTSR2rs {}
impl crate::Writable for RTSR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for RTSR2rs {}