#[doc = "Register `AHB2RSTR` reader"]
pub struct R(crate::R<AHB2RSTR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<AHB2RSTR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<AHB2RSTR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<AHB2RSTR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `AHB2RSTR` writer"]
pub struct W(crate::W<AHB2RSTR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<AHB2RSTR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<AHB2RSTR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<AHB2RSTR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RNGRST` reader - Random number generator reset"]
pub struct RNGRST_R(crate::FieldReader<bool, bool>);
impl RNGRST_R {
pub(crate) fn new(bits: bool) -> Self {
RNGRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for RNGRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `RNGRST` writer - Random number generator reset"]
pub struct RNGRST_W<'a> {
w: &'a mut W,
}
impl<'a> RNGRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18);
self.w
}
}
#[doc = "Field `AESRST` reader - AES hardware accelerator reset"]
pub struct AESRST_R(crate::FieldReader<bool, bool>);
impl AESRST_R {
pub(crate) fn new(bits: bool) -> Self {
AESRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for AESRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `AESRST` writer - AES hardware accelerator reset"]
pub struct AESRST_W<'a> {
w: &'a mut W,
}
impl<'a> AESRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16);
self.w
}
}
#[doc = "Field `ADCRST` reader - ADC reset"]
pub struct ADCRST_R(crate::FieldReader<bool, bool>);
impl ADCRST_R {
pub(crate) fn new(bits: bool) -> Self {
ADCRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for ADCRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `ADCRST` writer - ADC reset"]
pub struct ADCRST_W<'a> {
w: &'a mut W,
}
impl<'a> ADCRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13);
self.w
}
}
#[doc = "Field `OTGFSRST` reader - USB OTG FS reset"]
pub struct OTGFSRST_R(crate::FieldReader<bool, bool>);
impl OTGFSRST_R {
pub(crate) fn new(bits: bool) -> Self {
OTGFSRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for OTGFSRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `OTGFSRST` writer - USB OTG FS reset"]
pub struct OTGFSRST_W<'a> {
w: &'a mut W,
}
impl<'a> OTGFSRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
self.w
}
}
#[doc = "Field `GPIOHRST` reader - IO port H reset"]
pub struct GPIOHRST_R(crate::FieldReader<bool, bool>);
impl GPIOHRST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOHRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOHRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOHRST` writer - IO port H reset"]
pub struct GPIOHRST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOHRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
self.w
}
}
#[doc = "Field `GPIOGRST` reader - IO port G reset"]
pub struct GPIOGRST_R(crate::FieldReader<bool, bool>);
impl GPIOGRST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOGRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOGRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOGRST` writer - IO port G reset"]
pub struct GPIOGRST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOGRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
self.w
}
}
#[doc = "Field `GPIOFRST` reader - IO port F reset"]
pub struct GPIOFRST_R(crate::FieldReader<bool, bool>);
impl GPIOFRST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOFRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOFRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOFRST` writer - IO port F reset"]
pub struct GPIOFRST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOFRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
self.w
}
}
#[doc = "Field `GPIOERST` reader - IO port E reset"]
pub struct GPIOERST_R(crate::FieldReader<bool, bool>);
impl GPIOERST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOERST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOERST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOERST` writer - IO port E reset"]
pub struct GPIOERST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOERST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
self.w
}
}
#[doc = "Field `GPIODRST` reader - IO port D reset"]
pub struct GPIODRST_R(crate::FieldReader<bool, bool>);
impl GPIODRST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIODRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIODRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIODRST` writer - IO port D reset"]
pub struct GPIODRST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIODRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
self.w
}
}
#[doc = "Field `GPIOCRST` reader - IO port C reset"]
pub struct GPIOCRST_R(crate::FieldReader<bool, bool>);
impl GPIOCRST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOCRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOCRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOCRST` writer - IO port C reset"]
pub struct GPIOCRST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOCRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
self.w
}
}
#[doc = "Field `GPIOBRST` reader - IO port B reset"]
pub struct GPIOBRST_R(crate::FieldReader<bool, bool>);
impl GPIOBRST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOBRST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOBRST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOBRST` writer - IO port B reset"]
pub struct GPIOBRST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOBRST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
self.w
}
}
#[doc = "Field `GPIOARST` reader - IO port A reset"]
pub struct GPIOARST_R(crate::FieldReader<bool, bool>);
impl GPIOARST_R {
pub(crate) fn new(bits: bool) -> Self {
GPIOARST_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for GPIOARST_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `GPIOARST` writer - IO port A reset"]
pub struct GPIOARST_W<'a> {
w: &'a mut W,
}
impl<'a> GPIOARST_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
self.w
}
}
impl R {
#[doc = "Bit 18 - Random number generator reset"]
#[inline(always)]
pub fn rngrst(&self) -> RNGRST_R {
RNGRST_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 16 - AES hardware accelerator reset"]
#[inline(always)]
pub fn aesrst(&self) -> AESRST_R {
AESRST_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 13 - ADC reset"]
#[inline(always)]
pub fn adcrst(&self) -> ADCRST_R {
ADCRST_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 12 - USB OTG FS reset"]
#[inline(always)]
pub fn otgfsrst(&self) -> OTGFSRST_R {
OTGFSRST_R::new(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 7 - IO port H reset"]
#[inline(always)]
pub fn gpiohrst(&self) -> GPIOHRST_R {
GPIOHRST_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 6 - IO port G reset"]
#[inline(always)]
pub fn gpiogrst(&self) -> GPIOGRST_R {
GPIOGRST_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 5 - IO port F reset"]
#[inline(always)]
pub fn gpiofrst(&self) -> GPIOFRST_R {
GPIOFRST_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bit 4 - IO port E reset"]
#[inline(always)]
pub fn gpioerst(&self) -> GPIOERST_R {
GPIOERST_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 3 - IO port D reset"]
#[inline(always)]
pub fn gpiodrst(&self) -> GPIODRST_R {
GPIODRST_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 2 - IO port C reset"]
#[inline(always)]
pub fn gpiocrst(&self) -> GPIOCRST_R {
GPIOCRST_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 1 - IO port B reset"]
#[inline(always)]
pub fn gpiobrst(&self) -> GPIOBRST_R {
GPIOBRST_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bit 0 - IO port A reset"]
#[inline(always)]
pub fn gpioarst(&self) -> GPIOARST_R {
GPIOARST_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 18 - Random number generator reset"]
#[inline(always)]
pub fn rngrst(&mut self) -> RNGRST_W {
RNGRST_W { w: self }
}
#[doc = "Bit 16 - AES hardware accelerator reset"]
#[inline(always)]
pub fn aesrst(&mut self) -> AESRST_W {
AESRST_W { w: self }
}
#[doc = "Bit 13 - ADC reset"]
#[inline(always)]
pub fn adcrst(&mut self) -> ADCRST_W {
ADCRST_W { w: self }
}
#[doc = "Bit 12 - USB OTG FS reset"]
#[inline(always)]
pub fn otgfsrst(&mut self) -> OTGFSRST_W {
OTGFSRST_W { w: self }
}
#[doc = "Bit 7 - IO port H reset"]
#[inline(always)]
pub fn gpiohrst(&mut self) -> GPIOHRST_W {
GPIOHRST_W { w: self }
}
#[doc = "Bit 6 - IO port G reset"]
#[inline(always)]
pub fn gpiogrst(&mut self) -> GPIOGRST_W {
GPIOGRST_W { w: self }
}
#[doc = "Bit 5 - IO port F reset"]
#[inline(always)]
pub fn gpiofrst(&mut self) -> GPIOFRST_W {
GPIOFRST_W { w: self }
}
#[doc = "Bit 4 - IO port E reset"]
#[inline(always)]
pub fn gpioerst(&mut self) -> GPIOERST_W {
GPIOERST_W { w: self }
}
#[doc = "Bit 3 - IO port D reset"]
#[inline(always)]
pub fn gpiodrst(&mut self) -> GPIODRST_W {
GPIODRST_W { w: self }
}
#[doc = "Bit 2 - IO port C reset"]
#[inline(always)]
pub fn gpiocrst(&mut self) -> GPIOCRST_W {
GPIOCRST_W { w: self }
}
#[doc = "Bit 1 - IO port B reset"]
#[inline(always)]
pub fn gpiobrst(&mut self) -> GPIOBRST_W {
GPIOBRST_W { w: self }
}
#[doc = "Bit 0 - IO port A reset"]
#[inline(always)]
pub fn gpioarst(&mut self) -> GPIOARST_W {
GPIOARST_W { w: self }
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "AHB2 peripheral reset register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ahb2rstr](index.html) module"]
pub struct AHB2RSTR_SPEC;
impl crate::RegisterSpec for AHB2RSTR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ahb2rstr::R](R) reader structure"]
impl crate::Readable for AHB2RSTR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ahb2rstr::W](W) writer structure"]
impl crate::Writable for AHB2RSTR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets AHB2RSTR to value 0"]
impl crate::Resettable for AHB2RSTR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}