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 UIE {
Disabled = 0,
Enabled = 1,
}
impl From<UIE> for bool {
#[inline(always)]
fn from(variant: UIE) -> Self {
variant as u8 != 0
}
}
pub type UIE_R = crate::BitReader<UIE>;
impl UIE_R {
#[inline(always)]
pub const fn variant(&self) -> UIE {
match self.bits {
false => UIE::Disabled,
true => UIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == UIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == UIE::Enabled
}
}
pub type UIE_W<'a, REG> = crate::BitWriter<'a, REG, UIE>;
impl<'a, REG> UIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(UIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(UIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CC1IE {
Disabled = 0,
Enabled = 1,
}
impl From<CC1IE> for bool {
#[inline(always)]
fn from(variant: CC1IE) -> Self {
variant as u8 != 0
}
}
pub type CCIE_R = crate::BitReader<CC1IE>;
impl CCIE_R {
#[inline(always)]
pub const fn variant(&self) -> CC1IE {
match self.bits {
false => CC1IE::Disabled,
true => CC1IE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CC1IE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CC1IE::Enabled
}
}
pub type CCIE_W<'a, REG> = crate::BitWriter<'a, REG, CC1IE>;
impl<'a, REG> CCIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1IE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1IE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIE {
Disabled = 0,
Enabled = 1,
}
impl From<TIE> for bool {
#[inline(always)]
fn from(variant: TIE) -> Self {
variant as u8 != 0
}
}
pub type TIE_R = crate::BitReader<TIE>;
impl TIE_R {
#[inline(always)]
pub const fn variant(&self) -> TIE {
match self.bits {
false => TIE::Disabled,
true => TIE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TIE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TIE::Enabled
}
}
pub type TIE_W<'a, REG> = crate::BitWriter<'a, REG, TIE>;
impl<'a, REG> TIE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TIE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TIE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum UDE {
Disabled = 0,
Enabled = 1,
}
impl From<UDE> for bool {
#[inline(always)]
fn from(variant: UDE) -> Self {
variant as u8 != 0
}
}
pub type UDE_R = crate::BitReader<UDE>;
impl UDE_R {
#[inline(always)]
pub const fn variant(&self) -> UDE {
match self.bits {
false => UDE::Disabled,
true => UDE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == UDE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == UDE::Enabled
}
}
pub type UDE_W<'a, REG> = crate::BitWriter<'a, REG, UDE>;
impl<'a, REG> UDE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(UDE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(UDE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CC1DE {
Disabled = 0,
Enabled = 1,
}
impl From<CC1DE> for bool {
#[inline(always)]
fn from(variant: CC1DE) -> Self {
variant as u8 != 0
}
}
pub type CCDE_R = crate::BitReader<CC1DE>;
impl CCDE_R {
#[inline(always)]
pub const fn variant(&self) -> CC1DE {
match self.bits {
false => CC1DE::Disabled,
true => CC1DE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CC1DE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CC1DE::Enabled
}
}
pub type CCDE_W<'a, REG> = crate::BitWriter<'a, REG, CC1DE>;
impl<'a, REG> CCDE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1DE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CC1DE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TDE {
Disabled = 0,
Enabled = 1,
}
impl From<TDE> for bool {
#[inline(always)]
fn from(variant: TDE) -> Self {
variant as u8 != 0
}
}
pub type TDE_R = crate::BitReader<TDE>;
impl TDE_R {
#[inline(always)]
pub const fn variant(&self) -> TDE {
match self.bits {
false => TDE::Disabled,
true => TDE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == TDE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == TDE::Enabled
}
}
pub type TDE_W<'a, REG> = crate::BitWriter<'a, REG, TDE>;
impl<'a, REG> TDE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(TDE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(TDE::Enabled)
}
}
impl R {
#[inline(always)]
pub fn uie(&self) -> UIE_R {
UIE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn ccie(&self, n: u8) -> CCIE_R {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
CCIE_R::new(((self.bits >> (n + 1)) & 1) != 0)
}
#[inline(always)]
pub fn ccie_iter(&self) -> impl Iterator<Item = CCIE_R> + '_ {
(0..4).map(move |n| CCIE_R::new(((self.bits >> (n + 1)) & 1) != 0))
}
#[inline(always)]
pub fn cc1ie(&self) -> CCIE_R {
CCIE_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cc2ie(&self) -> CCIE_R {
CCIE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn cc3ie(&self) -> CCIE_R {
CCIE_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn cc4ie(&self) -> CCIE_R {
CCIE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn tie(&self) -> TIE_R {
TIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn ude(&self) -> UDE_R {
UDE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ccde(&self, n: u8) -> CCDE_R {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
CCDE_R::new(((self.bits >> (n + 9)) & 1) != 0)
}
#[inline(always)]
pub fn ccde_iter(&self) -> impl Iterator<Item = CCDE_R> + '_ {
(0..4).map(move |n| CCDE_R::new(((self.bits >> (n + 9)) & 1) != 0))
}
#[inline(always)]
pub fn cc1de(&self) -> CCDE_R {
CCDE_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn cc2de(&self) -> CCDE_R {
CCDE_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn cc3de(&self) -> CCDE_R {
CCDE_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn cc4de(&self) -> CCDE_R {
CCDE_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn tde(&self) -> TDE_R {
TDE_R::new(((self.bits >> 14) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("DIER")
.field("uie", &self.uie())
.field("cc1ie", &self.cc1ie())
.field("cc2ie", &self.cc2ie())
.field("cc3ie", &self.cc3ie())
.field("cc4ie", &self.cc4ie())
.field("tie", &self.tie())
.field("ude", &self.ude())
.field("cc1de", &self.cc1de())
.field("cc2de", &self.cc2de())
.field("cc3de", &self.cc3de())
.field("cc4de", &self.cc4de())
.field("tde", &self.tde())
.finish()
}
}
impl W {
#[inline(always)]
pub fn uie(&mut self) -> UIE_W<DIERrs> {
UIE_W::new(self, 0)
}
#[inline(always)]
pub fn ccie(&mut self, n: u8) -> CCIE_W<DIERrs> {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
CCIE_W::new(self, n + 1)
}
#[inline(always)]
pub fn cc1ie(&mut self) -> CCIE_W<DIERrs> {
CCIE_W::new(self, 1)
}
#[inline(always)]
pub fn cc2ie(&mut self) -> CCIE_W<DIERrs> {
CCIE_W::new(self, 2)
}
#[inline(always)]
pub fn cc3ie(&mut self) -> CCIE_W<DIERrs> {
CCIE_W::new(self, 3)
}
#[inline(always)]
pub fn cc4ie(&mut self) -> CCIE_W<DIERrs> {
CCIE_W::new(self, 4)
}
#[inline(always)]
pub fn tie(&mut self) -> TIE_W<DIERrs> {
TIE_W::new(self, 6)
}
#[inline(always)]
pub fn ude(&mut self) -> UDE_W<DIERrs> {
UDE_W::new(self, 8)
}
#[inline(always)]
pub fn ccde(&mut self, n: u8) -> CCDE_W<DIERrs> {
#[allow(clippy::no_effect)]
[(); 4][n as usize];
CCDE_W::new(self, n + 9)
}
#[inline(always)]
pub fn cc1de(&mut self) -> CCDE_W<DIERrs> {
CCDE_W::new(self, 9)
}
#[inline(always)]
pub fn cc2de(&mut self) -> CCDE_W<DIERrs> {
CCDE_W::new(self, 10)
}
#[inline(always)]
pub fn cc3de(&mut self) -> CCDE_W<DIERrs> {
CCDE_W::new(self, 11)
}
#[inline(always)]
pub fn cc4de(&mut self) -> CCDE_W<DIERrs> {
CCDE_W::new(self, 12)
}
#[inline(always)]
pub fn tde(&mut self) -> TDE_W<DIERrs> {
TDE_W::new(self, 14)
}
}
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 {}