pub type R = crate::R<RAM0CTRLrs>;
pub type W = crate::W<RAM0CTRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum RAMPOWERDOWN {
None = 0,
Blk4 = 8,
Blk3to4 = 12,
Blk2to4 = 14,
Blk1to4 = 15,
}
impl From<RAMPOWERDOWN> for u8 {
#[inline(always)]
fn from(variant: RAMPOWERDOWN) -> Self {
variant as _
}
}
impl crate::FieldSpec for RAMPOWERDOWN {
type Ux = u8;
}
impl crate::IsEnum for RAMPOWERDOWN {}
pub type RampowerdownR = crate::FieldReader<RAMPOWERDOWN>;
impl RampowerdownR {
#[inline(always)]
pub const fn variant(&self) -> Option<RAMPOWERDOWN> {
match self.bits {
0 => Some(RAMPOWERDOWN::None),
8 => Some(RAMPOWERDOWN::Blk4),
12 => Some(RAMPOWERDOWN::Blk3to4),
14 => Some(RAMPOWERDOWN::Blk2to4),
15 => Some(RAMPOWERDOWN::Blk1to4),
_ => None,
}
}
#[inline(always)]
pub fn is_none(&self) -> bool {
*self == RAMPOWERDOWN::None
}
#[inline(always)]
pub fn is_blk4(&self) -> bool {
*self == RAMPOWERDOWN::Blk4
}
#[inline(always)]
pub fn is_blk3to4(&self) -> bool {
*self == RAMPOWERDOWN::Blk3to4
}
#[inline(always)]
pub fn is_blk2to4(&self) -> bool {
*self == RAMPOWERDOWN::Blk2to4
}
#[inline(always)]
pub fn is_blk1to4(&self) -> bool {
*self == RAMPOWERDOWN::Blk1to4
}
}
pub type RampowerdownW<'a, REG> = crate::FieldWriter<'a, REG, 4, RAMPOWERDOWN>;
impl<'a, REG> RampowerdownW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn none(self) -> &'a mut crate::W<REG> {
self.variant(RAMPOWERDOWN::None)
}
#[inline(always)]
pub fn blk4(self) -> &'a mut crate::W<REG> {
self.variant(RAMPOWERDOWN::Blk4)
}
#[inline(always)]
pub fn blk3to4(self) -> &'a mut crate::W<REG> {
self.variant(RAMPOWERDOWN::Blk3to4)
}
#[inline(always)]
pub fn blk2to4(self) -> &'a mut crate::W<REG> {
self.variant(RAMPOWERDOWN::Blk2to4)
}
#[inline(always)]
pub fn blk1to4(self) -> &'a mut crate::W<REG> {
self.variant(RAMPOWERDOWN::Blk1to4)
}
}
impl R {
#[inline(always)]
pub fn rampowerdown(&self) -> RampowerdownR {
RampowerdownR::new((self.bits & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("RAM0CTRL")
.field("rampowerdown", &self.rampowerdown())
.finish()
}
}
impl W {
#[inline(always)]
pub fn rampowerdown(&mut self) -> RampowerdownW<'_, RAM0CTRLrs> {
RampowerdownW::new(self, 0)
}
}
pub struct RAM0CTRLrs;
impl crate::RegisterSpec for RAM0CTRLrs {
type Ux = u32;
}
impl crate::Readable for RAM0CTRLrs {}
impl crate::Writable for RAM0CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for RAM0CTRLrs {}