#[doc = "Register `APB2ENR` reader"]
pub struct R(crate::R<APB2ENR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<APB2ENR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<APB2ENR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<APB2ENR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `APB2ENR` writer"]
pub struct W(crate::W<APB2ENR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<APB2ENR_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<APB2ENR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<APB2ENR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `DFSDMEN` reader - DFSDM timer clock enable"]
pub struct DFSDMEN_R(crate::FieldReader<bool, bool>);
impl DFSDMEN_R {
pub(crate) fn new(bits: bool) -> Self {
DFSDMEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for DFSDMEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `DFSDMEN` writer - DFSDM timer clock enable"]
pub struct DFSDMEN_W<'a> {
w: &'a mut W,
}
impl<'a> DFSDMEN_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 << 24)) | ((value as u32 & 0x01) << 24);
self.w
}
}
#[doc = "Field `SAI2EN` reader - SAI2 clock enable"]
pub struct SAI2EN_R(crate::FieldReader<bool, bool>);
impl SAI2EN_R {
pub(crate) fn new(bits: bool) -> Self {
SAI2EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SAI2EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SAI2EN` writer - SAI2 clock enable"]
pub struct SAI2EN_W<'a> {
w: &'a mut W,
}
impl<'a> SAI2EN_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 << 22)) | ((value as u32 & 0x01) << 22);
self.w
}
}
#[doc = "Field `SAI1EN` reader - SAI1 clock enable"]
pub struct SAI1EN_R(crate::FieldReader<bool, bool>);
impl SAI1EN_R {
pub(crate) fn new(bits: bool) -> Self {
SAI1EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SAI1EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SAI1EN` writer - SAI1 clock enable"]
pub struct SAI1EN_W<'a> {
w: &'a mut W,
}
impl<'a> SAI1EN_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 << 21)) | ((value as u32 & 0x01) << 21);
self.w
}
}
#[doc = "Field `TIM17EN` reader - TIM17 timer clock enable"]
pub struct TIM17EN_R(crate::FieldReader<bool, bool>);
impl TIM17EN_R {
pub(crate) fn new(bits: bool) -> Self {
TIM17EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TIM17EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TIM17EN` writer - TIM17 timer clock enable"]
pub struct TIM17EN_W<'a> {
w: &'a mut W,
}
impl<'a> TIM17EN_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 `TIM16EN` reader - TIM16 timer clock enable"]
pub struct TIM16EN_R(crate::FieldReader<bool, bool>);
impl TIM16EN_R {
pub(crate) fn new(bits: bool) -> Self {
TIM16EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TIM16EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TIM16EN` writer - TIM16 timer clock enable"]
pub struct TIM16EN_W<'a> {
w: &'a mut W,
}
impl<'a> TIM16EN_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 << 17)) | ((value as u32 & 0x01) << 17);
self.w
}
}
#[doc = "Field `TIM15EN` reader - TIM15 timer clock enable"]
pub struct TIM15EN_R(crate::FieldReader<bool, bool>);
impl TIM15EN_R {
pub(crate) fn new(bits: bool) -> Self {
TIM15EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TIM15EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TIM15EN` writer - TIM15 timer clock enable"]
pub struct TIM15EN_W<'a> {
w: &'a mut W,
}
impl<'a> TIM15EN_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 `USART1EN` reader - USART1clock enable"]
pub struct USART1EN_R(crate::FieldReader<bool, bool>);
impl USART1EN_R {
pub(crate) fn new(bits: bool) -> Self {
USART1EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for USART1EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `USART1EN` writer - USART1clock enable"]
pub struct USART1EN_W<'a> {
w: &'a mut W,
}
impl<'a> USART1EN_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 << 14)) | ((value as u32 & 0x01) << 14);
self.w
}
}
#[doc = "Field `TIM8EN` reader - TIM8 timer clock enable"]
pub struct TIM8EN_R(crate::FieldReader<bool, bool>);
impl TIM8EN_R {
pub(crate) fn new(bits: bool) -> Self {
TIM8EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TIM8EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TIM8EN` writer - TIM8 timer clock enable"]
pub struct TIM8EN_W<'a> {
w: &'a mut W,
}
impl<'a> TIM8EN_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 `SPI1EN` reader - SPI1 clock enable"]
pub struct SPI1EN_R(crate::FieldReader<bool, bool>);
impl SPI1EN_R {
pub(crate) fn new(bits: bool) -> Self {
SPI1EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SPI1EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SPI1EN` writer - SPI1 clock enable"]
pub struct SPI1EN_W<'a> {
w: &'a mut W,
}
impl<'a> SPI1EN_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 `TIM1EN` reader - TIM1 timer clock enable"]
pub struct TIM1EN_R(crate::FieldReader<bool, bool>);
impl TIM1EN_R {
pub(crate) fn new(bits: bool) -> Self {
TIM1EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for TIM1EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `TIM1EN` writer - TIM1 timer clock enable"]
pub struct TIM1EN_W<'a> {
w: &'a mut W,
}
impl<'a> TIM1EN_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 << 11)) | ((value as u32 & 0x01) << 11);
self.w
}
}
#[doc = "Field `SDMMCEN` reader - SDMMC clock enable"]
pub struct SDMMCEN_R(crate::FieldReader<bool, bool>);
impl SDMMCEN_R {
pub(crate) fn new(bits: bool) -> Self {
SDMMCEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SDMMCEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SDMMCEN` writer - SDMMC clock enable"]
pub struct SDMMCEN_W<'a> {
w: &'a mut W,
}
impl<'a> SDMMCEN_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 << 10)) | ((value as u32 & 0x01) << 10);
self.w
}
}
#[doc = "Field `FIREWALLEN` reader - Firewall clock enable"]
pub struct FIREWALLEN_R(crate::FieldReader<bool, bool>);
impl FIREWALLEN_R {
pub(crate) fn new(bits: bool) -> Self {
FIREWALLEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for FIREWALLEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `FIREWALLEN` writer - Firewall clock enable"]
pub struct FIREWALLEN_W<'a> {
w: &'a mut W,
}
impl<'a> FIREWALLEN_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 `SYSCFGEN` reader - SYSCFG clock enable"]
pub struct SYSCFGEN_R(crate::FieldReader<bool, bool>);
impl SYSCFGEN_R {
pub(crate) fn new(bits: bool) -> Self {
SYSCFGEN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for SYSCFGEN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `SYSCFGEN` writer - SYSCFG clock enable"]
pub struct SYSCFGEN_W<'a> {
w: &'a mut W,
}
impl<'a> SYSCFGEN_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 24 - DFSDM timer clock enable"]
#[inline(always)]
pub fn dfsdmen(&self) -> DFSDMEN_R {
DFSDMEN_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bit 22 - SAI2 clock enable"]
#[inline(always)]
pub fn sai2en(&self) -> SAI2EN_R {
SAI2EN_R::new(((self.bits >> 22) & 0x01) != 0)
}
#[doc = "Bit 21 - SAI1 clock enable"]
#[inline(always)]
pub fn sai1en(&self) -> SAI1EN_R {
SAI1EN_R::new(((self.bits >> 21) & 0x01) != 0)
}
#[doc = "Bit 18 - TIM17 timer clock enable"]
#[inline(always)]
pub fn tim17en(&self) -> TIM17EN_R {
TIM17EN_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 17 - TIM16 timer clock enable"]
#[inline(always)]
pub fn tim16en(&self) -> TIM16EN_R {
TIM16EN_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 16 - TIM15 timer clock enable"]
#[inline(always)]
pub fn tim15en(&self) -> TIM15EN_R {
TIM15EN_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 14 - USART1clock enable"]
#[inline(always)]
pub fn usart1en(&self) -> USART1EN_R {
USART1EN_R::new(((self.bits >> 14) & 0x01) != 0)
}
#[doc = "Bit 13 - TIM8 timer clock enable"]
#[inline(always)]
pub fn tim8en(&self) -> TIM8EN_R {
TIM8EN_R::new(((self.bits >> 13) & 0x01) != 0)
}
#[doc = "Bit 12 - SPI1 clock enable"]
#[inline(always)]
pub fn spi1en(&self) -> SPI1EN_R {
SPI1EN_R::new(((self.bits >> 12) & 0x01) != 0)
}
#[doc = "Bit 11 - TIM1 timer clock enable"]
#[inline(always)]
pub fn tim1en(&self) -> TIM1EN_R {
TIM1EN_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 10 - SDMMC clock enable"]
#[inline(always)]
pub fn sdmmcen(&self) -> SDMMCEN_R {
SDMMCEN_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 7 - Firewall clock enable"]
#[inline(always)]
pub fn firewallen(&self) -> FIREWALLEN_R {
FIREWALLEN_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 0 - SYSCFG clock enable"]
#[inline(always)]
pub fn syscfgen(&self) -> SYSCFGEN_R {
SYSCFGEN_R::new((self.bits & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 24 - DFSDM timer clock enable"]
#[inline(always)]
pub fn dfsdmen(&mut self) -> DFSDMEN_W {
DFSDMEN_W { w: self }
}
#[doc = "Bit 22 - SAI2 clock enable"]
#[inline(always)]
pub fn sai2en(&mut self) -> SAI2EN_W {
SAI2EN_W { w: self }
}
#[doc = "Bit 21 - SAI1 clock enable"]
#[inline(always)]
pub fn sai1en(&mut self) -> SAI1EN_W {
SAI1EN_W { w: self }
}
#[doc = "Bit 18 - TIM17 timer clock enable"]
#[inline(always)]
pub fn tim17en(&mut self) -> TIM17EN_W {
TIM17EN_W { w: self }
}
#[doc = "Bit 17 - TIM16 timer clock enable"]
#[inline(always)]
pub fn tim16en(&mut self) -> TIM16EN_W {
TIM16EN_W { w: self }
}
#[doc = "Bit 16 - TIM15 timer clock enable"]
#[inline(always)]
pub fn tim15en(&mut self) -> TIM15EN_W {
TIM15EN_W { w: self }
}
#[doc = "Bit 14 - USART1clock enable"]
#[inline(always)]
pub fn usart1en(&mut self) -> USART1EN_W {
USART1EN_W { w: self }
}
#[doc = "Bit 13 - TIM8 timer clock enable"]
#[inline(always)]
pub fn tim8en(&mut self) -> TIM8EN_W {
TIM8EN_W { w: self }
}
#[doc = "Bit 12 - SPI1 clock enable"]
#[inline(always)]
pub fn spi1en(&mut self) -> SPI1EN_W {
SPI1EN_W { w: self }
}
#[doc = "Bit 11 - TIM1 timer clock enable"]
#[inline(always)]
pub fn tim1en(&mut self) -> TIM1EN_W {
TIM1EN_W { w: self }
}
#[doc = "Bit 10 - SDMMC clock enable"]
#[inline(always)]
pub fn sdmmcen(&mut self) -> SDMMCEN_W {
SDMMCEN_W { w: self }
}
#[doc = "Bit 7 - Firewall clock enable"]
#[inline(always)]
pub fn firewallen(&mut self) -> FIREWALLEN_W {
FIREWALLEN_W { w: self }
}
#[doc = "Bit 0 - SYSCFG clock enable"]
#[inline(always)]
pub fn syscfgen(&mut self) -> SYSCFGEN_W {
SYSCFGEN_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 = "APB2ENR\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 [apb2enr](index.html) module"]
pub struct APB2ENR_SPEC;
impl crate::RegisterSpec for APB2ENR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [apb2enr::R](R) reader structure"]
impl crate::Readable for APB2ENR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [apb2enr::W](W) writer structure"]
impl crate::Writable for APB2ENR_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets APB2ENR to value 0"]
impl crate::Resettable for APB2ENR_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}