pub type R = crate::R<FTSR2rs>;
pub type W = crate::W<FTSR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FALLING_TRIGGER {
Disabled = 0,
Enabled = 1,
}
impl From<FALLING_TRIGGER> for bool {
#[inline(always)]
fn from(variant: FALLING_TRIGGER) -> Self {
variant as u8 != 0
}
}
pub type TR49_R = crate::BitReader<FALLING_TRIGGER>;
impl TR49_R {
#[inline(always)]
pub const fn variant(&self) -> FALLING_TRIGGER {
match self.bits {
false => FALLING_TRIGGER::Disabled,
true => FALLING_TRIGGER::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FALLING_TRIGGER::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FALLING_TRIGGER::Enabled
}
}
pub type TR49_W<'a, REG> = crate::BitWriter<'a, REG, FALLING_TRIGGER>;
impl<'a, REG> TR49_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FALLING_TRIGGER::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FALLING_TRIGGER::Enabled)
}
}
pub use TR49_R as TR51_R;
pub use TR49_W as TR51_W;
impl R {
#[inline(always)]
pub fn tr49(&self) -> TR49_R {
TR49_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn tr51(&self) -> TR51_R {
TR51_R::new(((self.bits >> 19) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FTSR2")
.field("tr49", &self.tr49())
.field("tr51", &self.tr51())
.finish()
}
}
impl W {
#[inline(always)]
pub fn tr49(&mut self) -> TR49_W<FTSR2rs> {
TR49_W::new(self, 17)
}
#[inline(always)]
pub fn tr51(&mut self) -> TR51_W<FTSR2rs> {
TR51_W::new(self, 19)
}
}
pub struct FTSR2rs;
impl crate::RegisterSpec for FTSR2rs {
type Ux = u32;
}
impl crate::Readable for FTSR2rs {}
impl crate::Writable for FTSR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for FTSR2rs {}