pub type R = crate::R<ACRrs>;
pub type W = crate::W<ACRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum LATENCY {
Ws0 = 0,
Ws1 = 1,
}
impl From<LATENCY> for bool {
#[inline(always)]
fn from(variant: LATENCY) -> Self {
variant as u8 != 0
}
}
pub type LATENCY_R = crate::BitReader<LATENCY>;
impl LATENCY_R {
#[inline(always)]
pub const fn variant(&self) -> LATENCY {
match self.bits {
false => LATENCY::Ws0,
true => LATENCY::Ws1,
}
}
#[inline(always)]
pub fn is_ws0(&self) -> bool {
*self == LATENCY::Ws0
}
#[inline(always)]
pub fn is_ws1(&self) -> bool {
*self == LATENCY::Ws1
}
}
pub type LATENCY_W<'a, REG> = crate::BitWriter<'a, REG, LATENCY>;
impl<'a, REG> LATENCY_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn ws0(self) -> &'a mut crate::W<REG> {
self.variant(LATENCY::Ws0)
}
#[inline(always)]
pub fn ws1(self) -> &'a mut crate::W<REG> {
self.variant(LATENCY::Ws1)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PRFTEN {
Disabled = 0,
Enabled = 1,
}
impl From<PRFTEN> for bool {
#[inline(always)]
fn from(variant: PRFTEN) -> Self {
variant as u8 != 0
}
}
pub type PRFTEN_R = crate::BitReader<PRFTEN>;
impl PRFTEN_R {
#[inline(always)]
pub const fn variant(&self) -> PRFTEN {
match self.bits {
false => PRFTEN::Disabled,
true => PRFTEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PRFTEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PRFTEN::Enabled
}
}
pub type PRFTEN_W<'a, REG> = crate::BitWriter<'a, REG, PRFTEN>;
impl<'a, REG> PRFTEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PRFTEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PRFTEN::Enabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SLEEP_PD {
NvmidleMode = 0,
NvmpwrDownMode = 1,
}
impl From<SLEEP_PD> for bool {
#[inline(always)]
fn from(variant: SLEEP_PD) -> Self {
variant as u8 != 0
}
}
pub type SLEEP_PD_R = crate::BitReader<SLEEP_PD>;
impl SLEEP_PD_R {
#[inline(always)]
pub const fn variant(&self) -> SLEEP_PD {
match self.bits {
false => SLEEP_PD::NvmidleMode,
true => SLEEP_PD::NvmpwrDownMode,
}
}
#[inline(always)]
pub fn is_nvmidle_mode(&self) -> bool {
*self == SLEEP_PD::NvmidleMode
}
#[inline(always)]
pub fn is_nvmpwr_down_mode(&self) -> bool {
*self == SLEEP_PD::NvmpwrDownMode
}
}
pub type SLEEP_PD_W<'a, REG> = crate::BitWriter<'a, REG, SLEEP_PD>;
impl<'a, REG> SLEEP_PD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn nvmidle_mode(self) -> &'a mut crate::W<REG> {
self.variant(SLEEP_PD::NvmidleMode)
}
#[inline(always)]
pub fn nvmpwr_down_mode(self) -> &'a mut crate::W<REG> {
self.variant(SLEEP_PD::NvmpwrDownMode)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RUN_PD {
NvmidleMode = 0,
NvmpwrDownMode = 1,
}
impl From<RUN_PD> for bool {
#[inline(always)]
fn from(variant: RUN_PD) -> Self {
variant as u8 != 0
}
}
pub type RUN_PD_R = crate::BitReader<RUN_PD>;
impl RUN_PD_R {
#[inline(always)]
pub const fn variant(&self) -> RUN_PD {
match self.bits {
false => RUN_PD::NvmidleMode,
true => RUN_PD::NvmpwrDownMode,
}
}
#[inline(always)]
pub fn is_nvmidle_mode(&self) -> bool {
*self == RUN_PD::NvmidleMode
}
#[inline(always)]
pub fn is_nvmpwr_down_mode(&self) -> bool {
*self == RUN_PD::NvmpwrDownMode
}
}
pub type RUN_PD_W<'a, REG> = crate::BitWriter<'a, REG, RUN_PD>;
impl<'a, REG> RUN_PD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn nvmidle_mode(self) -> &'a mut crate::W<REG> {
self.variant(RUN_PD::NvmidleMode)
}
#[inline(always)]
pub fn nvmpwr_down_mode(self) -> &'a mut crate::W<REG> {
self.variant(RUN_PD::NvmpwrDownMode)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DISAB_BUF {
Enabled = 0,
Disabled = 1,
}
impl From<DISAB_BUF> for bool {
#[inline(always)]
fn from(variant: DISAB_BUF) -> Self {
variant as u8 != 0
}
}
pub type DISAB_BUF_R = crate::BitReader<DISAB_BUF>;
impl DISAB_BUF_R {
#[inline(always)]
pub const fn variant(&self) -> DISAB_BUF {
match self.bits {
false => DISAB_BUF::Enabled,
true => DISAB_BUF::Disabled,
}
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DISAB_BUF::Enabled
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DISAB_BUF::Disabled
}
}
pub type DISAB_BUF_W<'a, REG> = crate::BitWriter<'a, REG, DISAB_BUF>;
impl<'a, REG> DISAB_BUF_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(DISAB_BUF::Enabled)
}
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(DISAB_BUF::Disabled)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PRE_READ {
Disabled = 0,
Enabled = 1,
}
impl From<PRE_READ> for bool {
#[inline(always)]
fn from(variant: PRE_READ) -> Self {
variant as u8 != 0
}
}
pub type PRE_READ_R = crate::BitReader<PRE_READ>;
impl PRE_READ_R {
#[inline(always)]
pub const fn variant(&self) -> PRE_READ {
match self.bits {
false => PRE_READ::Disabled,
true => PRE_READ::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PRE_READ::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == PRE_READ::Enabled
}
}
pub type PRE_READ_W<'a, REG> = crate::BitWriter<'a, REG, PRE_READ>;
impl<'a, REG> PRE_READ_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PRE_READ::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(PRE_READ::Enabled)
}
}
impl R {
#[inline(always)]
pub fn latency(&self) -> LATENCY_R {
LATENCY_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn prften(&self) -> PRFTEN_R {
PRFTEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn sleep_pd(&self) -> SLEEP_PD_R {
SLEEP_PD_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn run_pd(&self) -> RUN_PD_R {
RUN_PD_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn disab_buf(&self) -> DISAB_BUF_R {
DISAB_BUF_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn pre_read(&self) -> PRE_READ_R {
PRE_READ_R::new(((self.bits >> 6) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("ACR")
.field("latency", &self.latency())
.field("prften", &self.prften())
.field("sleep_pd", &self.sleep_pd())
.field("run_pd", &self.run_pd())
.field("disab_buf", &self.disab_buf())
.field("pre_read", &self.pre_read())
.finish()
}
}
impl W {
#[inline(always)]
pub fn latency(&mut self) -> LATENCY_W<ACRrs> {
LATENCY_W::new(self, 0)
}
#[inline(always)]
pub fn prften(&mut self) -> PRFTEN_W<ACRrs> {
PRFTEN_W::new(self, 1)
}
#[inline(always)]
pub fn sleep_pd(&mut self) -> SLEEP_PD_W<ACRrs> {
SLEEP_PD_W::new(self, 3)
}
#[inline(always)]
pub fn run_pd(&mut self) -> RUN_PD_W<ACRrs> {
RUN_PD_W::new(self, 4)
}
#[inline(always)]
pub fn disab_buf(&mut self) -> DISAB_BUF_W<ACRrs> {
DISAB_BUF_W::new(self, 5)
}
#[inline(always)]
pub fn pre_read(&mut self) -> PRE_READ_W<ACRrs> {
PRE_READ_W::new(self, 6)
}
}
pub struct ACRrs;
impl crate::RegisterSpec for ACRrs {
type Ux = u32;
}
impl crate::Readable for ACRrs {}
impl crate::Writable for ACRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for ACRrs {}