pub type R = crate::R<CRrs>;
pub type W = crate::W<CRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LPSDSR {
MainMode = 0,
LowPowerMode = 1,
}
impl From<LPSDSR> for bool {
#[inline(always)]
fn from(variant: LPSDSR) -> Self {
variant as u8 != 0
}
}
pub type LPSDSR_R = crate::BitReader<LPSDSR>;
impl LPSDSR_R {
#[inline(always)]
pub const fn variant(&self) -> LPSDSR {
match self.bits {
false => LPSDSR::MainMode,
true => LPSDSR::LowPowerMode,
}
}
#[inline(always)]
pub fn is_main_mode(&self) -> bool {
*self == LPSDSR::MainMode
}
#[inline(always)]
pub fn is_low_power_mode(&self) -> bool {
*self == LPSDSR::LowPowerMode
}
}
pub type LPSDSR_W<'a, REG> = crate::BitWriter<'a, REG, LPSDSR>;
impl<'a, REG> LPSDSR_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn main_mode(self) -> &'a mut crate::W<REG> {
self.variant(LPSDSR::MainMode)
}
#[inline(always)]
pub fn low_power_mode(self) -> &'a mut crate::W<REG> {
self.variant(LPSDSR::LowPowerMode)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PDDS {
StopMode = 0,
StandbyMode = 1,
}
impl From<PDDS> for bool {
#[inline(always)]
fn from(variant: PDDS) -> Self {
variant as u8 != 0
}
}
pub type PDDS_R = crate::BitReader<PDDS>;
impl PDDS_R {
#[inline(always)]
pub const fn variant(&self) -> PDDS {
match self.bits {
false => PDDS::StopMode,
true => PDDS::StandbyMode,
}
}
#[inline(always)]
pub fn is_stop_mode(&self) -> bool {
*self == PDDS::StopMode
}
#[inline(always)]
pub fn is_standby_mode(&self) -> bool {
*self == PDDS::StandbyMode
}
}
pub type PDDS_W<'a, REG> = crate::BitWriter<'a, REG, PDDS>;
impl<'a, REG> PDDS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn stop_mode(self) -> &'a mut crate::W<REG> {
self.variant(PDDS::StopMode)
}
#[inline(always)]
pub fn standby_mode(self) -> &'a mut crate::W<REG> {
self.variant(PDDS::StandbyMode)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CWUFW {
Clear = 1,
}
impl From<CWUFW> for bool {
#[inline(always)]
fn from(variant: CWUFW) -> Self {
variant as u8 != 0
}
}
pub type CWUF_R = crate::BitReader<CWUFW>;
impl CWUF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CWUFW> {
match self.bits {
true => Some(CWUFW::Clear),
_ => None,
}
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == CWUFW::Clear
}
}
pub type CWUF_W<'a, REG> = crate::BitWriter<'a, REG, CWUFW>;
impl<'a, REG> CWUF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CWUFW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CSBFW {
Clear = 1,
}
impl From<CSBFW> for bool {
#[inline(always)]
fn from(variant: CSBFW) -> Self {
variant as u8 != 0
}
}
pub type CSBF_R = crate::BitReader<CSBFW>;
impl CSBF_R {
#[inline(always)]
pub const fn variant(&self) -> Option<CSBFW> {
match self.bits {
true => Some(CSBFW::Clear),
_ => None,
}
}
#[inline(always)]
pub fn is_clear(&self) -> bool {
*self == CSBFW::Clear
}
}
pub type CSBF_W<'a, REG> = crate::BitWriter<'a, REG, CSBFW>;
impl<'a, REG> CSBF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn clear(self) -> &'a mut crate::W<REG> {
self.variant(CSBFW::Clear)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PVDE {
Disabled = 0,
Enabled = 1,
}
impl From<PVDE> for bool {
#[inline(always)]
fn from(variant: PVDE) -> Self {
variant as u8 != 0
}
}
pub type PVDE_R = crate::BitReader<PVDE>;
impl PVDE_R {
#[inline(always)]
pub const fn variant(&self) -> PVDE {
match self.bits {
false => PVDE::Disabled,
true => PVDE::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PVDE::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PVDE::Enabled
}
}
pub type PVDE_W<'a, REG> = crate::BitWriter<'a, REG, PVDE>;
impl<'a, REG> PVDE_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PVDE::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PVDE::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PLS {
V1_9 = 0,
V2_1 = 1,
V2_3 = 2,
V2_5 = 3,
V2_7 = 4,
V2_9 = 5,
V3_1 = 6,
External = 7,
}
impl From<PLS> for u8 {
#[inline(always)]
fn from(variant: PLS) -> Self {
variant as _
}
}
impl crate::FieldSpec for PLS {
type Ux = u8;
}
impl crate::IsEnum for PLS {}
pub type PLS_R = crate::FieldReader<PLS>;
impl PLS_R {
#[inline(always)]
pub const fn variant(&self) -> PLS {
match self.bits {
0 => PLS::V1_9,
1 => PLS::V2_1,
2 => PLS::V2_3,
3 => PLS::V2_5,
4 => PLS::V2_7,
5 => PLS::V2_9,
6 => PLS::V3_1,
7 => PLS::External,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_v1_9(&self) -> bool {
*self == PLS::V1_9
}
#[inline(always)]
pub fn is_v2_1(&self) -> bool {
*self == PLS::V2_1
}
#[inline(always)]
pub fn is_v2_3(&self) -> bool {
*self == PLS::V2_3
}
#[inline(always)]
pub fn is_v2_5(&self) -> bool {
*self == PLS::V2_5
}
#[inline(always)]
pub fn is_v2_7(&self) -> bool {
*self == PLS::V2_7
}
#[inline(always)]
pub fn is_v2_9(&self) -> bool {
*self == PLS::V2_9
}
#[inline(always)]
pub fn is_v3_1(&self) -> bool {
*self == PLS::V3_1
}
#[inline(always)]
pub fn is_external(&self) -> bool {
*self == PLS::External
}
}
pub type PLS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PLS, crate::Safe>;
impl<'a, REG> PLS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn v1_9(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V1_9)
}
#[inline(always)]
pub fn v2_1(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V2_1)
}
#[inline(always)]
pub fn v2_3(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V2_3)
}
#[inline(always)]
pub fn v2_5(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V2_5)
}
#[inline(always)]
pub fn v2_7(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V2_7)
}
#[inline(always)]
pub fn v2_9(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V2_9)
}
#[inline(always)]
pub fn v3_1(self) -> &'a mut crate::W<REG> {
self.variant(PLS::V3_1)
}
#[inline(always)]
pub fn external(self) -> &'a mut crate::W<REG> {
self.variant(PLS::External)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DBP {
Disabled = 0,
Enabled = 1,
}
impl From<DBP> for bool {
#[inline(always)]
fn from(variant: DBP) -> Self {
variant as u8 != 0
}
}
pub type DBP_R = crate::BitReader<DBP>;
impl DBP_R {
#[inline(always)]
pub const fn variant(&self) -> DBP {
match self.bits {
false => DBP::Disabled,
true => DBP::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DBP::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DBP::Enabled
}
}
pub type DBP_W<'a, REG> = crate::BitWriter<'a, REG, DBP>;
impl<'a, REG> DBP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DBP::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DBP::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ULP {
Enabled = 0,
Disabled = 1,
}
impl From<ULP> for bool {
#[inline(always)]
fn from(variant: ULP) -> Self {
variant as u8 != 0
}
}
pub type ULP_R = crate::BitReader<ULP>;
impl ULP_R {
#[inline(always)]
pub const fn variant(&self) -> ULP {
match self.bits {
false => ULP::Enabled,
true => ULP::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ULP::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ULP::Disabled
}
}
pub type ULP_W<'a, REG> = crate::BitWriter<'a, REG, ULP>;
impl<'a, REG> ULP_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(ULP::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(ULP::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FWU {
Disabled = 0,
Enabled = 1,
}
impl From<FWU> for bool {
#[inline(always)]
fn from(variant: FWU) -> Self {
variant as u8 != 0
}
}
pub type FWU_R = crate::BitReader<FWU>;
impl FWU_R {
#[inline(always)]
pub const fn variant(&self) -> FWU {
match self.bits {
false => FWU::Disabled,
true => FWU::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == FWU::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == FWU::Enabled
}
}
pub type FWU_W<'a, REG> = crate::BitWriter<'a, REG, FWU>;
impl<'a, REG> FWU_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(FWU::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(FWU::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum VOS {
V1_8 = 1,
V1_5 = 2,
V1_2 = 3,
}
impl From<VOS> for u8 {
#[inline(always)]
fn from(variant: VOS) -> Self {
variant as _
}
}
impl crate::FieldSpec for VOS {
type Ux = u8;
}
impl crate::IsEnum for VOS {}
pub type VOS_R = crate::FieldReader<VOS>;
impl VOS_R {
#[inline(always)]
pub const fn variant(&self) -> Option<VOS> {
match self.bits {
1 => Some(VOS::V1_8),
2 => Some(VOS::V1_5),
3 => Some(VOS::V1_2),
_ => None,
}
}
#[inline(always)]
pub fn is_v1_8(&self) -> bool {
*self == VOS::V1_8
}
#[inline(always)]
pub fn is_v1_5(&self) -> bool {
*self == VOS::V1_5
}
#[inline(always)]
pub fn is_v1_2(&self) -> bool {
*self == VOS::V1_2
}
}
pub type VOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, VOS>;
impl<'a, REG> VOS_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn v1_8(self) -> &'a mut crate::W<REG> {
self.variant(VOS::V1_8)
}
#[inline(always)]
pub fn v1_5(self) -> &'a mut crate::W<REG> {
self.variant(VOS::V1_5)
}
#[inline(always)]
pub fn v1_2(self) -> &'a mut crate::W<REG> {
self.variant(VOS::V1_2)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DS_EE_KOFF {
NvmwakeUp = 0,
Nvmsleep = 1,
}
impl From<DS_EE_KOFF> for bool {
#[inline(always)]
fn from(variant: DS_EE_KOFF) -> Self {
variant as u8 != 0
}
}
pub type DS_EE_KOFF_R = crate::BitReader<DS_EE_KOFF>;
impl DS_EE_KOFF_R {
#[inline(always)]
pub const fn variant(&self) -> DS_EE_KOFF {
match self.bits {
false => DS_EE_KOFF::NvmwakeUp,
true => DS_EE_KOFF::Nvmsleep,
}
}
#[inline(always)]
pub fn is_nvmwake_up(&self) -> bool {
*self == DS_EE_KOFF::NvmwakeUp
}
#[inline(always)]
pub fn is_nvmsleep(&self) -> bool {
*self == DS_EE_KOFF::Nvmsleep
}
}
pub type DS_EE_KOFF_W<'a, REG> = crate::BitWriter<'a, REG, DS_EE_KOFF>;
impl<'a, REG> DS_EE_KOFF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn nvmwake_up(self) -> &'a mut crate::W<REG> {
self.variant(DS_EE_KOFF::NvmwakeUp)
}
#[inline(always)]
pub fn nvmsleep(self) -> &'a mut crate::W<REG> {
self.variant(DS_EE_KOFF::Nvmsleep)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LPRUN {
MainMode = 0,
LowPowerMode = 1,
}
impl From<LPRUN> for bool {
#[inline(always)]
fn from(variant: LPRUN) -> Self {
variant as u8 != 0
}
}
pub type LPRUN_R = crate::BitReader<LPRUN>;
impl LPRUN_R {
#[inline(always)]
pub const fn variant(&self) -> LPRUN {
match self.bits {
false => LPRUN::MainMode,
true => LPRUN::LowPowerMode,
}
}
#[inline(always)]
pub fn is_main_mode(&self) -> bool {
*self == LPRUN::MainMode
}
#[inline(always)]
pub fn is_low_power_mode(&self) -> bool {
*self == LPRUN::LowPowerMode
}
}
pub type LPRUN_W<'a, REG> = crate::BitWriter<'a, REG, LPRUN>;
impl<'a, REG> LPRUN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn main_mode(self) -> &'a mut crate::W<REG> {
self.variant(LPRUN::MainMode)
}
#[inline(always)]
pub fn low_power_mode(self) -> &'a mut crate::W<REG> {
self.variant(LPRUN::LowPowerMode)
}
}
impl R {
#[inline(always)]
pub fn lpsdsr(&self) -> LPSDSR_R {
LPSDSR_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn pdds(&self) -> PDDS_R {
PDDS_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn cwuf(&self) -> CWUF_R {
CWUF_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn csbf(&self) -> CSBF_R {
CSBF_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn pvde(&self) -> PVDE_R {
PVDE_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn pls(&self) -> PLS_R {
PLS_R::new(((self.bits >> 5) & 7) as u8)
}
#[inline(always)]
pub fn dbp(&self) -> DBP_R {
DBP_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn ulp(&self) -> ULP_R {
ULP_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn fwu(&self) -> FWU_R {
FWU_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn vos(&self) -> VOS_R {
VOS_R::new(((self.bits >> 11) & 3) as u8)
}
#[inline(always)]
pub fn ds_ee_koff(&self) -> DS_EE_KOFF_R {
DS_EE_KOFF_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn lprun(&self) -> LPRUN_R {
LPRUN_R::new(((self.bits >> 14) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CR")
.field("lpsdsr", &self.lpsdsr())
.field("pdds", &self.pdds())
.field("cwuf", &self.cwuf())
.field("csbf", &self.csbf())
.field("pvde", &self.pvde())
.field("pls", &self.pls())
.field("dbp", &self.dbp())
.field("ulp", &self.ulp())
.field("fwu", &self.fwu())
.field("vos", &self.vos())
.field("ds_ee_koff", &self.ds_ee_koff())
.field("lprun", &self.lprun())
.finish()
}
}
impl W {
#[inline(always)]
pub fn lpsdsr(&mut self) -> LPSDSR_W<CRrs> {
LPSDSR_W::new(self, 0)
}
#[inline(always)]
pub fn pdds(&mut self) -> PDDS_W<CRrs> {
PDDS_W::new(self, 1)
}
#[inline(always)]
pub fn cwuf(&mut self) -> CWUF_W<CRrs> {
CWUF_W::new(self, 2)
}
#[inline(always)]
pub fn csbf(&mut self) -> CSBF_W<CRrs> {
CSBF_W::new(self, 3)
}
#[inline(always)]
pub fn pvde(&mut self) -> PVDE_W<CRrs> {
PVDE_W::new(self, 4)
}
#[inline(always)]
pub fn pls(&mut self) -> PLS_W<CRrs> {
PLS_W::new(self, 5)
}
#[inline(always)]
pub fn dbp(&mut self) -> DBP_W<CRrs> {
DBP_W::new(self, 8)
}
#[inline(always)]
pub fn ulp(&mut self) -> ULP_W<CRrs> {
ULP_W::new(self, 9)
}
#[inline(always)]
pub fn fwu(&mut self) -> FWU_W<CRrs> {
FWU_W::new(self, 10)
}
#[inline(always)]
pub fn vos(&mut self) -> VOS_W<CRrs> {
VOS_W::new(self, 11)
}
#[inline(always)]
pub fn ds_ee_koff(&mut self) -> DS_EE_KOFF_W<CRrs> {
DS_EE_KOFF_W::new(self, 13)
}
#[inline(always)]
pub fn lprun(&mut self) -> LPRUN_W<CRrs> {
LPRUN_W::new(self, 14)
}
}
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
type Ux = u32;
}
impl crate::Readable for CRrs {}
impl crate::Writable for CRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CRrs {
const RESET_VALUE: u32 = 0x1000;
}