eos_s3/ext_regs_ffe/
ffe_debug_sel.rs

1#[doc = "Register `FFE_DEBUG_SEL` reader"]
2pub struct R(crate::R<FFE_DEBUG_SEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FFE_DEBUG_SEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FFE_DEBUG_SEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FFE_DEBUG_SEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FFE_DEBUG_SEL` writer"]
17pub struct W(crate::W<FFE_DEBUG_SEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FFE_DEBUG_SEL_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<FFE_DEBUG_SEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FFE_DEBUG_SEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `FFE_DEBUG_SEL_SM0` reader - SM0 LS debug slection"]
38pub struct FFE_DEBUG_SEL_SM0_R(crate::FieldReader<u8, u8>);
39impl FFE_DEBUG_SEL_SM0_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        FFE_DEBUG_SEL_SM0_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for FFE_DEBUG_SEL_SM0_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 `FFE_DEBUG_SEL_SM0` writer - SM0 LS debug slection"]
53pub struct FFE_DEBUG_SEL_SM0_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> FFE_DEBUG_SEL_SM0_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 `FFE_DEBUG_SEL_SM1` reader - SM1 LS debug slection"]
65pub struct FFE_DEBUG_SEL_SM1_R(crate::FieldReader<u8, u8>);
66impl FFE_DEBUG_SEL_SM1_R {
67    #[inline(always)]
68    pub(crate) fn new(bits: u8) -> Self {
69        FFE_DEBUG_SEL_SM1_R(crate::FieldReader::new(bits))
70    }
71}
72impl core::ops::Deref for FFE_DEBUG_SEL_SM1_R {
73    type Target = crate::FieldReader<u8, u8>;
74    #[inline(always)]
75    fn deref(&self) -> &Self::Target {
76        &self.0
77    }
78}
79#[doc = "Field `FFE_DEBUG_SEL_SM1` writer - SM1 LS debug slection"]
80pub struct FFE_DEBUG_SEL_SM1_W<'a> {
81    w: &'a mut W,
82}
83impl<'a> FFE_DEBUG_SEL_SM1_W<'a> {
84    #[doc = r"Writes raw bits to the field"]
85    #[inline(always)]
86    pub unsafe fn bits(self, value: u8) -> &'a mut W {
87        self.w.bits =
88            (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8);
89        self.w
90    }
91}
92#[doc = "Field `FFE_DEBUG_SEL_FFE0` reader - FFE0 LS debug slection"]
93pub struct FFE_DEBUG_SEL_FFE0_R(crate::FieldReader<u8, u8>);
94impl FFE_DEBUG_SEL_FFE0_R {
95    #[inline(always)]
96    pub(crate) fn new(bits: u8) -> Self {
97        FFE_DEBUG_SEL_FFE0_R(crate::FieldReader::new(bits))
98    }
99}
100impl core::ops::Deref for FFE_DEBUG_SEL_FFE0_R {
101    type Target = crate::FieldReader<u8, u8>;
102    #[inline(always)]
103    fn deref(&self) -> &Self::Target {
104        &self.0
105    }
106}
107#[doc = "Field `FFE_DEBUG_SEL_FFE0` writer - FFE0 LS debug slection"]
108pub struct FFE_DEBUG_SEL_FFE0_W<'a> {
109    w: &'a mut W,
110}
111impl<'a> FFE_DEBUG_SEL_FFE0_W<'a> {
112    #[doc = r"Writes raw bits to the field"]
113    #[inline(always)]
114    pub unsafe fn bits(self, value: u8) -> &'a mut W {
115        self.w.bits =
116            (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16);
117        self.w
118    }
119}
120#[doc = "FFE_TOP_MS debug slection\n\nValue on reset: 0"]
121#[derive(Clone, Copy, Debug, PartialEq)]
122#[repr(u8)]
123pub enum FFE_TOP_DEBUG_SEL_A {
124    #[doc = "0: Select sm0"]
125    SM0 = 0,
126    #[doc = "1: Select sm1"]
127    SM1 = 1,
128    #[doc = "2: Select ffe0"]
129    FFE0 = 2,
130}
131impl From<FFE_TOP_DEBUG_SEL_A> for u8 {
132    #[inline(always)]
133    fn from(variant: FFE_TOP_DEBUG_SEL_A) -> Self {
134        variant as _
135    }
136}
137#[doc = "Field `FFE_TOP_DEBUG_SEL` reader - FFE_TOP_MS debug slection"]
138pub struct FFE_TOP_DEBUG_SEL_R(crate::FieldReader<u8, FFE_TOP_DEBUG_SEL_A>);
139impl FFE_TOP_DEBUG_SEL_R {
140    #[inline(always)]
141    pub(crate) fn new(bits: u8) -> Self {
142        FFE_TOP_DEBUG_SEL_R(crate::FieldReader::new(bits))
143    }
144    #[doc = r"Get enumerated values variant"]
145    #[inline(always)]
146    pub fn variant(&self) -> Option<FFE_TOP_DEBUG_SEL_A> {
147        match self.bits {
148            0 => Some(FFE_TOP_DEBUG_SEL_A::SM0),
149            1 => Some(FFE_TOP_DEBUG_SEL_A::SM1),
150            2 => Some(FFE_TOP_DEBUG_SEL_A::FFE0),
151            _ => None,
152        }
153    }
154    #[doc = "Checks if the value of the field is `SM0`"]
155    #[inline(always)]
156    pub fn is_sm0(&self) -> bool {
157        **self == FFE_TOP_DEBUG_SEL_A::SM0
158    }
159    #[doc = "Checks if the value of the field is `SM1`"]
160    #[inline(always)]
161    pub fn is_sm1(&self) -> bool {
162        **self == FFE_TOP_DEBUG_SEL_A::SM1
163    }
164    #[doc = "Checks if the value of the field is `FFE0`"]
165    #[inline(always)]
166    pub fn is_ffe0(&self) -> bool {
167        **self == FFE_TOP_DEBUG_SEL_A::FFE0
168    }
169}
170impl core::ops::Deref for FFE_TOP_DEBUG_SEL_R {
171    type Target = crate::FieldReader<u8, FFE_TOP_DEBUG_SEL_A>;
172    #[inline(always)]
173    fn deref(&self) -> &Self::Target {
174        &self.0
175    }
176}
177#[doc = "Field `FFE_TOP_DEBUG_SEL` writer - FFE_TOP_MS debug slection"]
178pub struct FFE_TOP_DEBUG_SEL_W<'a> {
179    w: &'a mut W,
180}
181impl<'a> FFE_TOP_DEBUG_SEL_W<'a> {
182    #[doc = r"Writes `variant` to the field"]
183    #[inline(always)]
184    pub fn variant(self, variant: FFE_TOP_DEBUG_SEL_A) -> &'a mut W {
185        unsafe { self.bits(variant.into()) }
186    }
187    #[doc = "Select sm0"]
188    #[inline(always)]
189    pub fn sm0(self) -> &'a mut W {
190        self.variant(FFE_TOP_DEBUG_SEL_A::SM0)
191    }
192    #[doc = "Select sm1"]
193    #[inline(always)]
194    pub fn sm1(self) -> &'a mut W {
195        self.variant(FFE_TOP_DEBUG_SEL_A::SM1)
196    }
197    #[doc = "Select ffe0"]
198    #[inline(always)]
199    pub fn ffe0(self) -> &'a mut W {
200        self.variant(FFE_TOP_DEBUG_SEL_A::FFE0)
201    }
202    #[doc = r"Writes raw bits to the field"]
203    #[inline(always)]
204    pub unsafe fn bits(self, value: u8) -> &'a mut W {
205        self.w.bits =
206            (self.w.bits & !(0x03 << 24)) | ((value as u32 & 0x03) << 24);
207        self.w
208    }
209}
210impl R {
211    #[doc = "Bits 0:7 - SM0 LS debug slection"]
212    #[inline(always)]
213    pub fn ffe_debug_sel_sm0(&self) -> FFE_DEBUG_SEL_SM0_R {
214        FFE_DEBUG_SEL_SM0_R::new((self.bits & 0xff) as u8)
215    }
216    #[doc = "Bits 8:15 - SM1 LS debug slection"]
217    #[inline(always)]
218    pub fn ffe_debug_sel_sm1(&self) -> FFE_DEBUG_SEL_SM1_R {
219        FFE_DEBUG_SEL_SM1_R::new(((self.bits >> 8) & 0xff) as u8)
220    }
221    #[doc = "Bits 16:23 - FFE0 LS debug slection"]
222    #[inline(always)]
223    pub fn ffe_debug_sel_ffe0(&self) -> FFE_DEBUG_SEL_FFE0_R {
224        FFE_DEBUG_SEL_FFE0_R::new(((self.bits >> 16) & 0xff) as u8)
225    }
226    #[doc = "Bits 24:25 - FFE_TOP_MS debug slection"]
227    #[inline(always)]
228    pub fn ffe_top_debug_sel(&self) -> FFE_TOP_DEBUG_SEL_R {
229        FFE_TOP_DEBUG_SEL_R::new(((self.bits >> 24) & 0x03) as u8)
230    }
231}
232impl W {
233    #[doc = "Bits 0:7 - SM0 LS debug slection"]
234    #[inline(always)]
235    pub fn ffe_debug_sel_sm0(&mut self) -> FFE_DEBUG_SEL_SM0_W {
236        FFE_DEBUG_SEL_SM0_W { w: self }
237    }
238    #[doc = "Bits 8:15 - SM1 LS debug slection"]
239    #[inline(always)]
240    pub fn ffe_debug_sel_sm1(&mut self) -> FFE_DEBUG_SEL_SM1_W {
241        FFE_DEBUG_SEL_SM1_W { w: self }
242    }
243    #[doc = "Bits 16:23 - FFE0 LS debug slection"]
244    #[inline(always)]
245    pub fn ffe_debug_sel_ffe0(&mut self) -> FFE_DEBUG_SEL_FFE0_W {
246        FFE_DEBUG_SEL_FFE0_W { w: self }
247    }
248    #[doc = "Bits 24:25 - FFE_TOP_MS debug slection"]
249    #[inline(always)]
250    pub fn ffe_top_debug_sel(&mut self) -> FFE_TOP_DEBUG_SEL_W {
251        FFE_TOP_DEBUG_SEL_W { w: self }
252    }
253    #[doc = "Writes raw bits to the register."]
254    #[inline(always)]
255    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
256        self.0.bits(bits);
257        self
258    }
259}
260#[doc = "Debug Selection\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 [ffe_debug_sel](index.html) module"]
261pub struct FFE_DEBUG_SEL_SPEC;
262impl crate::RegisterSpec for FFE_DEBUG_SEL_SPEC {
263    type Ux = u32;
264}
265#[doc = "`read()` method returns [ffe_debug_sel::R](R) reader structure"]
266impl crate::Readable for FFE_DEBUG_SEL_SPEC {
267    type Reader = R;
268}
269#[doc = "`write(|w| ..)` method takes [ffe_debug_sel::W](W) writer structure"]
270impl crate::Writable for FFE_DEBUG_SEL_SPEC {
271    type Writer = W;
272}
273#[doc = "`reset()` method sets FFE_DEBUG_SEL to value 0"]
274impl crate::Resettable for FFE_DEBUG_SEL_SPEC {
275    #[inline(always)]
276    fn reset_value() -> Self::Ux {
277        0
278    }
279}