stm32f1_staging/stm32f101/fsmc/
bwtr.rspub type R = crate::R<BWTRrs>;
pub type W = crate::W<BWTRrs>;
pub type ADDSET_R = crate::FieldReader;
pub type ADDSET_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type ADDHLD_R = crate::FieldReader;
pub type ADDHLD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type DATAST_R = crate::FieldReader;
pub type DATAST_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
pub type BUSTURN_R = crate::FieldReader;
pub type BUSTURN_W<'a, REG> = crate::FieldWriter<'a, REG, 4, u8, crate::Safe>;
pub type CLKDIV_R = crate::FieldReader;
pub type CLKDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
pub type DATLAT_R = crate::FieldReader;
pub type DATLAT_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ACCMOD {
A = 0,
B = 1,
C = 2,
D = 3,
}
impl From<ACCMOD> for u8 {
#[inline(always)]
fn from(variant: ACCMOD) -> Self {
variant as _
}
}
impl crate::FieldSpec for ACCMOD {
type Ux = u8;
}
impl crate::IsEnum for ACCMOD {}
pub type ACCMOD_R = crate::FieldReader<ACCMOD>;
impl ACCMOD_R {
#[inline(always)]
pub const fn variant(&self) -> ACCMOD {
match self.bits {
0 => ACCMOD::A,
1 => ACCMOD::B,
2 => ACCMOD::C,
3 => ACCMOD::D,
_ => unreachable!(),
}
}
#[inline(always)]
pub fn is_a(&self) -> bool {
*self == ACCMOD::A
}
#[inline(always)]
pub fn is_b(&self) -> bool {
*self == ACCMOD::B
}
#[inline(always)]
pub fn is_c(&self) -> bool {
*self == ACCMOD::C
}
#[inline(always)]
pub fn is_d(&self) -> bool {
*self == ACCMOD::D
}
}
pub type ACCMOD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ACCMOD, crate::Safe>;
impl<'a, REG> ACCMOD_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn a(self) -> &'a mut crate::W<REG> {
self.variant(ACCMOD::A)
}
#[inline(always)]
pub fn b(self) -> &'a mut crate::W<REG> {
self.variant(ACCMOD::B)
}
#[inline(always)]
pub fn c(self) -> &'a mut crate::W<REG> {
self.variant(ACCMOD::C)
}
#[inline(always)]
pub fn d(self) -> &'a mut crate::W<REG> {
self.variant(ACCMOD::D)
}
}
impl R {
#[inline(always)]
pub fn addset(&self) -> ADDSET_R {
ADDSET_R::new((self.bits & 0x0f) as u8)
}
#[inline(always)]
pub fn addhld(&self) -> ADDHLD_R {
ADDHLD_R::new(((self.bits >> 4) & 0x0f) as u8)
}
#[inline(always)]
pub fn datast(&self) -> DATAST_R {
DATAST_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[inline(always)]
pub fn busturn(&self) -> BUSTURN_R {
BUSTURN_R::new(((self.bits >> 16) & 0x0f) as u8)
}
#[inline(always)]
pub fn clkdiv(&self) -> CLKDIV_R {
CLKDIV_R::new(((self.bits >> 20) & 0x0f) as u8)
}
#[inline(always)]
pub fn datlat(&self) -> DATLAT_R {
DATLAT_R::new(((self.bits >> 24) & 0x0f) as u8)
}
#[inline(always)]
pub fn accmod(&self) -> ACCMOD_R {
ACCMOD_R::new(((self.bits >> 28) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("BWTR")
.field("accmod", &self.accmod())
.field("datlat", &self.datlat())
.field("clkdiv", &self.clkdiv())
.field("datast", &self.datast())
.field("addhld", &self.addhld())
.field("addset", &self.addset())
.field("busturn", &self.busturn())
.finish()
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn addset(&mut self) -> ADDSET_W<BWTRrs> {
ADDSET_W::new(self, 0)
}
#[inline(always)]
#[must_use]
pub fn addhld(&mut self) -> ADDHLD_W<BWTRrs> {
ADDHLD_W::new(self, 4)
}
#[inline(always)]
#[must_use]
pub fn datast(&mut self) -> DATAST_W<BWTRrs> {
DATAST_W::new(self, 8)
}
#[inline(always)]
#[must_use]
pub fn busturn(&mut self) -> BUSTURN_W<BWTRrs> {
BUSTURN_W::new(self, 16)
}
#[inline(always)]
#[must_use]
pub fn clkdiv(&mut self) -> CLKDIV_W<BWTRrs> {
CLKDIV_W::new(self, 20)
}
#[inline(always)]
#[must_use]
pub fn datlat(&mut self) -> DATLAT_W<BWTRrs> {
DATLAT_W::new(self, 24)
}
#[inline(always)]
#[must_use]
pub fn accmod(&mut self) -> ACCMOD_W<BWTRrs> {
ACCMOD_W::new(self, 28)
}
}
pub struct BWTRrs;
impl crate::RegisterSpec for BWTRrs {
type Ux = u32;
}
impl crate::Readable for BWTRrs {}
impl crate::Writable for BWTRrs {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
impl crate::Resettable for BWTRrs {
const RESET_VALUE: u32 = 0x0fff_ffff;
}