pub type R = crate::R<CNTRrs>;
pub type W = crate::W<CNTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FRES {
NoReset = 0,
Reset = 1,
}
impl From<FRES> for bool {
#[inline(always)]
fn from(variant: FRES) -> Self {
variant as u8 != 0
}
}
pub type FRES_R = crate::BitReader<FRES>;
impl FRES_R {
#[inline(always)]
pub const fn variant(&self) -> FRES {
match self.bits {
false => FRES::NoReset,
true => FRES::Reset,
}
}
#[inline(always)]
pub fn is_no_reset(&self) -> bool {
*self == FRES::NoReset
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == FRES::Reset
}
}
pub type FRES_W<'a, REG> = crate::BitWriter<'a, REG, FRES>;
impl<'a, REG> FRES_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_reset(self) -> &'a mut crate::W<REG> {
self.variant(FRES::NoReset)
}
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(FRES::Reset)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PDWN {
Disabled = 0,
Enabled = 1,
}
impl From<PDWN> for bool {
#[inline(always)]
fn from(variant: PDWN) -> Self {
variant as u8 != 0
}
}
pub type PDWN_R = crate::BitReader<PDWN>;
impl PDWN_R {
#[inline(always)]
pub const fn variant(&self) -> PDWN {
match self.bits {
false => PDWN::Disabled,
true => PDWN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PDWN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PDWN::Enabled
}
}
pub type PDWN_W<'a, REG> = crate::BitWriter<'a, REG, PDWN>;
impl<'a, REG> PDWN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PDWN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PDWN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LPMODE {
Disabled = 0,
Enabled = 1,
}
impl From<LPMODE> for bool {
#[inline(always)]
fn from(variant: LPMODE) -> Self {
variant as u8 != 0
}
}
pub type LPMODE_R = crate::BitReader<LPMODE>;
impl LPMODE_R {
#[inline(always)]
pub const fn variant(&self) -> LPMODE {
match self.bits {
false => LPMODE::Disabled,
true => LPMODE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LPMODE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == LPMODE::Enabled
}
}
pub type LPMODE_W<'a, REG> = crate::BitWriter<'a, REG, LPMODE>;
impl<'a, REG> LPMODE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LPMODE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(LPMODE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FSUSP {
NoEffect = 0,
Suspend = 1,
}
impl From<FSUSP> for bool {
#[inline(always)]
fn from(variant: FSUSP) -> Self {
variant as u8 != 0
}
}
pub type FSUSP_R = crate::BitReader<FSUSP>;
impl FSUSP_R {
#[inline(always)]
pub const fn variant(&self) -> FSUSP {
match self.bits {
false => FSUSP::NoEffect,
true => FSUSP::Suspend,
}
}
#[inline(always)]
pub fn is_no_effect(&self) -> bool {
*self == FSUSP::NoEffect
}
#[inline(always)]
pub fn is_suspend(&self) -> bool {
*self == FSUSP::Suspend
}
}
pub type FSUSP_W<'a, REG> = crate::BitWriter<'a, REG, FSUSP>;
impl<'a, REG> FSUSP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn no_effect(self) -> &'a mut crate::W<REG> {
self.variant(FSUSP::NoEffect)
}
#[inline(always)]
pub fn suspend(self) -> &'a mut crate::W<REG> {
self.variant(FSUSP::Suspend)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RESUME {
Requested = 1,
}
impl From<RESUME> for bool {
#[inline(always)]
fn from(variant: RESUME) -> Self {
variant as u8 != 0
}
}
pub type RESUME_R = crate::BitReader<RESUME>;
impl RESUME_R {
#[inline(always)]
pub const fn variant(&self) -> Option<RESUME> {
match self.bits {
true => Some(RESUME::Requested),
_ => None,
}
}
#[inline(always)]
pub fn is_requested(&self) -> bool {
*self == RESUME::Requested
}
}
pub type RESUME_W<'a, REG> = crate::BitWriter<'a, REG, RESUME>;
impl<'a, REG> RESUME_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn requested(self) -> &'a mut crate::W<REG> {
self.variant(RESUME::Requested)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ESOFM {
Disabled = 0,
Enabled = 1,
}
impl From<ESOFM> for bool {
#[inline(always)]
fn from(variant: ESOFM) -> Self {
variant as u8 != 0
}
}
pub type ESOFM_R = crate::BitReader<ESOFM>;
impl ESOFM_R {
#[inline(always)]
pub const fn variant(&self) -> ESOFM {
match self.bits {
false => ESOFM::Disabled,
true => ESOFM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ESOFM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ESOFM::Enabled
}
}
pub type ESOFM_W<'a, REG> = crate::BitWriter<'a, REG, ESOFM>;
impl<'a, REG> ESOFM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ESOFM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ESOFM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SOFM {
Disabled = 0,
Enabled = 1,
}
impl From<SOFM> for bool {
#[inline(always)]
fn from(variant: SOFM) -> Self {
variant as u8 != 0
}
}
pub type SOFM_R = crate::BitReader<SOFM>;
impl SOFM_R {
#[inline(always)]
pub const fn variant(&self) -> SOFM {
match self.bits {
false => SOFM::Disabled,
true => SOFM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SOFM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SOFM::Enabled
}
}
pub type SOFM_W<'a, REG> = crate::BitWriter<'a, REG, SOFM>;
impl<'a, REG> SOFM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SOFM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SOFM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RESETM {
Disabled = 0,
Enabled = 1,
}
impl From<RESETM> for bool {
#[inline(always)]
fn from(variant: RESETM) -> Self {
variant as u8 != 0
}
}
pub type RESETM_R = crate::BitReader<RESETM>;
impl RESETM_R {
#[inline(always)]
pub const fn variant(&self) -> RESETM {
match self.bits {
false => RESETM::Disabled,
true => RESETM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == RESETM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == RESETM::Enabled
}
}
pub type RESETM_W<'a, REG> = crate::BitWriter<'a, REG, RESETM>;
impl<'a, REG> RESETM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(RESETM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(RESETM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SUSPM {
Disabled = 0,
Enabled = 1,
}
impl From<SUSPM> for bool {
#[inline(always)]
fn from(variant: SUSPM) -> Self {
variant as u8 != 0
}
}
pub type SUSPM_R = crate::BitReader<SUSPM>;
impl SUSPM_R {
#[inline(always)]
pub const fn variant(&self) -> SUSPM {
match self.bits {
false => SUSPM::Disabled,
true => SUSPM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SUSPM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SUSPM::Enabled
}
}
pub type SUSPM_W<'a, REG> = crate::BitWriter<'a, REG, SUSPM>;
impl<'a, REG> SUSPM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SUSPM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(SUSPM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum WKUPM {
Disabled = 0,
Enabled = 1,
}
impl From<WKUPM> for bool {
#[inline(always)]
fn from(variant: WKUPM) -> Self {
variant as u8 != 0
}
}
pub type WKUPM_R = crate::BitReader<WKUPM>;
impl WKUPM_R {
#[inline(always)]
pub const fn variant(&self) -> WKUPM {
match self.bits {
false => WKUPM::Disabled,
true => WKUPM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WKUPM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == WKUPM::Enabled
}
}
pub type WKUPM_W<'a, REG> = crate::BitWriter<'a, REG, WKUPM>;
impl<'a, REG> WKUPM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WKUPM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(WKUPM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ERRM {
Disabled = 0,
Enabled = 1,
}
impl From<ERRM> for bool {
#[inline(always)]
fn from(variant: ERRM) -> Self {
variant as u8 != 0
}
}
pub type ERRM_R = crate::BitReader<ERRM>;
impl ERRM_R {
#[inline(always)]
pub const fn variant(&self) -> ERRM {
match self.bits {
false => ERRM::Disabled,
true => ERRM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ERRM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ERRM::Enabled
}
}
pub type ERRM_W<'a, REG> = crate::BitWriter<'a, REG, ERRM>;
impl<'a, REG> ERRM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ERRM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ERRM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PMAOVRM {
Disabled = 0,
Enabled = 1,
}
impl From<PMAOVRM> for bool {
#[inline(always)]
fn from(variant: PMAOVRM) -> Self {
variant as u8 != 0
}
}
pub type PMAOVRM_R = crate::BitReader<PMAOVRM>;
impl PMAOVRM_R {
#[inline(always)]
pub const fn variant(&self) -> PMAOVRM {
match self.bits {
false => PMAOVRM::Disabled,
true => PMAOVRM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PMAOVRM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PMAOVRM::Enabled
}
}
pub type PMAOVRM_W<'a, REG> = crate::BitWriter<'a, REG, PMAOVRM>;
impl<'a, REG> PMAOVRM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PMAOVRM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PMAOVRM::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CTRM {
Disabled = 0,
Enabled = 1,
}
impl From<CTRM> for bool {
#[inline(always)]
fn from(variant: CTRM) -> Self {
variant as u8 != 0
}
}
pub type CTRM_R = crate::BitReader<CTRM>;
impl CTRM_R {
#[inline(always)]
pub const fn variant(&self) -> CTRM {
match self.bits {
false => CTRM::Disabled,
true => CTRM::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == CTRM::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == CTRM::Enabled
}
}
pub type CTRM_W<'a, REG> = crate::BitWriter<'a, REG, CTRM>;
impl<'a, REG> CTRM_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(CTRM::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(CTRM::Enabled)
}
}
impl R {
#[inline(always)]
pub fn fres(&self) -> FRES_R {
FRES_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn pdwn(&self) -> PDWN_R {
PDWN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn lpmode(&self) -> LPMODE_R {
LPMODE_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn fsusp(&self) -> FSUSP_R {
FSUSP_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn resume(&self) -> RESUME_R {
RESUME_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn esofm(&self) -> ESOFM_R {
ESOFM_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn sofm(&self) -> SOFM_R {
SOFM_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn resetm(&self) -> RESETM_R {
RESETM_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn suspm(&self) -> SUSPM_R {
SUSPM_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn wkupm(&self) -> WKUPM_R {
WKUPM_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn errm(&self) -> ERRM_R {
ERRM_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn pmaovrm(&self) -> PMAOVRM_R {
PMAOVRM_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn ctrm(&self) -> CTRM_R {
CTRM_R::new(((self.bits >> 15) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CNTR")
.field("fres", &self.fres())
.field("pdwn", &self.pdwn())
.field("lpmode", &self.lpmode())
.field("fsusp", &self.fsusp())
.field("resume", &self.resume())
.field("esofm", &self.esofm())
.field("sofm", &self.sofm())
.field("resetm", &self.resetm())
.field("suspm", &self.suspm())
.field("wkupm", &self.wkupm())
.field("errm", &self.errm())
.field("pmaovrm", &self.pmaovrm())
.field("ctrm", &self.ctrm())
.finish()
}
}
impl W {
#[inline(always)]
pub fn fres(&mut self) -> FRES_W<CNTRrs> {
FRES_W::new(self, 0)
}
#[inline(always)]
pub fn pdwn(&mut self) -> PDWN_W<CNTRrs> {
PDWN_W::new(self, 1)
}
#[inline(always)]
pub fn lpmode(&mut self) -> LPMODE_W<CNTRrs> {
LPMODE_W::new(self, 2)
}
#[inline(always)]
pub fn fsusp(&mut self) -> FSUSP_W<CNTRrs> {
FSUSP_W::new(self, 3)
}
#[inline(always)]
pub fn resume(&mut self) -> RESUME_W<CNTRrs> {
RESUME_W::new(self, 4)
}
#[inline(always)]
pub fn esofm(&mut self) -> ESOFM_W<CNTRrs> {
ESOFM_W::new(self, 8)
}
#[inline(always)]
pub fn sofm(&mut self) -> SOFM_W<CNTRrs> {
SOFM_W::new(self, 9)
}
#[inline(always)]
pub fn resetm(&mut self) -> RESETM_W<CNTRrs> {
RESETM_W::new(self, 10)
}
#[inline(always)]
pub fn suspm(&mut self) -> SUSPM_W<CNTRrs> {
SUSPM_W::new(self, 11)
}
#[inline(always)]
pub fn wkupm(&mut self) -> WKUPM_W<CNTRrs> {
WKUPM_W::new(self, 12)
}
#[inline(always)]
pub fn errm(&mut self) -> ERRM_W<CNTRrs> {
ERRM_W::new(self, 13)
}
#[inline(always)]
pub fn pmaovrm(&mut self) -> PMAOVRM_W<CNTRrs> {
PMAOVRM_W::new(self, 14)
}
#[inline(always)]
pub fn ctrm(&mut self) -> CTRM_W<CNTRrs> {
CTRM_W::new(self, 15)
}
}
pub struct CNTRrs;
impl crate::RegisterSpec for CNTRrs {
type Ux = u32;
}
impl crate::Readable for CNTRrs {}
impl crate::Writable for CNTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CNTRrs {
const RESET_VALUE: u32 = 0x03;
}