py32f0/py32f030/rcc/
ahbenr.rspub struct R(crate::R<AHBENR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<AHBENR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<AHBENR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<AHBENR_SPEC>) -> Self {
R(reader)
}
}
pub struct W(crate::W<AHBENR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<AHBENR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<AHBENR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<AHBENR_SPEC>) -> Self {
W(writer)
}
}
pub type DMAEN_R = crate::BitReader<DMAEN_A>;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMAEN_A {
Disabled = 0,
Enabled = 1,
}
impl From<DMAEN_A> for bool {
#[inline(always)]
fn from(variant: DMAEN_A) -> Self {
variant as u8 != 0
}
}
impl DMAEN_R {
#[inline(always)]
pub fn variant(&self) -> DMAEN_A {
match self.bits {
false => DMAEN_A::Disabled,
true => DMAEN_A::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DMAEN_A::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DMAEN_A::Enabled
}
}
pub type DMAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, AHBENR_SPEC, DMAEN_A, O>;
impl<'a, const O: u8> DMAEN_W<'a, O> {
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(DMAEN_A::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(DMAEN_A::Enabled)
}
}
pub use DMAEN_R as FLASHEN_R;
pub use DMAEN_R as SRAMEN_R;
pub use DMAEN_R as CRCEN_R;
pub use DMAEN_W as FLASHEN_W;
pub use DMAEN_W as SRAMEN_W;
pub use DMAEN_W as CRCEN_W;
impl R {
#[inline(always)]
pub fn dmaen(&self) -> DMAEN_R {
DMAEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn flashen(&self) -> FLASHEN_R {
FLASHEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn sramen(&self) -> SRAMEN_R {
SRAMEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn crcen(&self) -> CRCEN_R {
CRCEN_R::new(((self.bits >> 12) & 1) != 0)
}
}
impl W {
#[inline(always)]
#[must_use]
pub fn dmaen(&mut self) -> DMAEN_W<0> {
DMAEN_W::new(self)
}
#[inline(always)]
#[must_use]
pub fn flashen(&mut self) -> FLASHEN_W<8> {
FLASHEN_W::new(self)
}
#[inline(always)]
#[must_use]
pub fn sramen(&mut self) -> SRAMEN_W<9> {
SRAMEN_W::new(self)
}
#[inline(always)]
#[must_use]
pub fn crcen(&mut self) -> CRCEN_W<12> {
CRCEN_W::new(self)
}
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
pub struct AHBENR_SPEC;
impl crate::RegisterSpec for AHBENR_SPEC {
type Ux = u32;
}
impl crate::Readable for AHBENR_SPEC {
type Reader = R;
}
impl crate::Writable for AHBENR_SPEC {
type Writer = W;
const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
impl crate::Resettable for AHBENR_SPEC {
const RESET_VALUE: Self::Ux = 0;
}