pub type R = crate::R<AHB1ENRrs>;
pub type W = crate::W<AHB1ENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum GPIOAEN {
Disabled = 0,
Enabled = 1,
}
impl From<GPIOAEN> for bool {
#[inline(always)]
fn from(variant: GPIOAEN) -> Self {
variant as u8 != 0
}
}
pub type GPIOAEN_R = crate::BitReader<GPIOAEN>;
impl GPIOAEN_R {
#[inline(always)]
pub const fn variant(&self) -> GPIOAEN {
match self.bits {
false => GPIOAEN::Disabled,
true => GPIOAEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == GPIOAEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == GPIOAEN::Enabled
}
}
pub type GPIOAEN_W<'a, REG> = crate::BitWriter<'a, REG, GPIOAEN>;
impl<'a, REG> GPIOAEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(GPIOAEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(GPIOAEN::Enabled)
}
}
pub use GPIOAEN_R as GPIOBEN_R;
pub use GPIOAEN_R as GPIOCEN_R;
pub use GPIOAEN_R as GPIODEN_R;
pub use GPIOAEN_R as GPIOEEN_R;
pub use GPIOAEN_R as GPIOFEN_R;
pub use GPIOAEN_R as GPIOGEN_R;
pub use GPIOAEN_R as GPIOHEN_R;
pub use GPIOAEN_R as GPIOIEN_R;
pub use GPIOAEN_R as GPIOJEN_R;
pub use GPIOAEN_R as GPIOKEN_R;
pub use GPIOAEN_R as CRCEN_R;
pub use GPIOAEN_R as BKPSRAMEN_R;
pub use GPIOAEN_R as DTCMRAMEN_R;
pub use GPIOAEN_R as DMA1EN_R;
pub use GPIOAEN_R as DMA2EN_R;
pub use GPIOAEN_R as DMA2DEN_R;
pub use GPIOAEN_R as ETHMACEN_R;
pub use GPIOAEN_R as ETHMACTXEN_R;
pub use GPIOAEN_R as ETHMACRXEN_R;
pub use GPIOAEN_R as ETHMACPTPEN_R;
pub use GPIOAEN_R as OTGHSEN_R;
pub use GPIOAEN_R as OTGHSULPIEN_R;
pub use GPIOAEN_W as GPIOBEN_W;
pub use GPIOAEN_W as GPIOCEN_W;
pub use GPIOAEN_W as GPIODEN_W;
pub use GPIOAEN_W as GPIOEEN_W;
pub use GPIOAEN_W as GPIOFEN_W;
pub use GPIOAEN_W as GPIOGEN_W;
pub use GPIOAEN_W as GPIOHEN_W;
pub use GPIOAEN_W as GPIOIEN_W;
pub use GPIOAEN_W as GPIOJEN_W;
pub use GPIOAEN_W as GPIOKEN_W;
pub use GPIOAEN_W as CRCEN_W;
pub use GPIOAEN_W as BKPSRAMEN_W;
pub use GPIOAEN_W as DTCMRAMEN_W;
pub use GPIOAEN_W as DMA1EN_W;
pub use GPIOAEN_W as DMA2EN_W;
pub use GPIOAEN_W as DMA2DEN_W;
pub use GPIOAEN_W as ETHMACEN_W;
pub use GPIOAEN_W as ETHMACTXEN_W;
pub use GPIOAEN_W as ETHMACRXEN_W;
pub use GPIOAEN_W as ETHMACPTPEN_W;
pub use GPIOAEN_W as OTGHSEN_W;
pub use GPIOAEN_W as OTGHSULPIEN_W;
impl R {
#[inline(always)]
pub fn gpioaen(&self) -> GPIOAEN_R {
GPIOAEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn gpioben(&self) -> GPIOBEN_R {
GPIOBEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn gpiocen(&self) -> GPIOCEN_R {
GPIOCEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn gpioden(&self) -> GPIODEN_R {
GPIODEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn gpioeen(&self) -> GPIOEEN_R {
GPIOEEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn gpiofen(&self) -> GPIOFEN_R {
GPIOFEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn gpiogen(&self) -> GPIOGEN_R {
GPIOGEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn gpiohen(&self) -> GPIOHEN_R {
GPIOHEN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn gpioien(&self) -> GPIOIEN_R {
GPIOIEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn gpiojen(&self) -> GPIOJEN_R {
GPIOJEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn gpioken(&self) -> GPIOKEN_R {
GPIOKEN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn crcen(&self) -> CRCEN_R {
CRCEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn bkpsramen(&self) -> BKPSRAMEN_R {
BKPSRAMEN_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn dtcmramen(&self) -> DTCMRAMEN_R {
DTCMRAMEN_R::new(((self.bits >> 20) & 1) != 0)
}
#[inline(always)]
pub fn dma1en(&self) -> DMA1EN_R {
DMA1EN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn dma2en(&self) -> DMA2EN_R {
DMA2EN_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn dma2den(&self) -> DMA2DEN_R {
DMA2DEN_R::new(((self.bits >> 23) & 1) != 0)
}
#[inline(always)]
pub fn ethmacen(&self) -> ETHMACEN_R {
ETHMACEN_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn ethmactxen(&self) -> ETHMACTXEN_R {
ETHMACTXEN_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn ethmacrxen(&self) -> ETHMACRXEN_R {
ETHMACRXEN_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn ethmacptpen(&self) -> ETHMACPTPEN_R {
ETHMACPTPEN_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn otghsen(&self) -> OTGHSEN_R {
OTGHSEN_R::new(((self.bits >> 29) & 1) != 0)
}
#[inline(always)]
pub fn otghsulpien(&self) -> OTGHSULPIEN_R {
OTGHSULPIEN_R::new(((self.bits >> 30) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB1ENR")
.field("gpioaen", &self.gpioaen())
.field("otghsulpien", &self.otghsulpien())
.field("otghsen", &self.otghsen())
.field("ethmacptpen", &self.ethmacptpen())
.field("ethmacrxen", &self.ethmacrxen())
.field("ethmactxen", &self.ethmactxen())
.field("ethmacen", &self.ethmacen())
.field("dma2den", &self.dma2den())
.field("dma2en", &self.dma2en())
.field("dma1en", &self.dma1en())
.field("dtcmramen", &self.dtcmramen())
.field("bkpsramen", &self.bkpsramen())
.field("crcen", &self.crcen())
.field("gpioken", &self.gpioken())
.field("gpiojen", &self.gpiojen())
.field("gpioien", &self.gpioien())
.field("gpiohen", &self.gpiohen())
.field("gpiogen", &self.gpiogen())
.field("gpiofen", &self.gpiofen())
.field("gpioeen", &self.gpioeen())
.field("gpioden", &self.gpioden())
.field("gpiocen", &self.gpiocen())
.field("gpioben", &self.gpioben())
.finish()
}
}
impl W {
#[inline(always)]
pub fn gpioaen(&mut self) -> GPIOAEN_W<AHB1ENRrs> {
GPIOAEN_W::new(self, 0)
}
#[inline(always)]
pub fn gpioben(&mut self) -> GPIOBEN_W<AHB1ENRrs> {
GPIOBEN_W::new(self, 1)
}
#[inline(always)]
pub fn gpiocen(&mut self) -> GPIOCEN_W<AHB1ENRrs> {
GPIOCEN_W::new(self, 2)
}
#[inline(always)]
pub fn gpioden(&mut self) -> GPIODEN_W<AHB1ENRrs> {
GPIODEN_W::new(self, 3)
}
#[inline(always)]
pub fn gpioeen(&mut self) -> GPIOEEN_W<AHB1ENRrs> {
GPIOEEN_W::new(self, 4)
}
#[inline(always)]
pub fn gpiofen(&mut self) -> GPIOFEN_W<AHB1ENRrs> {
GPIOFEN_W::new(self, 5)
}
#[inline(always)]
pub fn gpiogen(&mut self) -> GPIOGEN_W<AHB1ENRrs> {
GPIOGEN_W::new(self, 6)
}
#[inline(always)]
pub fn gpiohen(&mut self) -> GPIOHEN_W<AHB1ENRrs> {
GPIOHEN_W::new(self, 7)
}
#[inline(always)]
pub fn gpioien(&mut self) -> GPIOIEN_W<AHB1ENRrs> {
GPIOIEN_W::new(self, 8)
}
#[inline(always)]
pub fn gpiojen(&mut self) -> GPIOJEN_W<AHB1ENRrs> {
GPIOJEN_W::new(self, 9)
}
#[inline(always)]
pub fn gpioken(&mut self) -> GPIOKEN_W<AHB1ENRrs> {
GPIOKEN_W::new(self, 10)
}
#[inline(always)]
pub fn crcen(&mut self) -> CRCEN_W<AHB1ENRrs> {
CRCEN_W::new(self, 12)
}
#[inline(always)]
pub fn bkpsramen(&mut self) -> BKPSRAMEN_W<AHB1ENRrs> {
BKPSRAMEN_W::new(self, 18)
}
#[inline(always)]
pub fn dtcmramen(&mut self) -> DTCMRAMEN_W<AHB1ENRrs> {
DTCMRAMEN_W::new(self, 20)
}
#[inline(always)]
pub fn dma1en(&mut self) -> DMA1EN_W<AHB1ENRrs> {
DMA1EN_W::new(self, 21)
}
#[inline(always)]
pub fn dma2en(&mut self) -> DMA2EN_W<AHB1ENRrs> {
DMA2EN_W::new(self, 22)
}
#[inline(always)]
pub fn dma2den(&mut self) -> DMA2DEN_W<AHB1ENRrs> {
DMA2DEN_W::new(self, 23)
}
#[inline(always)]
pub fn ethmacen(&mut self) -> ETHMACEN_W<AHB1ENRrs> {
ETHMACEN_W::new(self, 25)
}
#[inline(always)]
pub fn ethmactxen(&mut self) -> ETHMACTXEN_W<AHB1ENRrs> {
ETHMACTXEN_W::new(self, 26)
}
#[inline(always)]
pub fn ethmacrxen(&mut self) -> ETHMACRXEN_W<AHB1ENRrs> {
ETHMACRXEN_W::new(self, 27)
}
#[inline(always)]
pub fn ethmacptpen(&mut self) -> ETHMACPTPEN_W<AHB1ENRrs> {
ETHMACPTPEN_W::new(self, 28)
}
#[inline(always)]
pub fn otghsen(&mut self) -> OTGHSEN_W<AHB1ENRrs> {
OTGHSEN_W::new(self, 29)
}
#[inline(always)]
pub fn otghsulpien(&mut self) -> OTGHSULPIEN_W<AHB1ENRrs> {
OTGHSULPIEN_W::new(self, 30)
}
}
pub struct AHB1ENRrs;
impl crate::RegisterSpec for AHB1ENRrs {
type Ux = u32;
}
impl crate::Readable for AHB1ENRrs {}
impl crate::Writable for AHB1ENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB1ENRrs {
const RESET_VALUE: u32 = 0x0010_0000;
}