#[doc = "Reader of register CLK_CONF"]
pub type R = crate::R<u32, super::CLK_CONF>;
#[doc = "Writer for register CLK_CONF"]
pub type W = crate::W<u32, super::CLK_CONF>;
#[doc = "Register CLK_CONF `reset()`'s with value 0"]
impl crate::ResetValue for super::CLK_CONF {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `ANA_CLK_RTC_SEL`"]
pub type ANA_CLK_RTC_SEL_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `ANA_CLK_RTC_SEL`"]
pub struct ANA_CLK_RTC_SEL_W<'a> {
w: &'a mut W,
}
impl<'a> ANA_CLK_RTC_SEL_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30);
self.w
}
}
#[doc = "Reader of field `FAST_CLK_RTC_SEL`"]
pub type FAST_CLK_RTC_SEL_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `FAST_CLK_RTC_SEL`"]
pub struct FAST_CLK_RTC_SEL_W<'a> {
w: &'a mut W,
}
impl<'a> FAST_CLK_RTC_SEL_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 << 29)) | (((value as u32) & 0x01) << 29);
self.w
}
}
#[doc = "Reader of field `SOC_CLK_SEL`"]
pub type SOC_CLK_SEL_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SOC_CLK_SEL`"]
pub struct SOC_CLK_SEL_W<'a> {
w: &'a mut W,
}
impl<'a> SOC_CLK_SEL_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 27)) | (((value as u32) & 0x03) << 27);
self.w
}
}
#[doc = "Reader of field `CK8M_FORCE_PU`"]
pub type CK8M_FORCE_PU_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CK8M_FORCE_PU`"]
pub struct CK8M_FORCE_PU_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_FORCE_PU_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 << 26)) | (((value as u32) & 0x01) << 26);
self.w
}
}
#[doc = "Reader of field `CK8M_FORCE_PD`"]
pub type CK8M_FORCE_PD_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CK8M_FORCE_PD`"]
pub struct CK8M_FORCE_PD_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_FORCE_PD_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 << 25)) | (((value as u32) & 0x01) << 25);
self.w
}
}
#[doc = "Reader of field `CK8M_DFREQ`"]
pub type CK8M_DFREQ_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `CK8M_DFREQ`"]
pub struct CK8M_DFREQ_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_DFREQ_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0xff << 17)) | (((value as u32) & 0xff) << 17);
self.w
}
}
#[doc = "Reader of field `CK8M_FORCE_NOGATING`"]
pub type CK8M_FORCE_NOGATING_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CK8M_FORCE_NOGATING`"]
pub struct CK8M_FORCE_NOGATING_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_FORCE_NOGATING_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 = "Reader of field `XTAL_FORCE_NOGATING`"]
pub type XTAL_FORCE_NOGATING_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `XTAL_FORCE_NOGATING`"]
pub struct XTAL_FORCE_NOGATING_W<'a> {
w: &'a mut W,
}
impl<'a> XTAL_FORCE_NOGATING_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 << 15)) | (((value as u32) & 0x01) << 15);
self.w
}
}
#[doc = "Reader of field `CK8M_DIV_SEL`"]
pub type CK8M_DIV_SEL_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `CK8M_DIV_SEL`"]
pub struct CK8M_DIV_SEL_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_DIV_SEL_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 12)) | (((value as u32) & 0x07) << 12);
self.w
}
}
#[doc = "Reader of field `CK8M_DFREQ_FORCE`"]
pub type CK8M_DFREQ_FORCE_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `CK8M_DFREQ_FORCE`"]
pub struct CK8M_DFREQ_FORCE_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_DFREQ_FORCE_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 = "Reader of field `DIG_CLK8M_EN`"]
pub type DIG_CLK8M_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `DIG_CLK8M_EN`"]
pub struct DIG_CLK8M_EN_W<'a> {
w: &'a mut W,
}
impl<'a> DIG_CLK8M_EN_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 = "Reader of field `DIG_CLK8M_D256_EN`"]
pub type DIG_CLK8M_D256_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `DIG_CLK8M_D256_EN`"]
pub struct DIG_CLK8M_D256_EN_W<'a> {
w: &'a mut W,
}
impl<'a> DIG_CLK8M_D256_EN_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 << 9)) | (((value as u32) & 0x01) << 9);
self.w
}
}
#[doc = "Reader of field `DIG_XTAL32K_EN`"]
pub type DIG_XTAL32K_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `DIG_XTAL32K_EN`"]
pub struct DIG_XTAL32K_EN_W<'a> {
w: &'a mut W,
}
impl<'a> DIG_XTAL32K_EN_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 = "Reader of field `ENB_CK8M_DIV`"]
pub type ENB_CK8M_DIV_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ENB_CK8M_DIV`"]
pub struct ENB_CK8M_DIV_W<'a> {
w: &'a mut W,
}
impl<'a> ENB_CK8M_DIV_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 = "Reader of field `ENB_CK8M`"]
pub type ENB_CK8M_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ENB_CK8M`"]
pub struct ENB_CK8M_W<'a> {
w: &'a mut W,
}
impl<'a> ENB_CK8M_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 = "Reader of field `CK8M_DIV`"]
pub type CK8M_DIV_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `CK8M_DIV`"]
pub struct CK8M_DIV_W<'a> {
w: &'a mut W,
}
impl<'a> CK8M_DIV_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 4)) | (((value as u32) & 0x03) << 4);
self.w
}
}
impl R {
#[doc = "Bits 30:31"]
#[inline(always)]
pub fn ana_clk_rtc_sel(&self) -> ANA_CLK_RTC_SEL_R {
ANA_CLK_RTC_SEL_R::new(((self.bits >> 30) & 0x03) as u8)
}
#[doc = "Bit 29"]
#[inline(always)]
pub fn fast_clk_rtc_sel(&self) -> FAST_CLK_RTC_SEL_R {
FAST_CLK_RTC_SEL_R::new(((self.bits >> 29) & 0x01) != 0)
}
#[doc = "Bits 27:28"]
#[inline(always)]
pub fn soc_clk_sel(&self) -> SOC_CLK_SEL_R {
SOC_CLK_SEL_R::new(((self.bits >> 27) & 0x03) as u8)
}
#[doc = "Bit 26"]
#[inline(always)]
pub fn ck8m_force_pu(&self) -> CK8M_FORCE_PU_R {
CK8M_FORCE_PU_R::new(((self.bits >> 26) & 0x01) != 0)
}
#[doc = "Bit 25"]
#[inline(always)]
pub fn ck8m_force_pd(&self) -> CK8M_FORCE_PD_R {
CK8M_FORCE_PD_R::new(((self.bits >> 25) & 0x01) != 0)
}
#[doc = "Bits 17:24"]
#[inline(always)]
pub fn ck8m_dfreq(&self) -> CK8M_DFREQ_R {
CK8M_DFREQ_R::new(((self.bits >> 17) & 0xff) as u8)
}
#[doc = "Bit 16"]
#[inline(always)]
pub fn ck8m_force_nogating(&self) -> CK8M_FORCE_NOGATING_R {
CK8M_FORCE_NOGATING_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 15"]
#[inline(always)]
pub fn xtal_force_nogating(&self) -> XTAL_FORCE_NOGATING_R {
XTAL_FORCE_NOGATING_R::new(((self.bits >> 15) & 0x01) != 0)
}
#[doc = "Bits 12:14"]
#[inline(always)]
pub fn ck8m_div_sel(&self) -> CK8M_DIV_SEL_R {
CK8M_DIV_SEL_R::new(((self.bits >> 12) & 0x07) as u8)
}
#[doc = "Bit 11"]
#[inline(always)]
pub fn ck8m_dfreq_force(&self) -> CK8M_DFREQ_FORCE_R {
CK8M_DFREQ_FORCE_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 10"]
#[inline(always)]
pub fn dig_clk8m_en(&self) -> DIG_CLK8M_EN_R {
DIG_CLK8M_EN_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn dig_clk8m_d256_en(&self) -> DIG_CLK8M_D256_EN_R {
DIG_CLK8M_D256_EN_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn dig_xtal32k_en(&self) -> DIG_XTAL32K_EN_R {
DIG_XTAL32K_EN_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 7"]
#[inline(always)]
pub fn enb_ck8m_div(&self) -> ENB_CK8M_DIV_R {
ENB_CK8M_DIV_R::new(((self.bits >> 7) & 0x01) != 0)
}
#[doc = "Bit 6"]
#[inline(always)]
pub fn enb_ck8m(&self) -> ENB_CK8M_R {
ENB_CK8M_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bits 4:5"]
#[inline(always)]
pub fn ck8m_div(&self) -> CK8M_DIV_R {
CK8M_DIV_R::new(((self.bits >> 4) & 0x03) as u8)
}
}
impl W {
#[doc = "Bits 30:31"]
#[inline(always)]
pub fn ana_clk_rtc_sel(&mut self) -> ANA_CLK_RTC_SEL_W {
ANA_CLK_RTC_SEL_W { w: self }
}
#[doc = "Bit 29"]
#[inline(always)]
pub fn fast_clk_rtc_sel(&mut self) -> FAST_CLK_RTC_SEL_W {
FAST_CLK_RTC_SEL_W { w: self }
}
#[doc = "Bits 27:28"]
#[inline(always)]
pub fn soc_clk_sel(&mut self) -> SOC_CLK_SEL_W {
SOC_CLK_SEL_W { w: self }
}
#[doc = "Bit 26"]
#[inline(always)]
pub fn ck8m_force_pu(&mut self) -> CK8M_FORCE_PU_W {
CK8M_FORCE_PU_W { w: self }
}
#[doc = "Bit 25"]
#[inline(always)]
pub fn ck8m_force_pd(&mut self) -> CK8M_FORCE_PD_W {
CK8M_FORCE_PD_W { w: self }
}
#[doc = "Bits 17:24"]
#[inline(always)]
pub fn ck8m_dfreq(&mut self) -> CK8M_DFREQ_W {
CK8M_DFREQ_W { w: self }
}
#[doc = "Bit 16"]
#[inline(always)]
pub fn ck8m_force_nogating(&mut self) -> CK8M_FORCE_NOGATING_W {
CK8M_FORCE_NOGATING_W { w: self }
}
#[doc = "Bit 15"]
#[inline(always)]
pub fn xtal_force_nogating(&mut self) -> XTAL_FORCE_NOGATING_W {
XTAL_FORCE_NOGATING_W { w: self }
}
#[doc = "Bits 12:14"]
#[inline(always)]
pub fn ck8m_div_sel(&mut self) -> CK8M_DIV_SEL_W {
CK8M_DIV_SEL_W { w: self }
}
#[doc = "Bit 11"]
#[inline(always)]
pub fn ck8m_dfreq_force(&mut self) -> CK8M_DFREQ_FORCE_W {
CK8M_DFREQ_FORCE_W { w: self }
}
#[doc = "Bit 10"]
#[inline(always)]
pub fn dig_clk8m_en(&mut self) -> DIG_CLK8M_EN_W {
DIG_CLK8M_EN_W { w: self }
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn dig_clk8m_d256_en(&mut self) -> DIG_CLK8M_D256_EN_W {
DIG_CLK8M_D256_EN_W { w: self }
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn dig_xtal32k_en(&mut self) -> DIG_XTAL32K_EN_W {
DIG_XTAL32K_EN_W { w: self }
}
#[doc = "Bit 7"]
#[inline(always)]
pub fn enb_ck8m_div(&mut self) -> ENB_CK8M_DIV_W {
ENB_CK8M_DIV_W { w: self }
}
#[doc = "Bit 6"]
#[inline(always)]
pub fn enb_ck8m(&mut self) -> ENB_CK8M_W {
ENB_CK8M_W { w: self }
}
#[doc = "Bits 4:5"]
#[inline(always)]
pub fn ck8m_div(&mut self) -> CK8M_DIV_W {
CK8M_DIV_W { w: self }
}
}