pub type R = crate::R<APB2RSTRrs>;
pub type W = crate::W<APB2RSTRrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TIM1RST {
Reset = 1,
}
impl From<TIM1RST> for bool {
#[inline(always)]
fn from(variant: TIM1RST) -> Self {
variant as u8 != 0
}
}
pub type TIM1RST_R = crate::BitReader<TIM1RST>;
impl TIM1RST_R {
#[inline(always)]
pub const fn variant(&self) -> Option<TIM1RST> {
match self.bits {
true => Some(TIM1RST::Reset),
_ => None,
}
}
#[inline(always)]
pub fn is_reset(&self) -> bool {
*self == TIM1RST::Reset
}
}
pub type TIM1RST_W<'a, REG> = crate::BitWriter<'a, REG, TIM1RST>;
impl<'a, REG> TIM1RST_W<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
{
#[inline(always)]
pub fn reset(self) -> &'a mut crate::W<REG> {
self.variant(TIM1RST::Reset)
}
}
pub use TIM1RST_R as TIM8RST_R;
pub use TIM1RST_R as USART1RST_R;
pub use TIM1RST_R as USART6RST_R;
pub use TIM1RST_R as ADCRST_R;
pub use TIM1RST_R as SDIORST_R;
pub use TIM1RST_R as SPI1RST_R;
pub use TIM1RST_R as SPI4RST_R;
pub use TIM1RST_R as SYSCFGRST_R;
pub use TIM1RST_R as TIM9RST_R;
pub use TIM1RST_R as TIM10RST_R;
pub use TIM1RST_R as TIM11RST_R;
pub use TIM1RST_R as SAI1RST_R;
pub use TIM1RST_R as SAI2RST_R;
pub use TIM1RST_W as TIM8RST_W;
pub use TIM1RST_W as USART1RST_W;
pub use TIM1RST_W as USART6RST_W;
pub use TIM1RST_W as ADCRST_W;
pub use TIM1RST_W as SDIORST_W;
pub use TIM1RST_W as SPI1RST_W;
pub use TIM1RST_W as SPI4RST_W;
pub use TIM1RST_W as SYSCFGRST_W;
pub use TIM1RST_W as TIM9RST_W;
pub use TIM1RST_W as TIM10RST_W;
pub use TIM1RST_W as TIM11RST_W;
pub use TIM1RST_W as SAI1RST_W;
pub use TIM1RST_W as SAI2RST_W;
impl R {
#[inline(always)]
pub fn tim1rst(&self) -> TIM1RST_R {
TIM1RST_R::new((self.bits & 1) != 0)
}
#[inline(always)]
pub fn tim8rst(&self) -> TIM8RST_R {
TIM8RST_R::new(((self.bits >> 1) & 1) != 0)
}
#[inline(always)]
pub fn usart1rst(&self) -> USART1RST_R {
USART1RST_R::new(((self.bits >> 4) & 1) != 0)
}
#[inline(always)]
pub fn usart6rst(&self) -> USART6RST_R {
USART6RST_R::new(((self.bits >> 5) & 1) != 0)
}
#[inline(always)]
pub fn adcrst(&self) -> ADCRST_R {
ADCRST_R::new(((self.bits >> 8) & 1) != 0)
}
#[inline(always)]
pub fn sdiorst(&self) -> SDIORST_R {
SDIORST_R::new(((self.bits >> 11) & 1) != 0)
}
#[inline(always)]
pub fn spi1rst(&self) -> SPI1RST_R {
SPI1RST_R::new(((self.bits >> 12) & 1) != 0)
}
#[inline(always)]
pub fn spi4rst(&self) -> SPI4RST_R {
SPI4RST_R::new(((self.bits >> 13) & 1) != 0)
}
#[inline(always)]
pub fn syscfgrst(&self) -> SYSCFGRST_R {
SYSCFGRST_R::new(((self.bits >> 14) & 1) != 0)
}
#[inline(always)]
pub fn tim9rst(&self) -> TIM9RST_R {
TIM9RST_R::new(((self.bits >> 16) & 1) != 0)
}
#[inline(always)]
pub fn tim10rst(&self) -> TIM10RST_R {
TIM10RST_R::new(((self.bits >> 17) & 1) != 0)
}
#[inline(always)]
pub fn tim11rst(&self) -> TIM11RST_R {
TIM11RST_R::new(((self.bits >> 18) & 1) != 0)
}
#[inline(always)]
pub fn sai1rst(&self) -> SAI1RST_R {
SAI1RST_R::new(((self.bits >> 22) & 1) != 0)
}
#[inline(always)]
pub fn sai2rst(&self) -> SAI2RST_R {
SAI2RST_R::new(((self.bits >> 23) & 1) != 0)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("APB2RSTR")
.field("tim1rst", &self.tim1rst())
.field("tim8rst", &self.tim8rst())
.field("usart1rst", &self.usart1rst())
.field("usart6rst", &self.usart6rst())
.field("adcrst", &self.adcrst())
.field("sdiorst", &self.sdiorst())
.field("spi1rst", &self.spi1rst())
.field("spi4rst", &self.spi4rst())
.field("syscfgrst", &self.syscfgrst())
.field("tim9rst", &self.tim9rst())
.field("tim10rst", &self.tim10rst())
.field("tim11rst", &self.tim11rst())
.field("sai1rst", &self.sai1rst())
.field("sai2rst", &self.sai2rst())
.finish()
}
}
impl W {
#[inline(always)]
pub fn tim1rst(&mut self) -> TIM1RST_W<APB2RSTRrs> {
TIM1RST_W::new(self, 0)
}
#[inline(always)]
pub fn tim8rst(&mut self) -> TIM8RST_W<APB2RSTRrs> {
TIM8RST_W::new(self, 1)
}
#[inline(always)]
pub fn usart1rst(&mut self) -> USART1RST_W<APB2RSTRrs> {
USART1RST_W::new(self, 4)
}
#[inline(always)]
pub fn usart6rst(&mut self) -> USART6RST_W<APB2RSTRrs> {
USART6RST_W::new(self, 5)
}
#[inline(always)]
pub fn adcrst(&mut self) -> ADCRST_W<APB2RSTRrs> {
ADCRST_W::new(self, 8)
}
#[inline(always)]
pub fn sdiorst(&mut self) -> SDIORST_W<APB2RSTRrs> {
SDIORST_W::new(self, 11)
}
#[inline(always)]
pub fn spi1rst(&mut self) -> SPI1RST_W<APB2RSTRrs> {
SPI1RST_W::new(self, 12)
}
#[inline(always)]
pub fn spi4rst(&mut self) -> SPI4RST_W<APB2RSTRrs> {
SPI4RST_W::new(self, 13)
}
#[inline(always)]
pub fn syscfgrst(&mut self) -> SYSCFGRST_W<APB2RSTRrs> {
SYSCFGRST_W::new(self, 14)
}
#[inline(always)]
pub fn tim9rst(&mut self) -> TIM9RST_W<APB2RSTRrs> {
TIM9RST_W::new(self, 16)
}
#[inline(always)]
pub fn tim10rst(&mut self) -> TIM10RST_W<APB2RSTRrs> {
TIM10RST_W::new(self, 17)
}
#[inline(always)]
pub fn tim11rst(&mut self) -> TIM11RST_W<APB2RSTRrs> {
TIM11RST_W::new(self, 18)
}
#[inline(always)]
pub fn sai1rst(&mut self) -> SAI1RST_W<APB2RSTRrs> {
SAI1RST_W::new(self, 22)
}
#[inline(always)]
pub fn sai2rst(&mut self) -> SAI2RST_W<APB2RSTRrs> {
SAI2RST_W::new(self, 23)
}
}
pub struct APB2RSTRrs;
impl crate::RegisterSpec for APB2RSTRrs {
type Ux = u32;
}
impl crate::Readable for APB2RSTRrs {}
impl crate::Writable for APB2RSTRrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for APB2RSTRrs {}