pub type R = crate::R<CFGR2rs>;
pub type W = crate::W<CFGR2rs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXFILTDIS {
Enabled = 0,
Disabled = 1,
}
impl From<RXFILTDIS> for bool {
#[inline(always)]
fn from(variant: RXFILTDIS) -> Self {
variant as u8 != 0
}
}
pub type RXFILTDIS_R = crate::BitReader<RXFILTDIS>;
impl RXFILTDIS_R {
#[inline(always)]
pub const fn variant(&self) -> RXFILTDIS {
match self.bits {
false => RXFILTDIS::Enabled,
true => RXFILTDIS::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RXFILTDIS::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RXFILTDIS::Disabled
}
}
pub type RXFILTDIS_W<'a, REG> = crate::BitWriter<'a, REG, RXFILTDIS>;
impl<'a, REG> RXFILTDIS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RXFILTDIS::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RXFILTDIS::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RXFILT2N3 {
Samp3 = 0,
Samp2 = 1,
}
impl From<RXFILT2N3> for bool {
#[inline(always)]
fn from(variant: RXFILT2N3) -> Self {
variant as u8 != 0
}
}
pub type RXFILT2N3_R = crate::BitReader<RXFILT2N3>;
impl RXFILT2N3_R {
#[inline(always)]
pub const fn variant(&self) -> RXFILT2N3 {
match self.bits {
false => RXFILT2N3::Samp3,
true => RXFILT2N3::Samp2,
}
}
#[inline(always)]
pub fn is_samp3(&self) -> bool {
*self == RXFILT2N3::Samp3
}
#[inline(always)]
pub fn is_samp2(&self) -> bool {
*self == RXFILT2N3::Samp2
}
}
pub type RXFILT2N3_W<'a, REG> = crate::BitWriter<'a, REG, RXFILT2N3>;
impl<'a, REG> RXFILT2N3_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn samp3(self) -> &'a mut crate::W<REG> {
self.variant(RXFILT2N3::Samp3)
}
#[inline(always)]
pub fn samp2(self) -> &'a mut crate::W<REG> {
self.variant(RXFILT2N3::Samp2)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FORCECLK {
NoForce = 0,
Force = 1,
}
impl From<FORCECLK> for bool {
#[inline(always)]
fn from(variant: FORCECLK) -> Self {
variant as u8 != 0
}
}
pub type FORCECLK_R = crate::BitReader<FORCECLK>;
impl FORCECLK_R {
#[inline(always)]
pub const fn variant(&self) -> FORCECLK {
match self.bits {
false => FORCECLK::NoForce,
true => FORCECLK::Force,
}
}
#[inline(always)]
pub fn is_no_force(&self) -> bool {
*self == FORCECLK::NoForce
}
#[inline(always)]
pub fn is_force(&self) -> bool {
*self == FORCECLK::Force
}
}
pub type FORCECLK_W<'a, REG> = crate::BitWriter<'a, REG, FORCECLK>;
impl<'a, REG> FORCECLK_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_force(self) -> &'a mut crate::W<REG> {
self.variant(FORCECLK::NoForce)
}
#[inline(always)]
pub fn force(self) -> &'a mut crate::W<REG> {
self.variant(FORCECLK::Force)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUPEN {
Disabled = 0,
Enabled = 1,
}
impl From<WUPEN> for bool {
#[inline(always)]
fn from(variant: WUPEN) -> Self {
variant as u8 != 0
}
}
pub type WUPEN_R = crate::BitReader<WUPEN>;
impl WUPEN_R {
#[inline(always)]
pub const fn variant(&self) -> WUPEN {
match self.bits {
false => WUPEN::Disabled,
true => WUPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WUPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WUPEN::Enabled
}
}
pub type WUPEN_W<'a, REG> = crate::BitWriter<'a, REG, WUPEN>;
impl<'a, REG> WUPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WUPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WUPEN::Enabled)
}
}
impl R {
#[inline(always)]
pub fn rxfiltdis(&self) -> RXFILTDIS_R {
RXFILTDIS_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn rxfilt2n3(&self) -> RXFILT2N3_R {
RXFILT2N3_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn forceclk(&self) -> FORCECLK_R {
FORCECLK_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn wupen(&self) -> WUPEN_R {
WUPEN_R::new(((self.bits >> 3) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CFGR2")
.field("rxfiltdis", &self.rxfiltdis())
.field("rxfilt2n3", &self.rxfilt2n3())
.field("forceclk", &self.forceclk())
.field("wupen", &self.wupen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rxfiltdis(&mut self) -> RXFILTDIS_W<CFGR2rs> {
RXFILTDIS_W::new(self, 0)
}
#[inline(always)]
pub fn rxfilt2n3(&mut self) -> RXFILT2N3_W<CFGR2rs> {
RXFILT2N3_W::new(self, 1)
}
#[inline(always)]
pub fn forceclk(&mut self) -> FORCECLK_W<CFGR2rs> {
FORCECLK_W::new(self, 2)
}
#[inline(always)]
pub fn wupen(&mut self) -> WUPEN_W<CFGR2rs> {
WUPEN_W::new(self, 3)
}
}
pub struct CFGR2rs;
impl crate::RegisterSpec for CFGR2rs {
type Ux = u32;
}
impl crate::Readable for CFGR2rs {}
impl crate::Writable for CFGR2rs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CFGR2rs {}