eos_s3/pmu/
gen_purpose_0.rs1#[doc = "Register `GEN_PURPOSE_0` reader"]
2pub struct R(crate::R<GEN_PURPOSE_0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<GEN_PURPOSE_0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<GEN_PURPOSE_0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<GEN_PURPOSE_0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `GEN_PURPOSE_0` writer"]
17pub struct W(crate::W<GEN_PURPOSE_0_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<GEN_PURPOSE_0_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<GEN_PURPOSE_0_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<GEN_PURPOSE_0_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `General_Purpose` reader - General purpose SFR"]
38pub struct GENERAL_PURPOSE_R(crate::FieldReader<u8, u8>);
39impl GENERAL_PURPOSE_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: u8) -> Self {
42 GENERAL_PURPOSE_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for GENERAL_PURPOSE_R {
46 type Target = crate::FieldReader<u8, u8>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `General_Purpose` writer - General purpose SFR"]
53pub struct GENERAL_PURPOSE_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> GENERAL_PURPOSE_W<'a> {
57 #[doc = r"Writes raw bits to the field"]
58 #[inline(always)]
59 pub unsafe fn bits(self, value: u8) -> &'a mut W {
60 self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff);
61 self.w
62 }
63}
64#[doc = "Field `Audio_SRAM_HW_DS_Cfg` reader - Set to allow audio HW to put the Audio SRAM into Deep Sleep mode. Please see Audio Spec for detail"]
65pub struct AUDIO_SRAM_HW_DS_CFG_R(crate::FieldReader<bool, bool>);
66impl AUDIO_SRAM_HW_DS_CFG_R {
67 #[inline(always)]
68 pub(crate) fn new(bits: bool) -> Self {
69 AUDIO_SRAM_HW_DS_CFG_R(crate::FieldReader::new(bits))
70 }
71}
72impl core::ops::Deref for AUDIO_SRAM_HW_DS_CFG_R {
73 type Target = crate::FieldReader<bool, bool>;
74 #[inline(always)]
75 fn deref(&self) -> &Self::Target {
76 &self.0
77 }
78}
79#[doc = "Field `Audio_SRAM_HW_DS_Cfg` writer - Set to allow audio HW to put the Audio SRAM into Deep Sleep mode. Please see Audio Spec for detail"]
80pub struct AUDIO_SRAM_HW_DS_CFG_W<'a> {
81 w: &'a mut W,
82}
83impl<'a> AUDIO_SRAM_HW_DS_CFG_W<'a> {
84 #[doc = r"Sets the field bit"]
85 #[inline(always)]
86 pub fn set_bit(self) -> &'a mut W {
87 self.bit(true)
88 }
89 #[doc = r"Clears the field bit"]
90 #[inline(always)]
91 pub fn clear_bit(self) -> &'a mut W {
92 self.bit(false)
93 }
94 #[doc = r"Writes raw bits to the field"]
95 #[inline(always)]
96 pub fn bit(self, value: bool) -> &'a mut W {
97 self.w.bits =
98 (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8);
99 self.w
100 }
101}
102#[doc = "Field `FB_Cfg_Enable` reader - Set to enable FB configuration. Hardware will set once entering FB shutdown mode"]
103pub struct FB_CFG_ENABLE_R(crate::FieldReader<bool, bool>);
104impl FB_CFG_ENABLE_R {
105 #[inline(always)]
106 pub(crate) fn new(bits: bool) -> Self {
107 FB_CFG_ENABLE_R(crate::FieldReader::new(bits))
108 }
109}
110impl core::ops::Deref for FB_CFG_ENABLE_R {
111 type Target = crate::FieldReader<bool, bool>;
112 #[inline(always)]
113 fn deref(&self) -> &Self::Target {
114 &self.0
115 }
116}
117#[doc = "Field `FB_Cfg_Enable` writer - Set to enable FB configuration. Hardware will set once entering FB shutdown mode"]
118pub struct FB_CFG_ENABLE_W<'a> {
119 w: &'a mut W,
120}
121impl<'a> FB_CFG_ENABLE_W<'a> {
122 #[doc = r"Sets the field bit"]
123 #[inline(always)]
124 pub fn set_bit(self) -> &'a mut W {
125 self.bit(true)
126 }
127 #[doc = r"Clears the field bit"]
128 #[inline(always)]
129 pub fn clear_bit(self) -> &'a mut W {
130 self.bit(false)
131 }
132 #[doc = r"Writes raw bits to the field"]
133 #[inline(always)]
134 pub fn bit(self, value: bool) -> &'a mut W {
135 self.w.bits =
136 (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9);
137 self.w
138 }
139}
140impl R {
141 #[doc = "Bits 0:7 - General purpose SFR"]
142 #[inline(always)]
143 pub fn general_purpose(&self) -> GENERAL_PURPOSE_R {
144 GENERAL_PURPOSE_R::new((self.bits & 0xff) as u8)
145 }
146 #[doc = "Bit 8 - Set to allow audio HW to put the Audio SRAM into Deep Sleep mode. Please see Audio Spec for detail"]
147 #[inline(always)]
148 pub fn audio_sram_hw_ds_cfg(&self) -> AUDIO_SRAM_HW_DS_CFG_R {
149 AUDIO_SRAM_HW_DS_CFG_R::new(((self.bits >> 8) & 0x01) != 0)
150 }
151 #[doc = "Bit 9 - Set to enable FB configuration. Hardware will set once entering FB shutdown mode"]
152 #[inline(always)]
153 pub fn fb_cfg_enable(&self) -> FB_CFG_ENABLE_R {
154 FB_CFG_ENABLE_R::new(((self.bits >> 9) & 0x01) != 0)
155 }
156}
157impl W {
158 #[doc = "Bits 0:7 - General purpose SFR"]
159 #[inline(always)]
160 pub fn general_purpose(&mut self) -> GENERAL_PURPOSE_W {
161 GENERAL_PURPOSE_W { w: self }
162 }
163 #[doc = "Bit 8 - Set to allow audio HW to put the Audio SRAM into Deep Sleep mode. Please see Audio Spec for detail"]
164 #[inline(always)]
165 pub fn audio_sram_hw_ds_cfg(&mut self) -> AUDIO_SRAM_HW_DS_CFG_W {
166 AUDIO_SRAM_HW_DS_CFG_W { w: self }
167 }
168 #[doc = "Bit 9 - Set to enable FB configuration. Hardware will set once entering FB shutdown mode"]
169 #[inline(always)]
170 pub fn fb_cfg_enable(&mut self) -> FB_CFG_ENABLE_W {
171 FB_CFG_ENABLE_W { w: self }
172 }
173 #[doc = "Writes raw bits to the register."]
174 #[inline(always)]
175 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
176 self.0.bits(bits);
177 self
178 }
179}
180#[doc = "Configure FB config enable and wether Audio SRAM can be put into Deep Sleep by the Audio hardware\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 [gen_purpose_0](index.html) module"]
181pub struct GEN_PURPOSE_0_SPEC;
182impl crate::RegisterSpec for GEN_PURPOSE_0_SPEC {
183 type Ux = u32;
184}
185#[doc = "`read()` method returns [gen_purpose_0::R](R) reader structure"]
186impl crate::Readable for GEN_PURPOSE_0_SPEC {
187 type Reader = R;
188}
189#[doc = "`write(|w| ..)` method takes [gen_purpose_0::W](W) writer structure"]
190impl crate::Writable for GEN_PURPOSE_0_SPEC {
191 type Writer = W;
192}
193#[doc = "`reset()` method sets GEN_PURPOSE_0 to value 0x0200"]
194impl crate::Resettable for GEN_PURPOSE_0_SPEC {
195 #[inline(always)]
196 fn reset_value() -> Self::Ux {
197 0x0200
198 }
199}