pub type R = crate::R<APB4RSTRrs>;
pub type W = crate::W<APB4RSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYSCFGRST {
Reset = 1,
}
impl From<SYSCFGRST> for bool {
#[inline(always)]
fn from(variant: SYSCFGRST) -> Self {
variant as u8 != 0
}
}
pub type SYSCFGRST_R = crate::BitReader<SYSCFGRST>;
impl SYSCFGRST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SYSCFGRST> {
match self.bits {
true => Some(SYSCFGRST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == SYSCFGRST::Reset
}
}
pub type SYSCFGRST_W<'a, REG> = crate::BitWriter<'a, REG, SYSCFGRST>;
impl<'a, REG> SYSCFGRST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(SYSCFGRST::Reset)
}
}
pub use SYSCFGRST_R as LPUART1RST_R;
pub use SYSCFGRST_R as SPI6RST_R;
pub use SYSCFGRST_R as I2C4RST_R;
pub use SYSCFGRST_R as LPTIM2RST_R;
pub use SYSCFGRST_R as LPTIM3RST_R;
pub use SYSCFGRST_R as DAC2RST_R;
pub use SYSCFGRST_R as COMP12RST_R;
pub use SYSCFGRST_R as VREFRST_R;
pub use SYSCFGRST_R as DTSRST_R;
pub use SYSCFGRST_R as DFSDM2RST_R;
pub use SYSCFGRST_W as LPUART1RST_W;
pub use SYSCFGRST_W as SPI6RST_W;
pub use SYSCFGRST_W as I2C4RST_W;
pub use SYSCFGRST_W as LPTIM2RST_W;
pub use SYSCFGRST_W as LPTIM3RST_W;
pub use SYSCFGRST_W as DAC2RST_W;
pub use SYSCFGRST_W as COMP12RST_W;
pub use SYSCFGRST_W as VREFRST_W;
pub use SYSCFGRST_W as DTSRST_W;
pub use SYSCFGRST_W as DFSDM2RST_W;
impl R {
#[inline(always)]
pub fn syscfgrst(&self) -> SYSCFGRST_R {
SYSCFGRST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn lpuart1rst(&self) -> LPUART1RST_R {
LPUART1RST_R::new(((self.bits >> 3) & 1) != 0)
}
#[inline(always)]
pub fn spi6rst(&self) -> SPI6RST_R {
SPI6RST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn i2c4rst(&self) -> I2C4RST_R {
I2C4RST_R::new(((self.bits >> 7) & 1) != 0)
}
#[inline(always)]
pub fn lptim2rst(&self) -> LPTIM2RST_R {
LPTIM2RST_R::new(((self.bits >> 9) & 1) != 0)
}
#[inline(always)]
pub fn lptim3rst(&self) -> LPTIM3RST_R {
LPTIM3RST_R::new(((self.bits >> 10) & 1) != 0)
}
#[inline(always)]
pub fn dac2rst(&self) -> DAC2RST_R {
DAC2RST_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn comp12rst(&self) -> COMP12RST_R {
COMP12RST_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn vrefrst(&self) -> VREFRST_R {
VREFRST_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn dtsrst(&self) -> DTSRST_R {
DTSRST_R::new(((self.bits >> 26) & 1) != 0)
}
#[inline(always)]
pub fn dfsdm2rst(&self) -> DFSDM2RST_R {
DFSDM2RST_R::new(((self.bits >> 27) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB4RSTR")
.field("syscfgrst", &self.syscfgrst())
.field("lpuart1rst", &self.lpuart1rst())
.field("spi6rst", &self.spi6rst())
.field("i2c4rst", &self.i2c4rst())
.field("lptim2rst", &self.lptim2rst())
.field("lptim3rst", &self.lptim3rst())
.field("dac2rst", &self.dac2rst())
.field("comp12rst", &self.comp12rst())
.field("vrefrst", &self.vrefrst())
.field("dtsrst", &self.dtsrst())
.field("dfsdm2rst", &self.dfsdm2rst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn syscfgrst(&mut self) -> SYSCFGRST_W<APB4RSTRrs> {
SYSCFGRST_W::new(self, 1)
}
#[inline(always)]
pub fn lpuart1rst(&mut self) -> LPUART1RST_W<APB4RSTRrs> {
LPUART1RST_W::new(self, 3)
}
#[inline(always)]
pub fn spi6rst(&mut self) -> SPI6RST_W<APB4RSTRrs> {
SPI6RST_W::new(self, 5)
}
#[inline(always)]
pub fn i2c4rst(&mut self) -> I2C4RST_W<APB4RSTRrs> {
I2C4RST_W::new(self, 7)
}
#[inline(always)]
pub fn lptim2rst(&mut self) -> LPTIM2RST_W<APB4RSTRrs> {
LPTIM2RST_W::new(self, 9)
}
#[inline(always)]
pub fn lptim3rst(&mut self) -> LPTIM3RST_W<APB4RSTRrs> {
LPTIM3RST_W::new(self, 10)
}
#[inline(always)]
pub fn dac2rst(&mut self) -> DAC2RST_W<APB4RSTRrs> {
DAC2RST_W::new(self, 13)
}
#[inline(always)]
pub fn comp12rst(&mut self) -> COMP12RST_W<APB4RSTRrs> {
COMP12RST_W::new(self, 14)
}
#[inline(always)]
pub fn vrefrst(&mut self) -> VREFRST_W<APB4RSTRrs> {
VREFRST_W::new(self, 15)
}
#[inline(always)]
pub fn dtsrst(&mut self) -> DTSRST_W<APB4RSTRrs> {
DTSRST_W::new(self, 26)
}
#[inline(always)]
pub fn dfsdm2rst(&mut self) -> DFSDM2RST_W<APB4RSTRrs> {
DFSDM2RST_W::new(self, 27)
}
}
pub struct APB4RSTRrs;
impl crate::RegisterSpec for APB4RSTRrs {
type Ux = u32;
}
impl crate::Readable for APB4RSTRrs {}
impl crate::Writable for APB4RSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB4RSTRrs {}