pub type R = crate::R<FLTRrs>;
pub type W = crate::W<FLTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DNF {
NoFilter = 0,
Filter1 = 1,
Filter2 = 2,
Filter3 = 3,
Filter4 = 4,
Filter5 = 5,
Filter6 = 6,
Filter7 = 7,
Filter8 = 8,
Filter9 = 9,
Filter10 = 10,
Filter11 = 11,
Filter12 = 12,
Filter13 = 13,
Filter14 = 14,
Filter15 = 15,
}
impl From<DNF> for u8 {
#[inline(always)]
fn from(variant: DNF) -> Self {
variant as _
}
}
impl crate::FieldSpec for DNF {
type Ux = u8;
}
impl crate::IsEnum for DNF {}
pub type DNF_R = crate::FieldReader<DNF>;
impl DNF_R {
#[inline(always)]
pub const fn variant(&self) -> DNF {
match self.bits {
0 => DNF::NoFilter,
1 => DNF::Filter1,
2 => DNF::Filter2,
3 => DNF::Filter3,
4 => DNF::Filter4,
5 => DNF::Filter5,
6 => DNF::Filter6,
7 => DNF::Filter7,
8 => DNF::Filter8,
9 => DNF::Filter9,
10 => DNF::Filter10,
11 => DNF::Filter11,
12 => DNF::Filter12,
13 => DNF::Filter13,
14 => DNF::Filter14,
15 => DNF::Filter15,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_no_filter(&self) -> bool {
*self == DNF::NoFilter
}
#[inline(always)]
pub fn is_filter1(&self) -> bool {
*self == DNF::Filter1
}
#[inline(always)]
pub fn is_filter2(&self) -> bool {
*self == DNF::Filter2
}
#[inline(always)]
pub fn is_filter3(&self) -> bool {
*self == DNF::Filter3
}
#[inline(always)]
pub fn is_filter4(&self) -> bool {
*self == DNF::Filter4
}
#[inline(always)]
pub fn is_filter5(&self) -> bool {
*self == DNF::Filter5
}
#[inline(always)]
pub fn is_filter6(&self) -> bool {
*self == DNF::Filter6
}
#[inline(always)]
pub fn is_filter7(&self) -> bool {
*self == DNF::Filter7
}
#[inline(always)]
pub fn is_filter8(&self) -> bool {
*self == DNF::Filter8
}
#[inline(always)]
pub fn is_filter9(&self) -> bool {
*self == DNF::Filter9
}
#[inline(always)]
pub fn is_filter10(&self) -> bool {
*self == DNF::Filter10
}
#[inline(always)]
pub fn is_filter11(&self) -> bool {
*self == DNF::Filter11
}
#[inline(always)]
pub fn is_filter12(&self) -> bool {
*self == DNF::Filter12
}
#[inline(always)]
pub fn is_filter13(&self) -> bool {
*self == DNF::Filter13
}
#[inline(always)]
pub fn is_filter14(&self) -> bool {
*self == DNF::Filter14
}
#[inline(always)]
pub fn is_filter15(&self) -> bool {
*self == DNF::Filter15
}
}
pub type DNF_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DNF, crate::Safe>;
impl<'a, REG> DNF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn no_filter(self) -> &'a mut crate::W<REG> {
self.variant(DNF::NoFilter)
}
#[inline(always)]
pub fn filter1(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter1)
}
#[inline(always)]
pub fn filter2(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter2)
}
#[inline(always)]
pub fn filter3(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter3)
}
#[inline(always)]
pub fn filter4(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter4)
}
#[inline(always)]
pub fn filter5(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter5)
}
#[inline(always)]
pub fn filter6(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter6)
}
#[inline(always)]
pub fn filter7(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter7)
}
#[inline(always)]
pub fn filter8(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter8)
}
#[inline(always)]
pub fn filter9(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter9)
}
#[inline(always)]
pub fn filter10(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter10)
}
#[inline(always)]
pub fn filter11(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter11)
}
#[inline(always)]
pub fn filter12(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter12)
}
#[inline(always)]
pub fn filter13(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter13)
}
#[inline(always)]
pub fn filter14(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter14)
}
#[inline(always)]
pub fn filter15(self) -> &'a mut crate::W<REG> {
self.variant(DNF::Filter15)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ANOFF {
Enabled = 0,
Disabled = 1,
}
impl From<ANOFF> for bool {
#[inline(always)]
fn from(variant: ANOFF) -> Self {
variant as u8 != 0
}
}
pub type ANOFF_R = crate::BitReader<ANOFF>;
impl ANOFF_R {
#[inline(always)]
pub const fn variant(&self) -> ANOFF {
match self.bits {
false => ANOFF::Enabled,
true => ANOFF::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ANOFF::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ANOFF::Disabled
}
}
pub type ANOFF_W<'a, REG> = crate::BitWriter<'a, REG, ANOFF>;
impl<'a, REG> ANOFF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ANOFF::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ANOFF::Disabled)
}
}
impl R {
#[inline(always)]
pub fn dnf(&self) -> DNF_R {
DNF_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn anoff(&self) -> ANOFF_R {
ANOFF_R::new(((self.bits >> 4) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FLTR")
.field("anoff", &self.anoff())
.field("dnf", &self.dnf())
.finish()
}
}
impl W {
#[inline(always)]
pub fn dnf(&mut self) -> DNF_W<FLTRrs> {
DNF_W::new(self, 0)
}
#[inline(always)]
pub fn anoff(&mut self) -> ANOFF_W<FLTRrs> {
ANOFF_W::new(self, 4)
}
}
pub struct FLTRrs;
impl crate::RegisterSpec for FLTRrs {
type Ux = u32;
}
impl crate::Readable for FLTRrs {}
impl crate::Writable for FLTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for FLTRrs {}