pub type R = crate::R<AHB4ENRrs>;
pub type W = crate::W<AHB4ENRrs>;
#[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 GPIOMEN_R;
pub use GPIOAEN_R as GPIONEN_R;
pub use GPIOAEN_R as GPIOOEN_R;
pub use GPIOAEN_R as GPIOPEN_R;
pub use GPIOAEN_R as CRCEN_R;
pub use GPIOAEN_R as BKPRAMEN_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 GPIOMEN_W;
pub use GPIOAEN_W as GPIONEN_W;
pub use GPIOAEN_W as GPIOOEN_W;
pub use GPIOAEN_W as GPIOPEN_W;
pub use GPIOAEN_W as CRCEN_W;
pub use GPIOAEN_W as BKPRAMEN_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 gpiomen(&self) -> GPIOMEN_R {
GPIOMEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn gpionen(&self) -> GPIONEN_R {
GPIONEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn gpiooen(&self) -> GPIOOEN_R {
GPIOOEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn gpiopen(&self) -> GPIOPEN_R {
GPIOPEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn crcen(&self) -> CRCEN_R {
CRCEN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn bkpramen(&self) -> BKPRAMEN_R {
BKPRAMEN_R::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("AHB4ENR")
.field("gpioaen", &self.gpioaen())
.field("gpioben", &self.gpioben())
.field("gpiocen", &self.gpiocen())
.field("gpioden", &self.gpioden())
.field("gpioeen", &self.gpioeen())
.field("gpiofen", &self.gpiofen())
.field("gpiogen", &self.gpiogen())
.field("gpiohen", &self.gpiohen())
.field("gpiomen", &self.gpiomen())
.field("gpionen", &self.gpionen())
.field("gpiooen", &self.gpiooen())
.field("gpiopen", &self.gpiopen())
.field("crcen", &self.crcen())
.field("bkpramen", &self.bkpramen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn gpioaen(&mut self) -> GPIOAEN_W<AHB4ENRrs> {
GPIOAEN_W::new(self, 0)
}
#[inline(always)]
pub fn gpioben(&mut self) -> GPIOBEN_W<AHB4ENRrs> {
GPIOBEN_W::new(self, 1)
}
#[inline(always)]
pub fn gpiocen(&mut self) -> GPIOCEN_W<AHB4ENRrs> {
GPIOCEN_W::new(self, 2)
}
#[inline(always)]
pub fn gpioden(&mut self) -> GPIODEN_W<AHB4ENRrs> {
GPIODEN_W::new(self, 3)
}
#[inline(always)]
pub fn gpioeen(&mut self) -> GPIOEEN_W<AHB4ENRrs> {
GPIOEEN_W::new(self, 4)
}
#[inline(always)]
pub fn gpiofen(&mut self) -> GPIOFEN_W<AHB4ENRrs> {
GPIOFEN_W::new(self, 5)
}
#[inline(always)]
pub fn gpiogen(&mut self) -> GPIOGEN_W<AHB4ENRrs> {
GPIOGEN_W::new(self, 6)
}
#[inline(always)]
pub fn gpiohen(&mut self) -> GPIOHEN_W<AHB4ENRrs> {
GPIOHEN_W::new(self, 7)
}
#[inline(always)]
pub fn gpiomen(&mut self) -> GPIOMEN_W<AHB4ENRrs> {
GPIOMEN_W::new(self, 12)
}
#[inline(always)]
pub fn gpionen(&mut self) -> GPIONEN_W<AHB4ENRrs> {
GPIONEN_W::new(self, 13)
}
#[inline(always)]
pub fn gpiooen(&mut self) -> GPIOOEN_W<AHB4ENRrs> {
GPIOOEN_W::new(self, 14)
}
#[inline(always)]
pub fn gpiopen(&mut self) -> GPIOPEN_W<AHB4ENRrs> {
GPIOPEN_W::new(self, 15)
}
#[inline(always)]
pub fn crcen(&mut self) -> CRCEN_W<AHB4ENRrs> {
CRCEN_W::new(self, 19)
}
#[inline(always)]
pub fn bkpramen(&mut self) -> BKPRAMEN_W<AHB4ENRrs> {
BKPRAMEN_W::new(self, 28)
}
}
pub struct AHB4ENRrs;
impl crate::RegisterSpec for AHB4ENRrs {
type Ux = u32;
}
impl crate::Readable for AHB4ENRrs {}
impl crate::Writable for AHB4ENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB4ENRrs {}