pub type R = crate::R<DIERrs>;
pub type W = crate::W<DIERrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMP1IE {
Disabled = 0,
Enabled = 1,
}
impl From<CMP1IE> for bool {
#[inline(always)]
fn from(variant: CMP1IE) -> Self {
variant as u8 != 0
}
}
pub type CMPIE_R = crate::BitReader<CMP1IE>;
impl CMPIE_R {
#[inline(always)]
pub const fn variant(&self) -> CMP1IE {
match self.bits {
false => CMP1IE::Disabled,
true => CMP1IE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CMP1IE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CMP1IE::Enabled
}
}
pub type CMPIE_W<'a, REG> = crate::BitWriter<'a, REG, CMP1IE>;
impl<'a, REG> CMPIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CMP1IE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CMP1IE::Enabled)
}
}
pub use CMPIE_R as REPIE_R;
pub use CMPIE_R as SYNCIE_R;
pub use CMPIE_R as UPDIE_R;
pub use CMPIE_W as REPIE_W;
pub use CMPIE_W as SYNCIE_W;
pub use CMPIE_W as UPDIE_W;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CMP1DE {
Disabled = 0,
Enabled = 1,
}
impl From<CMP1DE> for bool {
#[inline(always)]
fn from(variant: CMP1DE) -> Self {
variant as u8 != 0
}
}
pub type CMPDE_R = crate::BitReader<CMP1DE>;
impl CMPDE_R {
#[inline(always)]
pub const fn variant(&self) -> CMP1DE {
match self.bits {
false => CMP1DE::Disabled,
true => CMP1DE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CMP1DE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CMP1DE::Enabled
}
}
pub type CMPDE_W<'a, REG> = crate::BitWriter<'a, REG, CMP1DE>;
impl<'a, REG> CMPDE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CMP1DE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CMP1DE::Enabled)
}
}
pub use CMPDE_R as REPDE_R;
pub use CMPDE_R as SYNCDE_R;
pub use CMPDE_R as UPDDE_R;
pub use CMPDE_W as REPDE_W;
pub use CMPDE_W as SYNCDE_W;
pub use CMPDE_W as UPDDE_W;
impl R {
#[inline(always)]
pub fn cmpie(&self, n: u8) -> CMPIE_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CMPIE_R::new(((self.bits >> n) & 1) != 0)
}
#[inline(always)]
pub fn cmpie_iter(&self) -> impl Iterator<Item = CMPIE_R> + '_ {
(0..4).map(move |n| CMPIE_R::new(((self.bits >> n) & 1) != 0))
}
#[inline(always)]
pub fn cmp1ie(&self) -> CMPIE_R {
CMPIE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn cmp2ie(&self) -> CMPIE_R {
CMPIE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cmp3ie(&self) -> CMPIE_R {
CMPIE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cmp4ie(&self) -> CMPIE_R {
CMPIE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn repie(&self) -> REPIE_R {
REPIE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn syncie(&self) -> SYNCIE_R {
SYNCIE_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn updie(&self) -> UPDIE_R {
UPDIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn cmpde(&self, n: u8) -> CMPDE_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CMPDE_R::new(((self.bits >> (n + 16)) & 1) != 0)
}
#[inline(always)]
pub fn cmpde_iter(&self) -> impl Iterator<Item = CMPDE_R> + '_ {
(0..4).map(move |n| CMPDE_R::new(((self.bits >> (n + 16)) & 1) != 0))
}
#[inline(always)]
pub fn cmp1de(&self) -> CMPDE_R {
CMPDE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn cmp2de(&self) -> CMPDE_R {
CMPDE_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn cmp3de(&self) -> CMPDE_R {
CMPDE_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn cmp4de(&self) -> CMPDE_R {
CMPDE_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn repde(&self) -> REPDE_R {
REPDE_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn syncde(&self) -> SYNCDE_R {
SYNCDE_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn updde(&self) -> UPDDE_R {
UPDDE_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("DIER")
.field("cmp1de", &self.cmp1de())
.field("cmp2de", &self.cmp2de())
.field("cmp3de", &self.cmp3de())
.field("cmp4de", &self.cmp4de())
.field("updde", &self.updde())
.field("syncde", &self.syncde())
.field("repde", &self.repde())
.field("cmp1ie", &self.cmp1ie())
.field("cmp2ie", &self.cmp2ie())
.field("cmp3ie", &self.cmp3ie())
.field("cmp4ie", &self.cmp4ie())
.field("updie", &self.updie())
.field("syncie", &self.syncie())
.field("repie", &self.repie())
.finish()
}
}
impl W {
#[inline(always)]
pub fn cmpie(&mut self, n: u8) -> CMPIE_W<DIERrs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CMPIE_W::new(self, n)
}
#[inline(always)]
pub fn cmp1ie(&mut self) -> CMPIE_W<DIERrs> {
CMPIE_W::new(self, 0)
}
#[inline(always)]
pub fn cmp2ie(&mut self) -> CMPIE_W<DIERrs> {
CMPIE_W::new(self, 1)
}
#[inline(always)]
pub fn cmp3ie(&mut self) -> CMPIE_W<DIERrs> {
CMPIE_W::new(self, 2)
}
#[inline(always)]
pub fn cmp4ie(&mut self) -> CMPIE_W<DIERrs> {
CMPIE_W::new(self, 3)
}
#[inline(always)]
pub fn repie(&mut self) -> REPIE_W<DIERrs> {
REPIE_W::new(self, 4)
}
#[inline(always)]
pub fn syncie(&mut self) -> SYNCIE_W<DIERrs> {
SYNCIE_W::new(self, 5)
}
#[inline(always)]
pub fn updie(&mut self) -> UPDIE_W<DIERrs> {
UPDIE_W::new(self, 6)
}
#[inline(always)]
pub fn cmpde(&mut self, n: u8) -> CMPDE_W<DIERrs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
CMPDE_W::new(self, n + 16)
}
#[inline(always)]
pub fn cmp1de(&mut self) -> CMPDE_W<DIERrs> {
CMPDE_W::new(self, 16)
}
#[inline(always)]
pub fn cmp2de(&mut self) -> CMPDE_W<DIERrs> {
CMPDE_W::new(self, 17)
}
#[inline(always)]
pub fn cmp3de(&mut self) -> CMPDE_W<DIERrs> {
CMPDE_W::new(self, 18)
}
#[inline(always)]
pub fn cmp4de(&mut self) -> CMPDE_W<DIERrs> {
CMPDE_W::new(self, 19)
}
#[inline(always)]
pub fn repde(&mut self) -> REPDE_W<DIERrs> {
REPDE_W::new(self, 20)
}
#[inline(always)]
pub fn syncde(&mut self) -> SYNCDE_W<DIERrs> {
SYNCDE_W::new(self, 21)
}
#[inline(always)]
pub fn updde(&mut self) -> UPDDE_W<DIERrs> {
UPDDE_W::new(self, 22)
}
}
pub struct DIERrs;
impl crate::RegisterSpec for DIERrs {
type Ux = u32;
}
impl crate::Readable for DIERrs {}
impl crate::Writable for DIERrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for DIERrs {}