#[doc = "Register `AHB3SMENR` reader"]
pub struct R(crate::R<AHB3SMENR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<AHB3SMENR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<AHB3SMENR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<AHB3SMENR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `AHB3SMENR` writer"]
pub struct W(crate::W<AHB3SMENR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<AHB3SMENR_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<AHB3SMENR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<AHB3SMENR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `QSPISMEN` reader - QSPISMEN"]
pub struct QSPISMEN_R(crate::FieldReader<bool, bool>);
impl QSPISMEN_R {
pub(crate) fn new(bits: bool) -> Self {
QSPISMEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for QSPISMEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `QSPISMEN` writer - QSPISMEN"]
pub struct QSPISMEN_W<'a> {
w: &'a mut W,
}
impl<'a> QSPISMEN_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 << 8)) | ((value as u32 & 0x01) << 8);
self.w
}
}
#[doc = "Field `FMCSMEN` reader - Flexible memory controller clocks enable during Sleep and Stop modes"]
pub struct FMCSMEN_R(crate::FieldReader<bool, bool>);
impl FMCSMEN_R {
pub(crate) fn new(bits: bool) -> Self {
FMCSMEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FMCSMEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FMCSMEN` writer - Flexible memory controller clocks enable during Sleep and Stop modes"]
pub struct FMCSMEN_W<'a> {
w: &'a mut W,
}
impl<'a> FMCSMEN_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 8 - QSPISMEN"]
#[inline(always)]
pub fn qspismen(&self) -> QSPISMEN_R {
QSPISMEN_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 0 - Flexible memory controller clocks enable during Sleep and Stop modes"]
#[inline(always)]
pub fn fmcsmen(&self) -> FMCSMEN_R {
FMCSMEN_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 8 - QSPISMEN"]
#[inline(always)]
pub fn qspismen(&mut self) -> QSPISMEN_W {
QSPISMEN_W { w: self }
}
#[doc = "Bit 0 - Flexible memory controller clocks enable during Sleep and Stop modes"]
#[inline(always)]
pub fn fmcsmen(&mut self) -> FMCSMEN_W {
FMCSMEN_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 = "AHB3 peripheral clocks enable in Sleep and Stop modes 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 [ahb3smenr](index.html) module"]
pub struct AHB3SMENR_SPEC;
impl crate::RegisterSpec for AHB3SMENR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ahb3smenr::R](R) reader structure"]
impl crate::Readable for AHB3SMENR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ahb3smenr::W](W) writer structure"]
impl crate::Writable for AHB3SMENR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets AHB3SMENR to value 0x0101"]
impl crate::Resettable for AHB3SMENR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x0101
}
}