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 GPIOILPEN_R;
pub use GPIOALPEN_R as GPIOJLPEN_R;
pub use GPIOALPEN_R as GPIOKLPEN_R;
pub use GPIOALPEN_R as CRCLPEN_R;
pub use GPIOALPEN_R as BDMALPEN_R;
pub use GPIOALPEN_R as ADC3LPEN_R;
pub use GPIOALPEN_R as BKPRAMLPEN_R;
pub use GPIOALPEN_R as SRAM4LPEN_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 GPIOILPEN_W;
pub use GPIOALPEN_W as GPIOJLPEN_W;
pub use GPIOALPEN_W as GPIOKLPEN_W;
pub use GPIOALPEN_W as CRCLPEN_W;
pub use GPIOALPEN_W as BDMALPEN_W;
pub use GPIOALPEN_W as ADC3LPEN_W;
pub use GPIOALPEN_W as BKPRAMLPEN_W;
pub use GPIOALPEN_W as SRAM4LPEN_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 gpioilpen(&self) -> GPIOILPEN_R {
GPIOILPEN_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn gpiojlpen(&self) -> GPIOJLPEN_R {
GPIOJLPEN_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn gpioklpen(&self) -> GPIOKLPEN_R {
GPIOKLPEN_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn crclpen(&self) -> CRCLPEN_R {
CRCLPEN_R::new(((self.bits >> 19) & 1) != 0)
}
#[inline(always)]
pub fn bdmalpen(&self) -> BDMALPEN_R {
BDMALPEN_R::new(((self.bits >> 21) & 1) != 0)
}
#[inline(always)]
pub fn adc3lpen(&self) -> ADC3LPEN_R {
ADC3LPEN_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn bkpramlpen(&self) -> BKPRAMLPEN_R {
BKPRAMLPEN_R::new(((self.bits >> 28) & 1) != 0)
}
#[inline(always)]
pub fn sram4lpen(&self) -> SRAM4LPEN_R {
SRAM4LPEN_R::new(((self.bits >> 29) & 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("gpioilpen", &self.gpioilpen())
.field("gpiojlpen", &self.gpiojlpen())
.field("gpioklpen", &self.gpioklpen())
.field("crclpen", &self.crclpen())
.field("bdmalpen", &self.bdmalpen())
.field("adc3lpen", &self.adc3lpen())
.field("bkpramlpen", &self.bkpramlpen())
.field("sram4lpen", &self.sram4lpen())
.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 gpioilpen(&mut self) -> GPIOILPEN_W<AHB4LPENRrs> {
GPIOILPEN_W::new(self, 8)
}
#[inline(always)]
pub fn gpiojlpen(&mut self) -> GPIOJLPEN_W<AHB4LPENRrs> {
GPIOJLPEN_W::new(self, 9)
}
#[inline(always)]
pub fn gpioklpen(&mut self) -> GPIOKLPEN_W<AHB4LPENRrs> {
GPIOKLPEN_W::new(self, 10)
}
#[inline(always)]
pub fn crclpen(&mut self) -> CRCLPEN_W<AHB4LPENRrs> {
CRCLPEN_W::new(self, 19)
}
#[inline(always)]
pub fn bdmalpen(&mut self) -> BDMALPEN_W<AHB4LPENRrs> {
BDMALPEN_W::new(self, 21)
}
#[inline(always)]
pub fn adc3lpen(&mut self) -> ADC3LPEN_W<AHB4LPENRrs> {
ADC3LPEN_W::new(self, 24)
}
#[inline(always)]
pub fn bkpramlpen(&mut self) -> BKPRAMLPEN_W<AHB4LPENRrs> {
BKPRAMLPEN_W::new(self, 28)
}
#[inline(always)]
pub fn sram4lpen(&mut self) -> SRAM4LPEN_W<AHB4LPENRrs> {
SRAM4LPEN_W::new(self, 29)
}
}
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 {}