pub type R = crate::R<CSRrs>;
pub type W = crate::W<CSRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WUFR {
NoWakeupEvent = 0,
WakeupEvent = 1,
}
impl From<WUFR> for bool {
#[inline(always)]
fn from(variant: WUFR) -> Self {
variant as u8 != 0
}
}
pub type WUF_R = crate::BitReader<WUFR>;
impl WUF_R {
#[inline(always)]
pub const fn variant(&self) -> WUFR {
match self.bits {
false => WUFR::NoWakeupEvent,
true => WUFR::WakeupEvent,
}
}
#[inline(always)]
pub fn is_no_wakeup_event(&self) -> bool {
*self == WUFR::NoWakeupEvent
}
#[inline(always)]
pub fn is_wakeup_event(&self) -> bool {
*self == WUFR::WakeupEvent
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SBFR {
NoStandbyEvent = 0,
StandbyEvent = 1,
}
impl From<SBFR> for bool {
#[inline(always)]
fn from(variant: SBFR) -> Self {
variant as u8 != 0
}
}
pub type SBF_R = crate::BitReader<SBFR>;
impl SBF_R {
#[inline(always)]
pub const fn variant(&self) -> SBFR {
match self.bits {
false => SBFR::NoStandbyEvent,
true => SBFR::StandbyEvent,
}
}
#[inline(always)]
pub fn is_no_standby_event(&self) -> bool {
*self == SBFR::NoStandbyEvent
}
#[inline(always)]
pub fn is_standby_event(&self) -> bool {
*self == SBFR::StandbyEvent
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VREFINTRDYFR {
NotReady = 0,
Ready = 1,
}
impl From<VREFINTRDYFR> for bool {
#[inline(always)]
fn from(variant: VREFINTRDYFR) -> Self {
variant as u8 != 0
}
}
pub type VREFINTRDYF_R = crate::BitReader<VREFINTRDYFR>;
impl VREFINTRDYF_R {
#[inline(always)]
pub const fn variant(&self) -> VREFINTRDYFR {
match self.bits {
false => VREFINTRDYFR::NotReady,
true => VREFINTRDYFR::Ready,
}
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == VREFINTRDYFR::NotReady
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == VREFINTRDYFR::Ready
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum VOSFR {
Ready = 0,
NotReady = 1,
}
impl From<VOSFR> for bool {
#[inline(always)]
fn from(variant: VOSFR) -> Self {
variant as u8 != 0
}
}
pub type VOSF_R = crate::BitReader<VOSFR>;
impl VOSF_R {
#[inline(always)]
pub const fn variant(&self) -> VOSFR {
match self.bits {
false => VOSFR::Ready,
true => VOSFR::NotReady,
}
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == VOSFR::Ready
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == VOSFR::NotReady
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REGLPFR {
Ready = 0,
NotReady = 1,
}
impl From<REGLPFR> for bool {
#[inline(always)]
fn from(variant: REGLPFR) -> Self {
variant as u8 != 0
}
}
pub type REGLPF_R = crate::BitReader<REGLPFR>;
impl REGLPF_R {
#[inline(always)]
pub const fn variant(&self) -> REGLPFR {
match self.bits {
false => REGLPFR::Ready,
true => REGLPFR::NotReady,
}
}
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == REGLPFR::Ready
}
#[inline(always)]
pub fn is_not_ready(&self) -> bool {
*self == REGLPFR::NotReady
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EWUP1 {
Disabled = 0,
Enabled = 1,
}
impl From<EWUP1> for bool {
#[inline(always)]
fn from(variant: EWUP1) -> Self {
variant as u8 != 0
}
}
pub type EWUP1_R = crate::BitReader<EWUP1>;
impl EWUP1_R {
#[inline(always)]
pub const fn variant(&self) -> EWUP1 {
match self.bits {
false => EWUP1::Disabled,
true => EWUP1::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EWUP1::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EWUP1::Enabled
}
}
pub type EWUP1_W<'a, REG> = crate::BitWriter<'a, REG, EWUP1>;
impl<'a, REG> EWUP1_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EWUP1::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(EWUP1::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EWUP2 {
Disabled = 0,
Enabled = 1,
}
impl From<EWUP2> for bool {
#[inline(always)]
fn from(variant: EWUP2) -> Self {
variant as u8 != 0
}
}
pub type EWUP2_R = crate::BitReader<EWUP2>;
impl EWUP2_R {
#[inline(always)]
pub const fn variant(&self) -> EWUP2 {
match self.bits {
false => EWUP2::Disabled,
true => EWUP2::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EWUP2::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EWUP2::Enabled
}
}
pub type EWUP2_W<'a, REG> = crate::BitWriter<'a, REG, EWUP2>;
impl<'a, REG> EWUP2_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EWUP2::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(EWUP2::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum EWUP3 {
Disabled = 0,
Enabled = 1,
}
impl From<EWUP3> for bool {
#[inline(always)]
fn from(variant: EWUP3) -> Self {
variant as u8 != 0
}
}
pub type EWUP3_R = crate::BitReader<EWUP3>;
impl EWUP3_R {
#[inline(always)]
pub const fn variant(&self) -> EWUP3 {
match self.bits {
false => EWUP3::Disabled,
true => EWUP3::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == EWUP3::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == EWUP3::Enabled
}
}
pub type EWUP3_W<'a, REG> = crate::BitWriter<'a, REG, EWUP3>;
impl<'a, REG> EWUP3_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(EWUP3::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(EWUP3::Enabled)
}
}
impl R {
#[inline(always)]
pub fn wuf(&self) -> WUF_R {
WUF_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn sbf(&self) -> SBF_R {
SBF_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn vrefintrdyf(&self) -> VREFINTRDYF_R {
VREFINTRDYF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn vosf(&self) -> VOSF_R {
VOSF_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn reglpf(&self) -> REGLPF_R {
REGLPF_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn ewup1(&self) -> EWUP1_R {
EWUP1_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ewup2(&self) -> EWUP2_R {
EWUP2_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn ewup3(&self) -> EWUP3_R {
EWUP3_R::new(((self.bits >> 10) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CSR")
.field("wuf", &self.wuf())
.field("sbf", &self.sbf())
.field("vrefintrdyf", &self.vrefintrdyf())
.field("vosf", &self.vosf())
.field("reglpf", &self.reglpf())
.field("ewup1", &self.ewup1())
.field("ewup2", &self.ewup2())
.field("ewup3", &self.ewup3())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ewup1(&mut self) -> EWUP1_W<CSRrs> {
EWUP1_W::new(self, 8)
}
#[inline(always)]
pub fn ewup2(&mut self) -> EWUP2_W<CSRrs> {
EWUP2_W::new(self, 9)
}
#[inline(always)]
pub fn ewup3(&mut self) -> EWUP3_W<CSRrs> {
EWUP3_W::new(self, 10)
}
}
pub struct CSRrs;
impl crate::RegisterSpec for CSRrs {
type Ux = u32;
}
impl crate::Readable for CSRrs {}
impl crate::Writable for CSRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CSRrs {}