pub type R = crate::R<AHB1LPENRrs>;
pub type W = crate::W<AHB1LPENRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum GPDMA1LPEN {
Disabled = 0,
Enabled = 1,
}
impl From<GPDMA1LPEN> for bool {
#[inline(always)]
fn from(variant: GPDMA1LPEN) -> Self {
variant as u8 != 0
}
}
pub type GPDMA1LPEN_R = crate::BitReader<GPDMA1LPEN>;
impl GPDMA1LPEN_R {
#[inline(always)]
pub const fn variant(&self) -> GPDMA1LPEN {
match self.bits {
false => GPDMA1LPEN::Disabled,
true => GPDMA1LPEN::Enabled,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == GPDMA1LPEN::Disabled
}
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == GPDMA1LPEN::Enabled
}
}
pub type GPDMA1LPEN_W<'a, REG> = crate::BitWriter<'a, REG, GPDMA1LPEN>;
impl<'a, REG> GPDMA1LPEN_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(GPDMA1LPEN::Disabled)
}
#[inline(always)]
pub fn enabled(self) -> &'a mut crate::W<REG> {
self.variant(GPDMA1LPEN::Enabled)
}
}
pub use GPDMA1LPEN_R as ADC12LPEN_R;
pub use GPDMA1LPEN_R as ETH1MACLPEN_R;
pub use GPDMA1LPEN_R as ETH1TXLPEN_R;
pub use GPDMA1LPEN_R as ETH1RXLPEN_R;
pub use GPDMA1LPEN_W as ADC12LPEN_W;
pub use GPDMA1LPEN_W as ETH1MACLPEN_W;
pub use GPDMA1LPEN_W as ETH1TXLPEN_W;
pub use GPDMA1LPEN_W as ETH1RXLPEN_W;
pub type USBPDCTRL_R = crate::BitReader;
pub type USBPDCTRL_W<'a, REG> = crate::BitWriter<'a, REG>;
pub use GPDMA1LPEN_R as OTGHSLPEN_R;
pub use GPDMA1LPEN_R as USBPHYCLPEN_R;
pub use GPDMA1LPEN_R as OTGFSLPEN_R;
pub use GPDMA1LPEN_R as ADFLPEN_R;
pub use GPDMA1LPEN_W as OTGHSLPEN_W;
pub use GPDMA1LPEN_W as USBPHYCLPEN_W;
pub use GPDMA1LPEN_W as OTGFSLPEN_W;
pub use GPDMA1LPEN_W as ADFLPEN_W;
impl R {
#[inline(always)]
pub fn gpdma1lpen(&self) -> GPDMA1LPEN_R {
GPDMA1LPEN_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn adc12lpen(&self) -> ADC12LPEN_R {
ADC12LPEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn eth1maclpen(&self) -> ETH1MACLPEN_R {
ETH1MACLPEN_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn eth1txlpen(&self) -> ETH1TXLPEN_R {
ETH1TXLPEN_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn eth1rxlpen(&self) -> ETH1RXLPEN_R {
ETH1RXLPEN_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn usbpdctrl(&self) -> USBPDCTRL_R {
USBPDCTRL_R::new(((self.bits >> 24) & 1) != 0)
}
#[inline(always)]
pub fn otghslpen(&self) -> OTGHSLPEN_R {
OTGHSLPEN_R::new(((self.bits >> 25) & 1) != 0)
}
#[inline(always)]
pub fn usbphyclpen(&self) -> USBPHYCLPEN_R {
USBPHYCLPEN_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn otgfslpen(&self) -> OTGFSLPEN_R {
OTGFSLPEN_R::new(((self.bits >> 27) & 1) != 0)
}
#[inline(always)]
pub fn adflpen(&self) -> ADFLPEN_R {
ADFLPEN_R::new(((self.bits >> 31) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("AHB1LPENR")
.field("gpdma1lpen", &self.gpdma1lpen())
.field("adc12lpen", &self.adc12lpen())
.field("eth1maclpen", &self.eth1maclpen())
.field("eth1txlpen", &self.eth1txlpen())
.field("eth1rxlpen", &self.eth1rxlpen())
.field("usbpdctrl", &self.usbpdctrl())
.field("otghslpen", &self.otghslpen())
.field("usbphyclpen", &self.usbphyclpen())
.field("otgfslpen", &self.otgfslpen())
.field("adflpen", &self.adflpen())
.finish()
}
}
impl W {
#[inline(always)]
pub fn gpdma1lpen(&mut self) -> GPDMA1LPEN_W<AHB1LPENRrs> {
GPDMA1LPEN_W::new(self, 4)
}
#[inline(always)]
pub fn adc12lpen(&mut self) -> ADC12LPEN_W<AHB1LPENRrs> {
ADC12LPEN_W::new(self, 5)
}
#[inline(always)]
pub fn eth1maclpen(&mut self) -> ETH1MACLPEN_W<AHB1LPENRrs> {
ETH1MACLPEN_W::new(self, 15)
}
#[inline(always)]
pub fn eth1txlpen(&mut self) -> ETH1TXLPEN_W<AHB1LPENRrs> {
ETH1TXLPEN_W::new(self, 16)
}
#[inline(always)]
pub fn eth1rxlpen(&mut self) -> ETH1RXLPEN_W<AHB1LPENRrs> {
ETH1RXLPEN_W::new(self, 17)
}
#[inline(always)]
pub fn usbpdctrl(&mut self) -> USBPDCTRL_W<AHB1LPENRrs> {
USBPDCTRL_W::new(self, 24)
}
#[inline(always)]
pub fn otghslpen(&mut self) -> OTGHSLPEN_W<AHB1LPENRrs> {
OTGHSLPEN_W::new(self, 25)
}
#[inline(always)]
pub fn usbphyclpen(&mut self) -> USBPHYCLPEN_W<AHB1LPENRrs> {
USBPHYCLPEN_W::new(self, 26)
}
#[inline(always)]
pub fn otgfslpen(&mut self) -> OTGFSLPEN_W<AHB1LPENRrs> {
OTGFSLPEN_W::new(self, 27)
}
#[inline(always)]
pub fn adflpen(&mut self) -> ADFLPEN_W<AHB1LPENRrs> {
ADFLPEN_W::new(self, 31)
}
}
pub struct AHB1LPENRrs;
impl crate::RegisterSpec for AHB1LPENRrs {
type Ux = u32;
}
impl crate::Readable for AHB1LPENRrs {}
impl crate::Writable for AHB1LPENRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for AHB1LPENRrs {
const RESET_VALUE: u32 = 0x8e03_8030;
}