bl702_pac/glb/
swrst_cfg2.rs1#[doc = "Register `swrst_cfg2` reader"]
2pub struct R(crate::R<SWRST_CFG2_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SWRST_CFG2_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SWRST_CFG2_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SWRST_CFG2_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `swrst_cfg2` writer"]
17pub struct W(crate::W<SWRST_CFG2_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SWRST_CFG2_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<SWRST_CFG2_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SWRST_CFG2_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `reg_ctrl_pwron_rst` reader - "]
38pub type REG_CTRL_PWRON_RST_R = crate::BitReader<bool>;
39#[doc = "Field `reg_ctrl_pwron_rst` writer - "]
40pub type REG_CTRL_PWRON_RST_W<'a, const O: u8> =
41 crate::BitWriter<'a, u32, SWRST_CFG2_SPEC, bool, O>;
42#[doc = "Field `reg_ctrl_cpu_reset` reader - "]
43pub type REG_CTRL_CPU_RESET_R = crate::BitReader<bool>;
44#[doc = "Field `reg_ctrl_cpu_reset` writer - "]
45pub type REG_CTRL_CPU_RESET_W<'a, const O: u8> =
46 crate::BitWriter<'a, u32, SWRST_CFG2_SPEC, bool, O>;
47#[doc = "Field `reg_ctrl_sys_reset` reader - "]
48pub type REG_CTRL_SYS_RESET_R = crate::BitReader<bool>;
49#[doc = "Field `reg_ctrl_sys_reset` writer - "]
50pub type REG_CTRL_SYS_RESET_W<'a, const O: u8> =
51 crate::BitWriter<'a, u32, SWRST_CFG2_SPEC, bool, O>;
52#[doc = "Field `reg_ctrl_reset_dummy` reader - "]
53pub type REG_CTRL_RESET_DUMMY_R = crate::FieldReader<u8, u8>;
54#[doc = "Field `reg_ctrl_reset_dummy` writer - "]
55pub type REG_CTRL_RESET_DUMMY_W<'a, const O: u8> =
56 crate::FieldWriter<'a, u32, SWRST_CFG2_SPEC, u8, u8, 4, O>;
57#[doc = "Field `pka_clk_sel` reader - "]
58pub type PKA_CLK_SEL_R = crate::BitReader<bool>;
59#[doc = "Field `pka_clk_sel` writer - "]
60pub type PKA_CLK_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWRST_CFG2_SPEC, bool, O>;
61impl R {
62 #[doc = "Bit 0"]
63 #[inline(always)]
64 pub fn reg_ctrl_pwron_rst(&self) -> REG_CTRL_PWRON_RST_R {
65 REG_CTRL_PWRON_RST_R::new((self.bits & 1) != 0)
66 }
67 #[doc = "Bit 1"]
68 #[inline(always)]
69 pub fn reg_ctrl_cpu_reset(&self) -> REG_CTRL_CPU_RESET_R {
70 REG_CTRL_CPU_RESET_R::new(((self.bits >> 1) & 1) != 0)
71 }
72 #[doc = "Bit 2"]
73 #[inline(always)]
74 pub fn reg_ctrl_sys_reset(&self) -> REG_CTRL_SYS_RESET_R {
75 REG_CTRL_SYS_RESET_R::new(((self.bits >> 2) & 1) != 0)
76 }
77 #[doc = "Bits 4:7"]
78 #[inline(always)]
79 pub fn reg_ctrl_reset_dummy(&self) -> REG_CTRL_RESET_DUMMY_R {
80 REG_CTRL_RESET_DUMMY_R::new(((self.bits >> 4) & 0x0f) as u8)
81 }
82 #[doc = "Bit 24"]
83 #[inline(always)]
84 pub fn pka_clk_sel(&self) -> PKA_CLK_SEL_R {
85 PKA_CLK_SEL_R::new(((self.bits >> 24) & 1) != 0)
86 }
87}
88impl W {
89 #[doc = "Bit 0"]
90 #[inline(always)]
91 #[must_use]
92 pub fn reg_ctrl_pwron_rst(&mut self) -> REG_CTRL_PWRON_RST_W<0> {
93 REG_CTRL_PWRON_RST_W::new(self)
94 }
95 #[doc = "Bit 1"]
96 #[inline(always)]
97 #[must_use]
98 pub fn reg_ctrl_cpu_reset(&mut self) -> REG_CTRL_CPU_RESET_W<1> {
99 REG_CTRL_CPU_RESET_W::new(self)
100 }
101 #[doc = "Bit 2"]
102 #[inline(always)]
103 #[must_use]
104 pub fn reg_ctrl_sys_reset(&mut self) -> REG_CTRL_SYS_RESET_W<2> {
105 REG_CTRL_SYS_RESET_W::new(self)
106 }
107 #[doc = "Bits 4:7"]
108 #[inline(always)]
109 #[must_use]
110 pub fn reg_ctrl_reset_dummy(&mut self) -> REG_CTRL_RESET_DUMMY_W<4> {
111 REG_CTRL_RESET_DUMMY_W::new(self)
112 }
113 #[doc = "Bit 24"]
114 #[inline(always)]
115 #[must_use]
116 pub fn pka_clk_sel(&mut self) -> PKA_CLK_SEL_W<24> {
117 PKA_CLK_SEL_W::new(self)
118 }
119 #[doc = "Writes raw bits to the register."]
120 #[inline(always)]
121 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
122 self.0.bits(bits);
123 self
124 }
125}
126#[doc = "swrst_cfg2.\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 [swrst_cfg2](index.html) module"]
127pub struct SWRST_CFG2_SPEC;
128impl crate::RegisterSpec for SWRST_CFG2_SPEC {
129 type Ux = u32;
130}
131#[doc = "`read()` method returns [swrst_cfg2::R](R) reader structure"]
132impl crate::Readable for SWRST_CFG2_SPEC {
133 type Reader = R;
134}
135#[doc = "`write(|w| ..)` method takes [swrst_cfg2::W](W) writer structure"]
136impl crate::Writable for SWRST_CFG2_SPEC {
137 type Writer = W;
138 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
139 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
140}
141#[doc = "`reset()` method sets swrst_cfg2 to value 0"]
142impl crate::Resettable for SWRST_CFG2_SPEC {
143 const RESET_VALUE: Self::Ux = 0;
144}