pub type R = crate::R<FLTINR2rs>;
pub type W = crate::W<FLTINR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT5E {
Disabled = 0,
Enabled = 1,
}
impl From<FLT5E> for bool {
#[inline(always)]
fn from(variant: FLT5E) -> Self {
variant as u8 != 0
}
}
pub type FLTE_R = crate::BitReader<FLT5E>;
impl FLTE_R {
#[inline(always)]
pub const fn variant(&self) -> FLT5E {
match self.bits {
false => FLT5E::Disabled,
true => FLT5E::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FLT5E::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FLT5E::Enabled
}
}
pub type FLTE_W<'a, REG> = crate::BitWriter<'a, REG, FLT5E>;
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(FLT5E::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FLT5E::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT5P {
ActiveLow = 0,
ActiveHigh = 1,
}
impl From<FLT5P> for bool {
#[inline(always)]
fn from(variant: FLT5P) -> Self {
variant as u8 != 0
}
}
pub type FLTP_R = crate::BitReader<FLT5P>;
impl FLTP_R {
#[inline(always)]
pub const fn variant(&self) -> FLT5P {
match self.bits {
false => FLT5P::ActiveLow,
true => FLT5P::ActiveHigh,
}
}
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == FLT5P::ActiveLow
}
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == FLT5P::ActiveHigh
}
}
pub type FLTP_W<'a, REG> = crate::BitWriter<'a, REG, FLT5P>;
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(FLT5P::ActiveLow)
}
#[inline(always)]
pub fn active_high(self) -> &'a mut crate::W<REG> {
self.variant(FLT5P::ActiveHigh)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT5SRC {
Input = 0,
Internal = 1,
}
impl From<FLT5SRC> for bool {
#[inline(always)]
fn from(variant: FLT5SRC) -> Self {
variant as u8 != 0
}
}
pub type FLTSRC_R = crate::BitReader<FLT5SRC>;
impl FLTSRC_R {
#[inline(always)]
pub const fn variant(&self) -> FLT5SRC {
match self.bits {
false => FLT5SRC::Input,
true => FLT5SRC::Internal,
}
}
#[inline(always)]
pub fn is_input(&self) -> bool {
*self == FLT5SRC::Input
}
#[inline(always)]
pub fn is_internal(&self) -> bool {
*self == FLT5SRC::Internal
}
}
pub type FLTSRC_W<'a, REG> = crate::BitWriter<'a, REG, FLT5SRC>;
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(FLT5SRC::Input)
}
#[inline(always)]
pub fn internal(self) -> &'a mut crate::W<REG> {
self.variant(FLT5SRC::Internal)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FLT5F {
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<FLT5F> for u8 {
#[inline(always)]
fn from(variant: FLT5F) -> Self {
variant as _
}
}
impl crate::FieldSpec for FLT5F {
type Ux = u8;
}
impl crate::IsEnum for FLT5F {}
pub type FLTF_R = crate::FieldReader<FLT5F>;
impl FLTF_R {
#[inline(always)]
pub const fn variant(&self) -> FLT5F {
match self.bits {
0 => FLT5F::Disabled,
1 => FLT5F::Div1N2,
2 => FLT5F::Div1N4,
3 => FLT5F::Div1N8,
4 => FLT5F::Div2N6,
5 => FLT5F::Div2N8,
6 => FLT5F::Div4N6,
7 => FLT5F::Div4N8,
8 => FLT5F::Div8N6,
9 => FLT5F::Div8N8,
10 => FLT5F::Div16N5,
11 => FLT5F::Div16N6,
12 => FLT5F::Div16N8,
13 => FLT5F::Div32N5,
14 => FLT5F::Div32N6,
15 => FLT5F::Div32N8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FLT5F::Disabled
}
#[inline(always)]
pub fn is_div1_n2(&self) -> bool {
*self == FLT5F::Div1N2
}
#[inline(always)]
pub fn is_div1_n4(&self) -> bool {
*self == FLT5F::Div1N4
}
#[inline(always)]
pub fn is_div1_n8(&self) -> bool {
*self == FLT5F::Div1N8
}
#[inline(always)]
pub fn is_div2_n6(&self) -> bool {
*self == FLT5F::Div2N6
}
#[inline(always)]
pub fn is_div2_n8(&self) -> bool {
*self == FLT5F::Div2N8
}
#[inline(always)]
pub fn is_div4_n6(&self) -> bool {
*self == FLT5F::Div4N6
}
#[inline(always)]
pub fn is_div4_n8(&self) -> bool {
*self == FLT5F::Div4N8
}
#[inline(always)]
pub fn is_div8_n6(&self) -> bool {
*self == FLT5F::Div8N6
}
#[inline(always)]
pub fn is_div8_n8(&self) -> bool {
*self == FLT5F::Div8N8
}
#[inline(always)]
pub fn is_div16_n5(&self) -> bool {
*self == FLT5F::Div16N5
}
#[inline(always)]
pub fn is_div16_n6(&self) -> bool {
*self == FLT5F::Div16N6
}
#[inline(always)]
pub fn is_div16_n8(&self) -> bool {
*self == FLT5F::Div16N8
}
#[inline(always)]
pub fn is_div32_n5(&self) -> bool {
*self == FLT5F::Div32N5
}
#[inline(always)]
pub fn is_div32_n6(&self) -> bool {
*self == FLT5F::Div32N6
}
#[inline(always)]
pub fn is_div32_n8(&self) -> bool {
*self == FLT5F::Div32N8
}
}
pub type FLTF_W<'a, REG> = crate::FieldWriter<'a, REG, 4, FLT5F, 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(FLT5F::Disabled)
}
#[inline(always)]
pub fn div1_n2(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div1N2)
}
#[inline(always)]
pub fn div1_n4(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div1N4)
}
#[inline(always)]
pub fn div1_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div1N8)
}
#[inline(always)]
pub fn div2_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div2N6)
}
#[inline(always)]
pub fn div2_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div2N8)
}
#[inline(always)]
pub fn div4_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div4N6)
}
#[inline(always)]
pub fn div4_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div4N8)
}
#[inline(always)]
pub fn div8_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div8N6)
}
#[inline(always)]
pub fn div8_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div8N8)
}
#[inline(always)]
pub fn div16_n5(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div16N5)
}
#[inline(always)]
pub fn div16_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div16N6)
}
#[inline(always)]
pub fn div16_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div16N8)
}
#[inline(always)]
pub fn div32_n5(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div32N5)
}
#[inline(always)]
pub fn div32_n6(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div32N6)
}
#[inline(always)]
pub fn div32_n8(self) -> &'a mut crate::W<REG> {
self.variant(FLT5F::Div32N8)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT5LCKR {
Unlocked = 0,
Locked = 1,
}
impl From<FLT5LCKR> for bool {
#[inline(always)]
fn from(variant: FLT5LCKR) -> Self {
variant as u8 != 0
}
}
pub type FLT5LCK_R = crate::BitReader<FLT5LCKR>;
impl FLT5LCK_R {
#[inline(always)]
pub const fn variant(&self) -> FLT5LCKR {
match self.bits {
false => FLT5LCKR::Unlocked,
true => FLT5LCKR::Locked,
}
}
#[inline(always)]
pub fn is_unlocked(&self) -> bool {
*self == FLT5LCKR::Unlocked
}
#[inline(always)]
pub fn is_locked(&self) -> bool {
*self == FLT5LCKR::Locked
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FLT5LCKW {
Lock = 1,
}
impl From<FLT5LCKW> for bool {
#[inline(always)]
fn from(variant: FLT5LCKW) -> Self {
variant as u8 != 0
}
}
pub type FLT5LCK_W<'a, REG> = crate::BitWriter<'a, REG, FLT5LCKW>;
impl<'a, REG> FLT5LCK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn lock(self) -> &'a mut crate::W<REG> {
self.variant(FLT5LCKW::Lock)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum FLTSD {
Div1 = 0,
Div2 = 1,
Div4 = 2,
Div8 = 3,
}
impl From<FLTSD> for u8 {
#[inline(always)]
fn from(variant: FLTSD) -> Self {
variant as _
}
}
impl crate::FieldSpec for FLTSD {
type Ux = u8;
}
impl crate::IsEnum for FLTSD {}
pub type FLTSD_R = crate::FieldReader<FLTSD>;
impl FLTSD_R {
#[inline(always)]
pub const fn variant(&self) -> FLTSD {
match self.bits {
0 => FLTSD::Div1,
1 => FLTSD::Div2,
2 => FLTSD::Div4,
3 => FLTSD::Div8,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_div1(&self) -> bool {
*self == FLTSD::Div1
}
#[inline(always)]
pub fn is_div2(&self) -> bool {
*self == FLTSD::Div2
}
#[inline(always)]
pub fn is_div4(&self) -> bool {
*self == FLTSD::Div4
}
#[inline(always)]
pub fn is_div8(&self) -> bool {
*self == FLTSD::Div8
}
}
pub type FLTSD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FLTSD, crate::Safe>;
impl<'a, REG> FLTSD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn div1(self) -> &'a mut crate::W<REG> {
self.variant(FLTSD::Div1)
}
#[inline(always)]
pub fn div2(self) -> &'a mut crate::W<REG> {
self.variant(FLTSD::Div2)
}
#[inline(always)]
pub fn div4(self) -> &'a mut crate::W<REG> {
self.variant(FLTSD::Div4)
}
#[inline(always)]
pub fn div8(self) -> &'a mut crate::W<REG> {
self.variant(FLTSD::Div8)
}
}
impl R {
#[inline(always)]
pub fn flte(&self, n: u8) -> FLTE_R {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTE_R::new(((self.bits >> (n * 0)) & 1) != 0)
}
#[inline(always)]
pub fn flte_iter(&self) -> impl Iterator<Item = FLTE_R> + '_ {
(0..1).map(move |n| FLTE_R::new(((self.bits >> (n * 0)) & 1) != 0))
}
#[inline(always)]
pub fn flt5e(&self) -> FLTE_R {
FLTE_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn fltp(&self, n: u8) -> FLTP_R {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTP_R::new(((self.bits >> (n * 0 + 1)) & 1) != 0)
}
#[inline(always)]
pub fn fltp_iter(&self) -> impl Iterator<Item = FLTP_R> + '_ {
(0..1).map(move |n| FLTP_R::new(((self.bits >> (n * 0 + 1)) & 1) != 0))
}
#[inline(always)]
pub fn flt5p(&self) -> FLTP_R {
FLTP_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn fltsrc(&self, n: u8) -> FLTSRC_R {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTSRC_R::new(((self.bits >> (n * 0 + 2)) & 1) != 0)
}
#[inline(always)]
pub fn fltsrc_iter(&self) -> impl Iterator<Item = FLTSRC_R> + '_ {
(0..1).map(move |n| FLTSRC_R::new(((self.bits >> (n * 0 + 2)) & 1) != 0))
}
#[inline(always)]
pub fn flt5src(&self) -> FLTSRC_R {
FLTSRC_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn fltf(&self, n: u8) -> FLTF_R {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTF_R::new(((self.bits >> (n * 0 + 3)) & 0x0f) as u8)
}
#[inline(always)]
pub fn fltf_iter(&self) -> impl Iterator<Item = FLTF_R> + '_ {
(0..1).map(move |n| FLTF_R::new(((self.bits >> (n * 0 + 3)) & 0x0f) as u8))
}
#[inline(always)]
pub fn flt5f(&self) -> FLTF_R {
FLTF_R::new(((self.bits >> 3) & 0x0f) as u8)
}
#[inline(always)]
pub fn flt5lck(&self) -> FLT5LCK_R {
FLT5LCK_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn fltsd(&self) -> FLTSD_R {
FLTSD_R::new(((self.bits >> 24) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("FLTINR2")
.field("fltsd", &self.fltsd())
.field("flt5lck", &self.flt5lck())
.field("flt5f", &self.flt5f())
.field("flt5src", &self.flt5src())
.field("flt5p", &self.flt5p())
.field("flt5e", &self.flt5e())
.finish()
}
}
impl W {
#[inline(always)]
pub fn flte(&mut self, n: u8) -> FLTE_W<FLTINR2rs> {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTE_W::new(self, n * 0)
}
#[inline(always)]
pub fn flt5e(&mut self) -> FLTE_W<FLTINR2rs> {
FLTE_W::new(self, 0)
}
#[inline(always)]
pub fn fltp(&mut self, n: u8) -> FLTP_W<FLTINR2rs> {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTP_W::new(self, n * 0 + 1)
}
#[inline(always)]
pub fn flt5p(&mut self) -> FLTP_W<FLTINR2rs> {
FLTP_W::new(self, 1)
}
#[inline(always)]
pub fn fltsrc(&mut self, n: u8) -> FLTSRC_W<FLTINR2rs> {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTSRC_W::new(self, n * 0 + 2)
}
#[inline(always)]
pub fn flt5src(&mut self) -> FLTSRC_W<FLTINR2rs> {
FLTSRC_W::new(self, 2)
}
#[inline(always)]
pub fn fltf(&mut self, n: u8) -> FLTF_W<FLTINR2rs> {
#[allow(clippy::no_effect)] [(); 1][n as usize];
FLTF_W::new(self, n * 0 + 3)
}
#[inline(always)]
pub fn flt5f(&mut self) -> FLTF_W<FLTINR2rs> {
FLTF_W::new(self, 3)
}
#[inline(always)]
pub fn flt5lck(&mut self) -> FLT5LCK_W<FLTINR2rs> {
FLT5LCK_W::new(self, 7)
}
#[inline(always)]
pub fn fltsd(&mut self) -> FLTSD_W<FLTINR2rs> {
FLTSD_W::new(self, 24)
}
}
pub struct FLTINR2rs;
impl crate::RegisterSpec for FLTINR2rs {
type Ux = u32;
}
impl crate::Readable for FLTINR2rs {}
impl crate::Writable for FLTINR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for FLTINR2rs {}