pub type R = crate::R<FLTINR1rs>;
pub type W = crate::W<FLTINR1rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT1E {
Disabled = 0,
Enabled = 1,
}
impl From<FLT1E> for bool {
#[inline(always)]
fn from(variant: FLT1E) -> Self {
variant as u8 != 0
}
}
pub type FLTE_R = crate::BitReader<FLT1E>;
impl FLTE_R {
#[inline(always)]
pub const fn variant(&self) -> FLT1E {
match self.bits {
false => FLT1E::Disabled,
true => FLT1E::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FLT1E::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FLT1E::Enabled
}
}
pub type FLTE_W<'a, REG> = crate::BitWriter<'a, REG, FLT1E>;
impl<'a, REG> FLTE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FLT1E::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FLT1E::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT1P {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<FLT1P> for bool {
#[inline(always)]
fn from(variant: FLT1P) -> Self {
variant as u8 != 0
}
}
pub type FLTP_R = crate::BitReader<FLT1P>;
impl FLTP_R {
#[inline(always)]
pub const fn variant(&self) -> FLT1P {
match self.bits {
false => FLT1P::ActiveLow,
true => FLT1P::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == FLT1P::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == FLT1P::ActiveHigh
}
}
pub type FLTP_W<'a, REG> = crate::BitWriter<'a, REG, FLT1P>;
impl<'a, REG> FLTP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn active_low(self) -> &'a mut crate::W<REG> {
self.variant(FLT1P::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(FLT1P::ActiveHigh)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT1SRC {
Input = 0,
Internal = 1,
}
impl From<FLT1SRC> for bool {
#[inline(always)]
fn from(variant: FLT1SRC) -> Self {
variant as u8 != 0
}
}
pub type FLTSRC_R = crate::BitReader<FLT1SRC>;
impl FLTSRC_R {
#[inline(always)]
pub const fn variant(&self) -> FLT1SRC {
match self.bits {
false => FLT1SRC::Input,
true => FLT1SRC::Internal,
}
}
#[inline(always)]
pub fn is_input(&self) -> bool {
*self == FLT1SRC::Input
}
#[inline(always)]
pub fn is_internal(&self) -> bool {
*self == FLT1SRC::Internal
}
}
pub type FLTSRC_W<'a, REG> = crate::BitWriter<'a, REG, FLT1SRC>;
impl<'a, REG> FLTSRC_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn input(self) -> &'a mut crate::W<REG> {
self.variant(FLT1SRC::Input)
}
#[inline(always)]
pub fn internal(self) -> &'a mut crate::W<REG> {
self.variant(FLT1SRC::Internal)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FLT1F {
Disabled = 0,
Div1N2 = 1,
Div1N4 = 2,
Div1N8 = 3,
Div2N6 = 4,
Div2N8 = 5,
Div4N6 = 6,
Div4N8 = 7,
Div8N6 = 8,
Div8N8 = 9,
Div16N5 = 10,
Div16N6 = 11,
Div16N8 = 12,
Div32N5 = 13,
Div32N6 = 14,
Div32N8 = 15,
}
impl From<FLT1F> for u8 {
#[inline(always)]
fn from(variant: FLT1F) -> Self {
variant as _
}
}
impl crate::FieldSpec for FLT1F {
type Ux = u8;
}
impl crate::IsEnum for FLT1F {}
pub type FLTF_R = crate::FieldReader<FLT1F>;
impl FLTF_R {
#[inline(always)]
pub const fn variant(&self) -> FLT1F {
match self.bits {
0 => FLT1F::Disabled,
1 => FLT1F::Div1N2,
2 => FLT1F::Div1N4,
3 => FLT1F::Div1N8,
4 => FLT1F::Div2N6,
5 => FLT1F::Div2N8,
6 => FLT1F::Div4N6,
7 => FLT1F::Div4N8,
8 => FLT1F::Div8N6,
9 => FLT1F::Div8N8,
10 => FLT1F::Div16N5,
11 => FLT1F::Div16N6,
12 => FLT1F::Div16N8,
13 => FLT1F::Div32N5,
14 => FLT1F::Div32N6,
15 => FLT1F::Div32N8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FLT1F::Disabled
}
#[inline(always)]
pub fn is_div1_n2(&self) -> bool {
*self == FLT1F::Div1N2
}
#[inline(always)]
pub fn is_div1_n4(&self) -> bool {
*self == FLT1F::Div1N4
}
#[inline(always)]
pub fn is_div1_n8(&self) -> bool {
*self == FLT1F::Div1N8
}
#[inline(always)]
pub fn is_div2_n6(&self) -> bool {
*self == FLT1F::Div2N6
}
#[inline(always)]
pub fn is_div2_n8(&self) -> bool {
*self == FLT1F::Div2N8
}
#[inline(always)]
pub fn is_div4_n6(&self) -> bool {
*self == FLT1F::Div4N6
}
#[inline(always)]
pub fn is_div4_n8(&self) -> bool {
*self == FLT1F::Div4N8
}
#[inline(always)]
pub fn is_div8_n6(&self) -> bool {
*self == FLT1F::Div8N6
}
#[inline(always)]
pub fn is_div8_n8(&self) -> bool {
*self == FLT1F::Div8N8
}
#[inline(always)]
pub fn is_div16_n5(&self) -> bool {
*self == FLT1F::Div16N5
}
#[inline(always)]
pub fn is_div16_n6(&self) -> bool {
*self == FLT1F::Div16N6
}
#[inline(always)]
pub fn is_div16_n8(&self) -> bool {
*self == FLT1F::Div16N8
}
#[inline(always)]
pub fn is_div32_n5(&self) -> bool {
*self == FLT1F::Div32N5
}
#[inline(always)]
pub fn is_div32_n6(&self) -> bool {
*self == FLT1F::Div32N6
}
#[inline(always)]
pub fn is_div32_n8(&self) -> bool {
*self == FLT1F::Div32N8
}
}
pub type FLTF_W<'a, REG> = crate::FieldWriter<'a, REG, 4, FLT1F, crate::Safe>;
impl<'a, REG> FLTF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Disabled)
}
#[inline(always)]
pub fn div1_n2(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div1N2)
}
#[inline(always)]
pub fn div1_n4(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div1N4)
}
#[inline(always)]
pub fn div1_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div1N8)
}
#[inline(always)]
pub fn div2_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div2N6)
}
#[inline(always)]
pub fn div2_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div2N8)
}
#[inline(always)]
pub fn div4_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div4N6)
}
#[inline(always)]
pub fn div4_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div4N8)
}
#[inline(always)]
pub fn div8_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div8N6)
}
#[inline(always)]
pub fn div8_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div8N8)
}
#[inline(always)]
pub fn div16_n5(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div16N5)
}
#[inline(always)]
pub fn div16_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div16N6)
}
#[inline(always)]
pub fn div16_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div16N8)
}
#[inline(always)]
pub fn div32_n5(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div32N5)
}
#[inline(always)]
pub fn div32_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div32N6)
}
#[inline(always)]
pub fn div32_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT1F::Div32N8)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT1LCKR {
Unlocked = 0,
Locked = 1,
}
impl From<FLT1LCKR> for bool {
#[inline(always)]
fn from(variant: FLT1LCKR) -> Self {
variant as u8 != 0
}
}
pub type FLT1LCK_R = crate::BitReader<FLT1LCKR>;
impl FLT1LCK_R {
#[inline(always)]
pub const fn variant(&self) -> FLT1LCKR {
match self.bits {
false => FLT1LCKR::Unlocked,
true => FLT1LCKR::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == FLT1LCKR::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == FLT1LCKR::Locked
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT1LCKW {
Lock = 1,
}
impl From<FLT1LCKW> for bool {
#[inline(always)]
fn from(variant: FLT1LCKW) -> Self {
variant as u8 != 0
}
}
pub type FLT1LCK_W<'a, REG> = crate::BitWriter<'a, REG, FLT1LCKW>;
impl<'a, REG> FLT1LCK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn lock(self) -> &'a mut crate::W<REG> {
self.variant(FLT1LCKW::Lock)
}
}
pub use FLT1LCK_R as FLT2LCK_R;
pub use FLT1LCK_R as FLT3LCK_R;
pub use FLT1LCK_R as FLT4LCK_R;
pub use FLT1LCK_W as FLT2LCK_W;
pub use FLT1LCK_W as FLT3LCK_W;
pub use FLT1LCK_W as FLT4LCK_W;
impl R {
#[inline(always)]
pub fn flte(&self, n: u8) -> FLTE_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTE_R::new(((self.bits >> (n * 8)) & 1) != 0)
}
#[inline(always)]
pub fn flte_iter(&self) -> impl Iterator<Item = FLTE_R> + '_ {
(0..4).map(move |n| FLTE_R::new(((self.bits >> (n * 8)) & 1) != 0))
}
#[inline(always)]
pub fn flt1e(&self) -> FLTE_R {
FLTE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn flt2e(&self) -> FLTE_R {
FLTE_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn flt3e(&self) -> FLTE_R {
FLTE_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn flt4e(&self) -> FLTE_R {
FLTE_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn fltp(&self, n: u8) -> FLTP_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTP_R::new(((self.bits >> (n * 8 + 1)) & 1) != 0)
}
#[inline(always)]
pub fn fltp_iter(&self) -> impl Iterator<Item = FLTP_R> + '_ {
(0..4).map(move |n| FLTP_R::new(((self.bits >> (n * 8 + 1)) & 1) != 0))
}
#[inline(always)]
pub fn flt1p(&self) -> FLTP_R {
FLTP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn flt2p(&self) -> FLTP_R {
FLTP_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn flt3p(&self) -> FLTP_R {
FLTP_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn flt4p(&self) -> FLTP_R {
FLTP_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn fltsrc(&self, n: u8) -> FLTSRC_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTSRC_R::new(((self.bits >> (n * 8 + 2)) & 1) != 0)
}
#[inline(always)]
pub fn fltsrc_iter(&self) -> impl Iterator<Item = FLTSRC_R> + '_ {
(0..4).map(move |n| FLTSRC_R::new(((self.bits >> (n * 8 + 2)) & 1) != 0))
}
#[inline(always)]
pub fn flt1src(&self) -> FLTSRC_R {
FLTSRC_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn flt2src(&self) -> FLTSRC_R {
FLTSRC_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn flt3src(&self) -> FLTSRC_R {
FLTSRC_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn flt4src(&self) -> FLTSRC_R {
FLTSRC_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn fltf(&self, n: u8) -> FLTF_R {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTF_R::new(((self.bits >> (n * 8 + 3)) & 0x0f) as u8)
}
#[inline(always)]
pub fn fltf_iter(&self) -> impl Iterator<Item = FLTF_R> + '_ {
(0..4).map(move |n| FLTF_R::new(((self.bits >> (n * 8 + 3)) & 0x0f) as u8))
}
#[inline(always)]
pub fn flt1f(&self) -> FLTF_R {
FLTF_R::new(((self.bits >> 3) & 0x0f) as u8)
}
#[inline(always)]
pub fn flt2f(&self) -> FLTF_R {
FLTF_R::new(((self.bits >> 11) & 0x0f) as u8)
}
#[inline(always)]
pub fn flt3f(&self) -> FLTF_R {
FLTF_R::new(((self.bits >> 19) & 0x0f) as u8)
}
#[inline(always)]
pub fn flt4f(&self) -> FLTF_R {
FLTF_R::new(((self.bits >> 27) & 0x0f) as u8)
}
#[inline(always)]
pub fn flt1lck(&self) -> FLT1LCK_R {
FLT1LCK_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn flt2lck(&self) -> FLT2LCK_R {
FLT2LCK_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn flt3lck(&self) -> FLT3LCK_R {
FLT3LCK_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn flt4lck(&self) -> FLT4LCK_R {
FLT4LCK_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FLTINR1")
.field("flt1lck", &self.flt1lck())
.field("flt4lck", &self.flt4lck())
.field("flt1f", &self.flt1f())
.field("flt2f", &self.flt2f())
.field("flt3f", &self.flt3f())
.field("flt4f", &self.flt4f())
.field("flt1src", &self.flt1src())
.field("flt2src", &self.flt2src())
.field("flt3src", &self.flt3src())
.field("flt4src", &self.flt4src())
.field("flt1p", &self.flt1p())
.field("flt2p", &self.flt2p())
.field("flt3p", &self.flt3p())
.field("flt4p", &self.flt4p())
.field("flt1e", &self.flt1e())
.field("flt2e", &self.flt2e())
.field("flt3e", &self.flt3e())
.field("flt4e", &self.flt4e())
.field("flt3lck", &self.flt3lck())
.field("flt2lck", &self.flt2lck())
.finish()
}
}
impl W {
#[inline(always)]
pub fn flte(&mut self, n: u8) -> FLTE_W<FLTINR1rs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTE_W::new(self, n * 8)
}
#[inline(always)]
pub fn flt1e(&mut self) -> FLTE_W<FLTINR1rs> {
FLTE_W::new(self, 0)
}
#[inline(always)]
pub fn flt2e(&mut self) -> FLTE_W<FLTINR1rs> {
FLTE_W::new(self, 8)
}
#[inline(always)]
pub fn flt3e(&mut self) -> FLTE_W<FLTINR1rs> {
FLTE_W::new(self, 16)
}
#[inline(always)]
pub fn flt4e(&mut self) -> FLTE_W<FLTINR1rs> {
FLTE_W::new(self, 24)
}
#[inline(always)]
pub fn fltp(&mut self, n: u8) -> FLTP_W<FLTINR1rs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTP_W::new(self, n * 8 + 1)
}
#[inline(always)]
pub fn flt1p(&mut self) -> FLTP_W<FLTINR1rs> {
FLTP_W::new(self, 1)
}
#[inline(always)]
pub fn flt2p(&mut self) -> FLTP_W<FLTINR1rs> {
FLTP_W::new(self, 9)
}
#[inline(always)]
pub fn flt3p(&mut self) -> FLTP_W<FLTINR1rs> {
FLTP_W::new(self, 17)
}
#[inline(always)]
pub fn flt4p(&mut self) -> FLTP_W<FLTINR1rs> {
FLTP_W::new(self, 25)
}
#[inline(always)]
pub fn fltsrc(&mut self, n: u8) -> FLTSRC_W<FLTINR1rs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTSRC_W::new(self, n * 8 + 2)
}
#[inline(always)]
pub fn flt1src(&mut self) -> FLTSRC_W<FLTINR1rs> {
FLTSRC_W::new(self, 2)
}
#[inline(always)]
pub fn flt2src(&mut self) -> FLTSRC_W<FLTINR1rs> {
FLTSRC_W::new(self, 10)
}
#[inline(always)]
pub fn flt3src(&mut self) -> FLTSRC_W<FLTINR1rs> {
FLTSRC_W::new(self, 18)
}
#[inline(always)]
pub fn flt4src(&mut self) -> FLTSRC_W<FLTINR1rs> {
FLTSRC_W::new(self, 26)
}
#[inline(always)]
pub fn fltf(&mut self, n: u8) -> FLTF_W<FLTINR1rs> {
#[allow(clippy::no_effect)] [(); 4][n as usize];
FLTF_W::new(self, n * 8 + 3)
}
#[inline(always)]
pub fn flt1f(&mut self) -> FLTF_W<FLTINR1rs> {
FLTF_W::new(self, 3)
}
#[inline(always)]
pub fn flt2f(&mut self) -> FLTF_W<FLTINR1rs> {
FLTF_W::new(self, 11)
}
#[inline(always)]
pub fn flt3f(&mut self) -> FLTF_W<FLTINR1rs> {
FLTF_W::new(self, 19)
}
#[inline(always)]
pub fn flt4f(&mut self) -> FLTF_W<FLTINR1rs> {
FLTF_W::new(self, 27)
}
#[inline(always)]
pub fn flt1lck(&mut self) -> FLT1LCK_W<FLTINR1rs> {
FLT1LCK_W::new(self, 7)
}
#[inline(always)]
pub fn flt2lck(&mut self) -> FLT2LCK_W<FLTINR1rs> {
FLT2LCK_W::new(self, 15)
}
#[inline(always)]
pub fn flt3lck(&mut self) -> FLT3LCK_W<FLTINR1rs> {
FLT3LCK_W::new(self, 23)
}
#[inline(always)]
pub fn flt4lck(&mut self) -> FLT4LCK_W<FLTINR1rs> {
FLT4LCK_W::new(self, 31)
}
}
pub struct FLTINR1rs;
impl crate::RegisterSpec for FLTINR1rs {
type Ux = u32;
}
impl crate::Readable for FLTINR1rs {}
impl crate::Writable for FLTINR1rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for FLTINR1rs {}