pub type R = crate::R<READCTRLrs>;
pub type W = crate::W<READCTRLrs>;
pub type IfcdisR = crate::BitReader;
pub type IfcdisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type AidisR = crate::BitReader;
pub type AidisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type IccdisR = crate::BitReader;
pub type IccdisW<'a, REG> = crate::BitWriter<'a, REG>;
pub type PrefetchR = crate::BitReader;
pub type PrefetchW<'a, REG> = crate::BitWriter<'a, REG>;
pub type UsehprotR = crate::BitReader;
pub type UsehprotW<'a, REG> = crate::BitWriter<'a, REG>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum MODE {
Ws0 = 0,
Ws1 = 1,
}
impl From<MODE> for u8 {
#[inline(always)]
fn from(variant: MODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for MODE {
type Ux = u8;
}
impl crate::IsEnum for MODE {}
pub type ModeR = crate::FieldReader<MODE>;
impl ModeR {
#[inline(always)]
pub const fn variant(&self) -> Option<MODE> {
match self.bits {
0 => Some(MODE::Ws0),
1 => Some(MODE::Ws1),
_ => None,
}
}
#[inline(always)]
pub fn is_ws0(&self) -> bool {
*self == MODE::Ws0
}
#[inline(always)]
pub fn is_ws1(&self) -> bool {
*self == MODE::Ws1
}
}
pub type ModeW<'a, REG> = crate::FieldWriter<'a, REG, 2, MODE>;
impl<'a, REG> ModeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn ws0(self) -> &'a mut crate::W<REG> {
self.variant(MODE::Ws0)
}
#[inline(always)]
pub fn ws1(self) -> &'a mut crate::W<REG> {
self.variant(MODE::Ws1)
}
}
pub type ScbtpR = crate::BitReader;
pub type ScbtpW<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[inline(always)]
pub fn ifcdis(&self) -> IfcdisR {
IfcdisR::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn aidis(&self) -> AidisR {
AidisR::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn iccdis(&self) -> IccdisR {
IccdisR::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn prefetch(&self) -> PrefetchR {
PrefetchR::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn usehprot(&self) -> UsehprotR {
UsehprotR::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn mode(&self) -> ModeR {
ModeR::new(((self.bits >> 24) & 3) as u8)
}
#[inline(always)]
pub fn scbtp(&self) -> ScbtpR {
ScbtpR::new(((self.bits >> 28) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("READCTRL")
.field("ifcdis", &self.ifcdis())
.field("aidis", &self.aidis())
.field("iccdis", &self.iccdis())
.field("prefetch", &self.prefetch())
.field("usehprot", &self.usehprot())
.field("mode", &self.mode())
.field("scbtp", &self.scbtp())
.finish()
}
}
impl W {
#[inline(always)]
pub fn ifcdis(&mut self) -> IfcdisW<'_, READCTRLrs> {
IfcdisW::new(self, 3)
}
#[inline(always)]
pub fn aidis(&mut self) -> AidisW<'_, READCTRLrs> {
AidisW::new(self, 4)
}
#[inline(always)]
pub fn iccdis(&mut self) -> IccdisW<'_, READCTRLrs> {
IccdisW::new(self, 5)
}
#[inline(always)]
pub fn prefetch(&mut self) -> PrefetchW<'_, READCTRLrs> {
PrefetchW::new(self, 8)
}
#[inline(always)]
pub fn usehprot(&mut self) -> UsehprotW<'_, READCTRLrs> {
UsehprotW::new(self, 9)
}
#[inline(always)]
pub fn mode(&mut self) -> ModeW<'_, READCTRLrs> {
ModeW::new(self, 24)
}
#[inline(always)]
pub fn scbtp(&mut self) -> ScbtpW<'_, READCTRLrs> {
ScbtpW::new(self, 28)
}
}
pub struct READCTRLrs;
impl crate::RegisterSpec for READCTRLrs {
type Ux = u32;
}
impl crate::Readable for READCTRLrs {}
impl crate::Writable for READCTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for READCTRLrs {
const RESET_VALUE: u32 = 0x0100_0100;
}