#[doc = "Register `PERIP_CLK_EN1` reader"]
pub type R = crate::R<PERIP_CLK_EN1_SPEC>;
#[doc = "Register `PERIP_CLK_EN1` writer"]
pub type W = crate::W<PERIP_CLK_EN1_SPEC>;
#[doc = "Field `CRYPTO_ECC_CLK_EN` reader - Set 1 to enable ECC clock"]
pub type CRYPTO_ECC_CLK_EN_R = crate::BitReader;
#[doc = "Field `CRYPTO_ECC_CLK_EN` writer - Set 1 to enable ECC clock"]
pub type CRYPTO_ECC_CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `CRYPTO_SHA_CLK_EN` reader - Set 1 to enable SHA clock"]
pub type CRYPTO_SHA_CLK_EN_R = crate::BitReader;
#[doc = "Field `CRYPTO_SHA_CLK_EN` writer - Set 1 to enable SHA clock"]
pub type CRYPTO_SHA_CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `DMA_CLK_EN` reader - Set 1 to enable DMA clock"]
pub type DMA_CLK_EN_R = crate::BitReader;
#[doc = "Field `DMA_CLK_EN` writer - Set 1 to enable DMA clock"]
pub type DMA_CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `TSENS_CLK_EN` reader - Set 1 to enable TSENS clock"]
pub type TSENS_CLK_EN_R = crate::BitReader;
#[doc = "Field `TSENS_CLK_EN` writer - Set 1 to enable TSENS clock"]
pub type TSENS_CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
impl R {
#[doc = "Bit 1 - Set 1 to enable ECC clock"]
#[inline(always)]
pub fn crypto_ecc_clk_en(&self) -> CRYPTO_ECC_CLK_EN_R {
CRYPTO_ECC_CLK_EN_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Set 1 to enable SHA clock"]
#[inline(always)]
pub fn crypto_sha_clk_en(&self) -> CRYPTO_SHA_CLK_EN_R {
CRYPTO_SHA_CLK_EN_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 6 - Set 1 to enable DMA clock"]
#[inline(always)]
pub fn dma_clk_en(&self) -> DMA_CLK_EN_R {
DMA_CLK_EN_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 10 - Set 1 to enable TSENS clock"]
#[inline(always)]
pub fn tsens_clk_en(&self) -> TSENS_CLK_EN_R {
TSENS_CLK_EN_R::new(((self.bits >> 10) & 1) != 0)
}
}
#[cfg(feature = "impl-register-debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("PERIP_CLK_EN1")
.field("crypto_ecc_clk_en", &self.crypto_ecc_clk_en())
.field("crypto_sha_clk_en", &self.crypto_sha_clk_en())
.field("dma_clk_en", &self.dma_clk_en())
.field("tsens_clk_en", &self.tsens_clk_en())
.finish()
}
}
impl W {
#[doc = "Bit 1 - Set 1 to enable ECC clock"]
#[inline(always)]
#[must_use]
pub fn crypto_ecc_clk_en(&mut self) -> CRYPTO_ECC_CLK_EN_W<PERIP_CLK_EN1_SPEC> {
CRYPTO_ECC_CLK_EN_W::new(self, 1)
}
#[doc = "Bit 2 - Set 1 to enable SHA clock"]
#[inline(always)]
#[must_use]
pub fn crypto_sha_clk_en(&mut self) -> CRYPTO_SHA_CLK_EN_W<PERIP_CLK_EN1_SPEC> {
CRYPTO_SHA_CLK_EN_W::new(self, 2)
}
#[doc = "Bit 6 - Set 1 to enable DMA clock"]
#[inline(always)]
#[must_use]
pub fn dma_clk_en(&mut self) -> DMA_CLK_EN_W<PERIP_CLK_EN1_SPEC> {
DMA_CLK_EN_W::new(self, 6)
}
#[doc = "Bit 10 - Set 1 to enable TSENS clock"]
#[inline(always)]
#[must_use]
pub fn tsens_clk_en(&mut self) -> TSENS_CLK_EN_W<PERIP_CLK_EN1_SPEC> {
TSENS_CLK_EN_W::new(self, 10)
}
}
#[doc = "peripheral clock gating register\n\nYou can [`read`](crate::Reg::read) this register and get [`perip_clk_en1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`perip_clk_en1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct PERIP_CLK_EN1_SPEC;
impl crate::RegisterSpec for PERIP_CLK_EN1_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [`perip_clk_en1::R`](R) reader structure"]
impl crate::Readable for PERIP_CLK_EN1_SPEC {}
#[doc = "`write(|w| ..)` method takes [`perip_clk_en1::W`](W) writer structure"]
impl crate::Writable for PERIP_CLK_EN1_SPEC {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets PERIP_CLK_EN1 to value 0"]
impl crate::Resettable for PERIP_CLK_EN1_SPEC {
const RESET_VALUE: u32 = 0;
}