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 SBSRST {
Reset = 1,
}
impl From<SBSRST> for bool {
#[inline(always)]
fn from(variant: SBSRST) -> Self {
variant as u8 != 0
}
}
pub type SBSRST_R = crate::BitReader<SBSRST>;
impl SBSRST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<SBSRST> {
match self.bits {
true => Some(SBSRST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == SBSRST::Reset
}
}
pub type SBSRST_W<'a, REG> = crate::BitWriter<'a, REG, SBSRST>;
impl<'a, REG> SBSRST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(SBSRST::Reset)
}
}
pub use SBSRST_R as LPUART1RST_R;
pub use SBSRST_R as SPI6RST_R;
pub use SBSRST_R as LPTIM2RST_R;
pub use SBSRST_R as LPTIM3RST_R;
pub use SBSRST_R as LPTIM4RST_R;
pub use SBSRST_R as LPTIM5RST_R;
pub use SBSRST_R as VREFRST_R;
pub use SBSRST_R as TMPSENSRST_R;
pub use SBSRST_W as LPUART1RST_W;
pub use SBSRST_W as SPI6RST_W;
pub use SBSRST_W as LPTIM2RST_W;
pub use SBSRST_W as LPTIM3RST_W;
pub use SBSRST_W as LPTIM4RST_W;
pub use SBSRST_W as LPTIM5RST_W;
pub use SBSRST_W as VREFRST_W;
pub use SBSRST_W as TMPSENSRST_W;
impl R {
#[inline(always)]
pub fn sbsrst(&self) -> SBSRST_R {
SBSRST_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 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 lptim4rst(&self) -> LPTIM4RST_R {
LPTIM4RST_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn lptim5rst(&self) -> LPTIM5RST_R {
LPTIM5RST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn vrefrst(&self) -> VREFRST_R {
VREFRST_R::new(((self.bits >> 15) & 1) != 0)
}
#[inline(always)]
pub fn tmpsensrst(&self) -> TMPSENSRST_R {
TMPSENSRST_R::new(((self.bits >> 26) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB4RSTR")
.field("sbsrst", &self.sbsrst())
.field("lpuart1rst", &self.lpuart1rst())
.field("spi6rst", &self.spi6rst())
.field("lptim2rst", &self.lptim2rst())
.field("lptim3rst", &self.lptim3rst())
.field("lptim4rst", &self.lptim4rst())
.field("lptim5rst", &self.lptim5rst())
.field("vrefrst", &self.vrefrst())
.field("tmpsensrst", &self.tmpsensrst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn sbsrst(&mut self) -> SBSRST_W<APB4RSTRrs> {
SBSRST_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 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 lptim4rst(&mut self) -> LPTIM4RST_W<APB4RSTRrs> {
LPTIM4RST_W::new(self, 11)
}
#[inline(always)]
pub fn lptim5rst(&mut self) -> LPTIM5RST_W<APB4RSTRrs> {
LPTIM5RST_W::new(self, 12)
}
#[inline(always)]
pub fn vrefrst(&mut self) -> VREFRST_W<APB4RSTRrs> {
VREFRST_W::new(self, 15)
}
#[inline(always)]
pub fn tmpsensrst(&mut self) -> TMPSENSRST_W<APB4RSTRrs> {
TMPSENSRST_W::new(self, 26)
}
}
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 {}