bl602_pac/pds/
rc32m_ctrl1.rs

1#[doc = "Register `rc32m_ctrl1` reader"]
2pub struct R(crate::R<RC32M_CTRL1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RC32M_CTRL1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RC32M_CTRL1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RC32M_CTRL1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `rc32m_ctrl1` writer"]
17pub struct W(crate::W<RC32M_CTRL1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<RC32M_CTRL1_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<RC32M_CTRL1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<RC32M_CTRL1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `rc32m_test_en` reader - "]
38pub type RC32M_TEST_EN_R = crate::BitReader<bool>;
39#[doc = "Field `rc32m_test_en` writer - "]
40pub type RC32M_TEST_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RC32M_CTRL1_SPEC, bool, O>;
41#[doc = "Field `rc32m_soft_rst` reader - "]
42pub type RC32M_SOFT_RST_R = crate::BitReader<bool>;
43#[doc = "Field `rc32m_soft_rst` writer - "]
44pub type RC32M_SOFT_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, RC32M_CTRL1_SPEC, bool, O>;
45#[doc = "Field `rc32m_clk_soft_rst` reader - "]
46pub type RC32M_CLK_SOFT_RST_R = crate::BitReader<bool>;
47#[doc = "Field `rc32m_clk_soft_rst` writer - "]
48pub type RC32M_CLK_SOFT_RST_W<'a, const O: u8> =
49    crate::BitWriter<'a, u32, RC32M_CTRL1_SPEC, bool, O>;
50#[doc = "Field `rc32m_clk_inv` reader - "]
51pub type RC32M_CLK_INV_R = crate::BitReader<bool>;
52#[doc = "Field `rc32m_clk_inv` writer - "]
53pub type RC32M_CLK_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, RC32M_CTRL1_SPEC, bool, O>;
54#[doc = "Field `rc32m_clk_force_on` reader - "]
55pub type RC32M_CLK_FORCE_ON_R = crate::BitReader<bool>;
56#[doc = "Field `rc32m_clk_force_on` writer - "]
57pub type RC32M_CLK_FORCE_ON_W<'a, const O: u8> =
58    crate::BitWriter<'a, u32, RC32M_CTRL1_SPEC, bool, O>;
59#[doc = "Field `rc32m_reserved` reader - "]
60pub type RC32M_RESERVED_R = crate::FieldReader<u8, u8>;
61#[doc = "Field `rc32m_reserved` writer - "]
62pub type RC32M_RESERVED_W<'a, const O: u8> =
63    crate::FieldWriter<'a, u32, RC32M_CTRL1_SPEC, u8, u8, 8, O>;
64impl R {
65    #[doc = "Bit 0"]
66    #[inline(always)]
67    pub fn rc32m_test_en(&self) -> RC32M_TEST_EN_R {
68        RC32M_TEST_EN_R::new((self.bits & 1) != 0)
69    }
70    #[doc = "Bit 1"]
71    #[inline(always)]
72    pub fn rc32m_soft_rst(&self) -> RC32M_SOFT_RST_R {
73        RC32M_SOFT_RST_R::new(((self.bits >> 1) & 1) != 0)
74    }
75    #[doc = "Bit 2"]
76    #[inline(always)]
77    pub fn rc32m_clk_soft_rst(&self) -> RC32M_CLK_SOFT_RST_R {
78        RC32M_CLK_SOFT_RST_R::new(((self.bits >> 2) & 1) != 0)
79    }
80    #[doc = "Bit 3"]
81    #[inline(always)]
82    pub fn rc32m_clk_inv(&self) -> RC32M_CLK_INV_R {
83        RC32M_CLK_INV_R::new(((self.bits >> 3) & 1) != 0)
84    }
85    #[doc = "Bit 4"]
86    #[inline(always)]
87    pub fn rc32m_clk_force_on(&self) -> RC32M_CLK_FORCE_ON_R {
88        RC32M_CLK_FORCE_ON_R::new(((self.bits >> 4) & 1) != 0)
89    }
90    #[doc = "Bits 24:31"]
91    #[inline(always)]
92    pub fn rc32m_reserved(&self) -> RC32M_RESERVED_R {
93        RC32M_RESERVED_R::new(((self.bits >> 24) & 0xff) as u8)
94    }
95}
96impl W {
97    #[doc = "Bit 0"]
98    #[inline(always)]
99    #[must_use]
100    pub fn rc32m_test_en(&mut self) -> RC32M_TEST_EN_W<0> {
101        RC32M_TEST_EN_W::new(self)
102    }
103    #[doc = "Bit 1"]
104    #[inline(always)]
105    #[must_use]
106    pub fn rc32m_soft_rst(&mut self) -> RC32M_SOFT_RST_W<1> {
107        RC32M_SOFT_RST_W::new(self)
108    }
109    #[doc = "Bit 2"]
110    #[inline(always)]
111    #[must_use]
112    pub fn rc32m_clk_soft_rst(&mut self) -> RC32M_CLK_SOFT_RST_W<2> {
113        RC32M_CLK_SOFT_RST_W::new(self)
114    }
115    #[doc = "Bit 3"]
116    #[inline(always)]
117    #[must_use]
118    pub fn rc32m_clk_inv(&mut self) -> RC32M_CLK_INV_W<3> {
119        RC32M_CLK_INV_W::new(self)
120    }
121    #[doc = "Bit 4"]
122    #[inline(always)]
123    #[must_use]
124    pub fn rc32m_clk_force_on(&mut self) -> RC32M_CLK_FORCE_ON_W<4> {
125        RC32M_CLK_FORCE_ON_W::new(self)
126    }
127    #[doc = "Bits 24:31"]
128    #[inline(always)]
129    #[must_use]
130    pub fn rc32m_reserved(&mut self) -> RC32M_RESERVED_W<24> {
131        RC32M_RESERVED_W::new(self)
132    }
133    #[doc = "Writes raw bits to the register."]
134    #[inline(always)]
135    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
136        self.0.bits(bits);
137        self
138    }
139}
140#[doc = "rc32m_ctrl1.\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 [rc32m_ctrl1](index.html) module"]
141pub struct RC32M_CTRL1_SPEC;
142impl crate::RegisterSpec for RC32M_CTRL1_SPEC {
143    type Ux = u32;
144}
145#[doc = "`read()` method returns [rc32m_ctrl1::R](R) reader structure"]
146impl crate::Readable for RC32M_CTRL1_SPEC {
147    type Reader = R;
148}
149#[doc = "`write(|w| ..)` method takes [rc32m_ctrl1::W](W) writer structure"]
150impl crate::Writable for RC32M_CTRL1_SPEC {
151    type Writer = W;
152    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
153    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
154}
155#[doc = "`reset()` method sets rc32m_ctrl1 to value 0"]
156impl crate::Resettable for RC32M_CTRL1_SPEC {
157    const RESET_VALUE: Self::Ux = 0;
158}