stm32g4 0.16.0

Device support crates for STM32G4 devices
Documentation
///Register `APB2RSTR` reader
pub type R = crate::R<APB2RSTRrs>;
///Register `APB2RSTR` writer
pub type W = crate::W<APB2RSTRrs>;
/**SYSCFG + COMP + OPAMP + VREFBUF reset

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SYSCFGRST {
    ///1: Reset the selected module
    Reset = 1,
}
impl From<SYSCFGRST> for bool {
    #[inline(always)]
    fn from(variant: SYSCFGRST) -> Self {
        variant as u8 != 0
    }
}
///Field `SYSCFGRST` reader - SYSCFG + COMP + OPAMP + VREFBUF reset
pub type SYSCFGRST_R = crate::BitReader<SYSCFGRST>;
impl SYSCFGRST_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> Option<SYSCFGRST> {
        match self.bits {
            true => Some(SYSCFGRST::Reset),
            _ => None,
        }
    }
    ///Reset the selected module
    #[inline(always)]
    pub fn is_reset(&self) -> bool {
        *self == SYSCFGRST::Reset
    }
}
///Field `SYSCFGRST` writer - SYSCFG + COMP + OPAMP + VREFBUF 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,
{
    ///Reset the selected module
    #[inline(always)]
    pub fn reset(self) -> &'a mut crate::W<REG> {
        self.variant(SYSCFGRST::Reset)
    }
}
///Field `TIM1RST` reader - TIM1 timer reset Set and cleared by software.
pub use SYSCFGRST_R as TIM1RST_R;
///Field `SPI1RST` reader - SPI1 reset Set and cleared by software.
pub use SYSCFGRST_R as SPI1RST_R;
///Field `TIM8RST` reader - TIM8 timer reset Set and cleared by software.
pub use SYSCFGRST_R as TIM8RST_R;
///Field `USART1RST` reader - USART1 reset Set and cleared by software.
pub use SYSCFGRST_R as USART1RST_R;
///Field `SPI4RST` reader - SPI4 reset Set and cleared by software.
pub use SYSCFGRST_R as SPI4RST_R;
///Field `TIM15RST` reader - TIM15 timer reset Set and cleared by software.
pub use SYSCFGRST_R as TIM15RST_R;
///Field `TIM16RST` reader - TIM16 timer reset Set and cleared by software.
pub use SYSCFGRST_R as TIM16RST_R;
///Field `TIM17RST` reader - TIM17 timer reset Set and cleared by software.
pub use SYSCFGRST_R as TIM17RST_R;
///Field `TIM20RST` reader - TIM20 reset Set and cleared by software.
pub use SYSCFGRST_R as TIM20RST_R;
///Field `SAI1RST` reader - Serial audio interface 1 (SAI1) reset Set and cleared by software.
pub use SYSCFGRST_R as SAI1RST_R;
///Field `HRTIM1RST` reader - HRTIM1 reset Set and cleared by software.
pub use SYSCFGRST_R as HRTIM1RST_R;
///Field `TIM1RST` writer - TIM1 timer reset Set and cleared by software.
pub use SYSCFGRST_W as TIM1RST_W;
///Field `SPI1RST` writer - SPI1 reset Set and cleared by software.
pub use SYSCFGRST_W as SPI1RST_W;
///Field `TIM8RST` writer - TIM8 timer reset Set and cleared by software.
pub use SYSCFGRST_W as TIM8RST_W;
///Field `USART1RST` writer - USART1 reset Set and cleared by software.
pub use SYSCFGRST_W as USART1RST_W;
///Field `SPI4RST` writer - SPI4 reset Set and cleared by software.
pub use SYSCFGRST_W as SPI4RST_W;
///Field `TIM15RST` writer - TIM15 timer reset Set and cleared by software.
pub use SYSCFGRST_W as TIM15RST_W;
///Field `TIM16RST` writer - TIM16 timer reset Set and cleared by software.
pub use SYSCFGRST_W as TIM16RST_W;
///Field `TIM17RST` writer - TIM17 timer reset Set and cleared by software.
pub use SYSCFGRST_W as TIM17RST_W;
///Field `TIM20RST` writer - TIM20 reset Set and cleared by software.
pub use SYSCFGRST_W as TIM20RST_W;
///Field `SAI1RST` writer - Serial audio interface 1 (SAI1) reset Set and cleared by software.
pub use SYSCFGRST_W as SAI1RST_W;
///Field `HRTIM1RST` writer - HRTIM1 reset Set and cleared by software.
pub use SYSCFGRST_W as HRTIM1RST_W;
impl R {
    ///Bit 0 - SYSCFG + COMP + OPAMP + VREFBUF reset
    #[inline(always)]
    pub fn syscfgrst(&self) -> SYSCFGRST_R {
        SYSCFGRST_R::new((self.bits & 1) != 0)
    }
    ///Bit 11 - TIM1 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim1rst(&self) -> TIM1RST_R {
        TIM1RST_R::new(((self.bits >> 11) & 1) != 0)
    }
    ///Bit 12 - SPI1 reset Set and cleared by software.
    #[inline(always)]
    pub fn spi1rst(&self) -> SPI1RST_R {
        SPI1RST_R::new(((self.bits >> 12) & 1) != 0)
    }
    ///Bit 13 - TIM8 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim8rst(&self) -> TIM8RST_R {
        TIM8RST_R::new(((self.bits >> 13) & 1) != 0)
    }
    ///Bit 14 - USART1 reset Set and cleared by software.
    #[inline(always)]
    pub fn usart1rst(&self) -> USART1RST_R {
        USART1RST_R::new(((self.bits >> 14) & 1) != 0)
    }
    ///Bit 15 - SPI4 reset Set and cleared by software.
    #[inline(always)]
    pub fn spi4rst(&self) -> SPI4RST_R {
        SPI4RST_R::new(((self.bits >> 15) & 1) != 0)
    }
    ///Bit 16 - TIM15 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim15rst(&self) -> TIM15RST_R {
        TIM15RST_R::new(((self.bits >> 16) & 1) != 0)
    }
    ///Bit 17 - TIM16 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim16rst(&self) -> TIM16RST_R {
        TIM16RST_R::new(((self.bits >> 17) & 1) != 0)
    }
    ///Bit 18 - TIM17 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim17rst(&self) -> TIM17RST_R {
        TIM17RST_R::new(((self.bits >> 18) & 1) != 0)
    }
    ///Bit 20 - TIM20 reset Set and cleared by software.
    #[inline(always)]
    pub fn tim20rst(&self) -> TIM20RST_R {
        TIM20RST_R::new(((self.bits >> 20) & 1) != 0)
    }
    ///Bit 21 - Serial audio interface 1 (SAI1) reset Set and cleared by software.
    #[inline(always)]
    pub fn sai1rst(&self) -> SAI1RST_R {
        SAI1RST_R::new(((self.bits >> 21) & 1) != 0)
    }
    ///Bit 26 - HRTIM1 reset Set and cleared by software.
    #[inline(always)]
    pub fn hrtim1rst(&self) -> HRTIM1RST_R {
        HRTIM1RST_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("APB2RSTR")
            .field("syscfgrst", &self.syscfgrst())
            .field("tim1rst", &self.tim1rst())
            .field("spi1rst", &self.spi1rst())
            .field("tim8rst", &self.tim8rst())
            .field("usart1rst", &self.usart1rst())
            .field("spi4rst", &self.spi4rst())
            .field("tim15rst", &self.tim15rst())
            .field("tim16rst", &self.tim16rst())
            .field("tim17rst", &self.tim17rst())
            .field("tim20rst", &self.tim20rst())
            .field("sai1rst", &self.sai1rst())
            .field("hrtim1rst", &self.hrtim1rst())
            .finish()
    }
}
impl W {
    ///Bit 0 - SYSCFG + COMP + OPAMP + VREFBUF reset
    #[inline(always)]
    pub fn syscfgrst(&mut self) -> SYSCFGRST_W<APB2RSTRrs> {
        SYSCFGRST_W::new(self, 0)
    }
    ///Bit 11 - TIM1 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim1rst(&mut self) -> TIM1RST_W<APB2RSTRrs> {
        TIM1RST_W::new(self, 11)
    }
    ///Bit 12 - SPI1 reset Set and cleared by software.
    #[inline(always)]
    pub fn spi1rst(&mut self) -> SPI1RST_W<APB2RSTRrs> {
        SPI1RST_W::new(self, 12)
    }
    ///Bit 13 - TIM8 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim8rst(&mut self) -> TIM8RST_W<APB2RSTRrs> {
        TIM8RST_W::new(self, 13)
    }
    ///Bit 14 - USART1 reset Set and cleared by software.
    #[inline(always)]
    pub fn usart1rst(&mut self) -> USART1RST_W<APB2RSTRrs> {
        USART1RST_W::new(self, 14)
    }
    ///Bit 15 - SPI4 reset Set and cleared by software.
    #[inline(always)]
    pub fn spi4rst(&mut self) -> SPI4RST_W<APB2RSTRrs> {
        SPI4RST_W::new(self, 15)
    }
    ///Bit 16 - TIM15 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim15rst(&mut self) -> TIM15RST_W<APB2RSTRrs> {
        TIM15RST_W::new(self, 16)
    }
    ///Bit 17 - TIM16 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim16rst(&mut self) -> TIM16RST_W<APB2RSTRrs> {
        TIM16RST_W::new(self, 17)
    }
    ///Bit 18 - TIM17 timer reset Set and cleared by software.
    #[inline(always)]
    pub fn tim17rst(&mut self) -> TIM17RST_W<APB2RSTRrs> {
        TIM17RST_W::new(self, 18)
    }
    ///Bit 20 - TIM20 reset Set and cleared by software.
    #[inline(always)]
    pub fn tim20rst(&mut self) -> TIM20RST_W<APB2RSTRrs> {
        TIM20RST_W::new(self, 20)
    }
    ///Bit 21 - Serial audio interface 1 (SAI1) reset Set and cleared by software.
    #[inline(always)]
    pub fn sai1rst(&mut self) -> SAI1RST_W<APB2RSTRrs> {
        SAI1RST_W::new(self, 21)
    }
    ///Bit 26 - HRTIM1 reset Set and cleared by software.
    #[inline(always)]
    pub fn hrtim1rst(&mut self) -> HRTIM1RST_W<APB2RSTRrs> {
        HRTIM1RST_W::new(self, 26)
    }
}
/**APB2 peripheral reset register

You can [`read`](crate::Reg::read) this register and get [`apb2rstr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`apb2rstr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).

See register [structure](https://stm32-rs.github.io/stm32-rs/STM32G483.html#RCC:APB2RSTR)*/
pub struct APB2RSTRrs;
impl crate::RegisterSpec for APB2RSTRrs {
    type Ux = u32;
}
///`read()` method returns [`apb2rstr::R`](R) reader structure
impl crate::Readable for APB2RSTRrs {}
///`write(|w| ..)` method takes [`apb2rstr::W`](W) writer structure
impl crate::Writable for APB2RSTRrs {
    type Safety = crate::Unsafe;
}
///`reset()` method sets APB2RSTR to value 0
impl crate::Resettable for APB2RSTRrs {}