pub type R = crate::R<AHB4LPENRrs>;
pub type W = crate::W<AHB4LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum GPIOALPEN {
Disabled = 0,
Enabled = 1,
}
impl From<GPIOALPEN> for bool {
#[inline(always)]
fn from(variant: GPIOALPEN) -> Self {
variant as u8 != 0
}
}
pub type GPIOALPEN_R = crate::BitReader<GPIOALPEN>;
impl GPIOALPEN_R {
#[inline(always)]
pub const fn variant(&self) -> GPIOALPEN {
match self.bits {
false => GPIOALPEN::Disabled,
true => GPIOALPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == GPIOALPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == GPIOALPEN::Enabled
}
}
pub type GPIOALPEN_W<'a, REG> = crate::BitWriter<'a, REG, GPIOALPEN>;
impl<'a, REG> GPIOALPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(GPIOALPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(GPIOALPEN::Enabled)
}
}
pub use GPIOALPEN_R as GPIOBLPEN_R;
pub use GPIOALPEN_R as GPIOCLPEN_R;
pub use GPIOALPEN_R as GPIODLPEN_R;
pub use GPIOALPEN_R as GPIOELPEN_R;
pub use GPIOALPEN_R as GPIOFLPEN_R;
pub use GPIOALPEN_R as GPIOGLPEN_R;
pub use GPIOALPEN_R as GPIOHLPEN_R;
pub use GPIOALPEN_R as GPIOMLPEN_R;
pub use GPIOALPEN_R as GPIONLPEN_R;
pub use GPIOALPEN_R as GPIOOLPEN_R;
pub use GPIOALPEN_R as GPIOPLPEN_R;
pub use GPIOALPEN_R as CRCLPEN_R;
pub use GPIOALPEN_R as BKPRAMLPEN_R;
pub use GPIOALPEN_W as GPIOBLPEN_W;
pub use GPIOALPEN_W as GPIOCLPEN_W;
pub use GPIOALPEN_W as GPIODLPEN_W;
pub use GPIOALPEN_W as GPIOELPEN_W;
pub use GPIOALPEN_W as GPIOFLPEN_W;
pub use GPIOALPEN_W as GPIOGLPEN_W;
pub use GPIOALPEN_W as GPIOHLPEN_W;
pub use GPIOALPEN_W as GPIOMLPEN_W;
pub use GPIOALPEN_W as GPIONLPEN_W;
pub use GPIOALPEN_W as GPIOOLPEN_W;
pub use GPIOALPEN_W as GPIOPLPEN_W;
pub use GPIOALPEN_W as CRCLPEN_W;
pub use GPIOALPEN_W as BKPRAMLPEN_W;
impl R {
#[inline(always)]
pub fn gpioalpen(&self) -> GPIOALPEN_R {
GPIOALPEN_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn gpioblpen(&self) -> GPIOBLPEN_R {
GPIOBLPEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn gpioclpen(&self) -> GPIOCLPEN_R {
GPIOCLPEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[inline(always)]
pub fn gpiodlpen(&self) -> GPIODLPEN_R {
GPIODLPEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn gpioelpen(&self) -> GPIOELPEN_R {
GPIOELPEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn gpioflpen(&self) -> GPIOFLPEN_R {
GPIOFLPEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn gpioglpen(&self) -> GPIOGLPEN_R {
GPIOGLPEN_R::new(((self.bits >> 6) & 1) != 0)
}
#[inline(always)]
pub fn gpiohlpen(&self) -> GPIOHLPEN_R {
GPIOHLPEN_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn gpiomlpen(&self) -> GPIOMLPEN_R {
GPIOMLPEN_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn gpionlpen(&self) -> GPIONLPEN_R {
GPIONLPEN_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn gpioolpen(&self) -> GPIOOLPEN_R {
GPIOOLPEN_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn gpioplpen(&self) -> GPIOPLPEN_R {
GPIOPLPEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn crclpen(&self) -> CRCLPEN_R {
CRCLPEN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn bkpramlpen(&self) -> BKPRAMLPEN_R {
BKPRAMLPEN_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("AHB4LPENR")
.field("gpioalpen", &self.gpioalpen())
.field("gpioblpen", &self.gpioblpen())
.field("gpioclpen", &self.gpioclpen())
.field("gpiodlpen", &self.gpiodlpen())
.field("gpioelpen", &self.gpioelpen())
.field("gpioflpen", &self.gpioflpen())
.field("gpioglpen", &self.gpioglpen())
.field("gpiohlpen", &self.gpiohlpen())
.field("gpiomlpen", &self.gpiomlpen())
.field("gpionlpen", &self.gpionlpen())
.field("gpioolpen", &self.gpioolpen())
.field("gpioplpen", &self.gpioplpen())
.field("crclpen", &self.crclpen())
.field("bkpramlpen", &self.bkpramlpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn gpioalpen(&mut self) -> GPIOALPEN_W<AHB4LPENRrs> {
GPIOALPEN_W::new(self, 0)
}
#[inline(always)]
pub fn gpioblpen(&mut self) -> GPIOBLPEN_W<AHB4LPENRrs> {
GPIOBLPEN_W::new(self, 1)
}
#[inline(always)]
pub fn gpioclpen(&mut self) -> GPIOCLPEN_W<AHB4LPENRrs> {
GPIOCLPEN_W::new(self, 2)
}
#[inline(always)]
pub fn gpiodlpen(&mut self) -> GPIODLPEN_W<AHB4LPENRrs> {
GPIODLPEN_W::new(self, 3)
}
#[inline(always)]
pub fn gpioelpen(&mut self) -> GPIOELPEN_W<AHB4LPENRrs> {
GPIOELPEN_W::new(self, 4)
}
#[inline(always)]
pub fn gpioflpen(&mut self) -> GPIOFLPEN_W<AHB4LPENRrs> {
GPIOFLPEN_W::new(self, 5)
}
#[inline(always)]
pub fn gpioglpen(&mut self) -> GPIOGLPEN_W<AHB4LPENRrs> {
GPIOGLPEN_W::new(self, 6)
}
#[inline(always)]
pub fn gpiohlpen(&mut self) -> GPIOHLPEN_W<AHB4LPENRrs> {
GPIOHLPEN_W::new(self, 7)
}
#[inline(always)]
pub fn gpiomlpen(&mut self) -> GPIOMLPEN_W<AHB4LPENRrs> {
GPIOMLPEN_W::new(self, 12)
}
#[inline(always)]
pub fn gpionlpen(&mut self) -> GPIONLPEN_W<AHB4LPENRrs> {
GPIONLPEN_W::new(self, 13)
}
#[inline(always)]
pub fn gpioolpen(&mut self) -> GPIOOLPEN_W<AHB4LPENRrs> {
GPIOOLPEN_W::new(self, 14)
}
#[inline(always)]
pub fn gpioplpen(&mut self) -> GPIOPLPEN_W<AHB4LPENRrs> {
GPIOPLPEN_W::new(self, 15)
}
#[inline(always)]
pub fn crclpen(&mut self) -> CRCLPEN_W<AHB4LPENRrs> {
CRCLPEN_W::new(self, 19)
}
#[inline(always)]
pub fn bkpramlpen(&mut self) -> BKPRAMLPEN_W<AHB4LPENRrs> {
BKPRAMLPEN_W::new(self, 28)
}
}
pub struct AHB4LPENRrs;
impl crate::RegisterSpec for AHB4LPENRrs {
type Ux = u32;
}
impl crate::Readable for AHB4LPENRrs {}
impl crate::Writable for AHB4LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB4LPENRrs {
const RESET_VALUE: u32 = 0x1008_f0ff;
}