ra2e2/i3c/
datbas.rs

1#[doc = "Register `DATBAS%s` reader"]
2pub struct R(crate::R<DATBAS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DATBAS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DATBAS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DATBAS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `DATBAS%s` writer"]
17pub struct W(crate::W<DATBAS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<DATBAS_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<DATBAS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<DATBAS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DVSTAD` reader - Device Static Address"]
38pub type DVSTAD_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `DVSTAD` writer - Device Static Address"]
40pub type DVSTAD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DATBAS_SPEC, u8, u8, 7, O>;
41#[doc = "Field `DVIBIPL` reader - Device IBI Payload"]
42pub type DVIBIPL_R = crate::BitReader<DVIBIPL_A>;
43#[doc = "Device IBI Payload\n\nValue on reset: 0"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum DVIBIPL_A {
46    #[doc = "0: IBIs from this Device do not carry a Data Payload."]
47    _0 = 0,
48    #[doc = "1: IBIs from this Device do carry a Data Payload."]
49    _1 = 1,
50}
51impl From<DVIBIPL_A> for bool {
52    #[inline(always)]
53    fn from(variant: DVIBIPL_A) -> Self {
54        variant as u8 != 0
55    }
56}
57impl DVIBIPL_R {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> DVIBIPL_A {
61        match self.bits {
62            false => DVIBIPL_A::_0,
63            true => DVIBIPL_A::_1,
64        }
65    }
66    #[doc = "Checks if the value of the field is `_0`"]
67    #[inline(always)]
68    pub fn is_0(&self) -> bool {
69        *self == DVIBIPL_A::_0
70    }
71    #[doc = "Checks if the value of the field is `_1`"]
72    #[inline(always)]
73    pub fn is_1(&self) -> bool {
74        *self == DVIBIPL_A::_1
75    }
76}
77#[doc = "Field `DVIBIPL` writer - Device IBI Payload"]
78pub type DVIBIPL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DATBAS_SPEC, DVIBIPL_A, O>;
79impl<'a, const O: u8> DVIBIPL_W<'a, O> {
80    #[doc = "IBIs from this Device do not carry a Data Payload."]
81    #[inline(always)]
82    pub fn _0(self) -> &'a mut W {
83        self.variant(DVIBIPL_A::_0)
84    }
85    #[doc = "IBIs from this Device do carry a Data Payload."]
86    #[inline(always)]
87    pub fn _1(self) -> &'a mut W {
88        self.variant(DVIBIPL_A::_1)
89    }
90}
91#[doc = "Field `DVSIRRJ` reader - Device In-Band Slave Interrupt Request Reject"]
92pub type DVSIRRJ_R = crate::BitReader<DVSIRRJ_A>;
93#[doc = "Device In-Band Slave Interrupt Request Reject\n\nValue on reset: 0"]
94#[derive(Clone, Copy, Debug, PartialEq, Eq)]
95pub enum DVSIRRJ_A {
96    #[doc = "0: This Device shall ACK the SIR."]
97    _0 = 0,
98    #[doc = "1: This Device shall NACK the SIR and send the auto-disable CCC."]
99    _1 = 1,
100}
101impl From<DVSIRRJ_A> for bool {
102    #[inline(always)]
103    fn from(variant: DVSIRRJ_A) -> Self {
104        variant as u8 != 0
105    }
106}
107impl DVSIRRJ_R {
108    #[doc = "Get enumerated values variant"]
109    #[inline(always)]
110    pub fn variant(&self) -> DVSIRRJ_A {
111        match self.bits {
112            false => DVSIRRJ_A::_0,
113            true => DVSIRRJ_A::_1,
114        }
115    }
116    #[doc = "Checks if the value of the field is `_0`"]
117    #[inline(always)]
118    pub fn is_0(&self) -> bool {
119        *self == DVSIRRJ_A::_0
120    }
121    #[doc = "Checks if the value of the field is `_1`"]
122    #[inline(always)]
123    pub fn is_1(&self) -> bool {
124        *self == DVSIRRJ_A::_1
125    }
126}
127#[doc = "Field `DVSIRRJ` writer - Device In-Band Slave Interrupt Request Reject"]
128pub type DVSIRRJ_W<'a, const O: u8> = crate::BitWriter<'a, u32, DATBAS_SPEC, DVSIRRJ_A, O>;
129impl<'a, const O: u8> DVSIRRJ_W<'a, O> {
130    #[doc = "This Device shall ACK the SIR."]
131    #[inline(always)]
132    pub fn _0(self) -> &'a mut W {
133        self.variant(DVSIRRJ_A::_0)
134    }
135    #[doc = "This Device shall NACK the SIR and send the auto-disable CCC."]
136    #[inline(always)]
137    pub fn _1(self) -> &'a mut W {
138        self.variant(DVSIRRJ_A::_1)
139    }
140}
141#[doc = "Field `DVMRRJ` reader - Device In-Band Master Request Reject"]
142pub type DVMRRJ_R = crate::BitReader<DVMRRJ_A>;
143#[doc = "Device In-Band Master Request Reject\n\nValue on reset: 0"]
144#[derive(Clone, Copy, Debug, PartialEq, Eq)]
145pub enum DVMRRJ_A {
146    #[doc = "0: This Device shall ACK Master Requests."]
147    _0 = 0,
148    #[doc = "1: This Device shall NACK Master Requests and send the auto-disable command."]
149    _1 = 1,
150}
151impl From<DVMRRJ_A> for bool {
152    #[inline(always)]
153    fn from(variant: DVMRRJ_A) -> Self {
154        variant as u8 != 0
155    }
156}
157impl DVMRRJ_R {
158    #[doc = "Get enumerated values variant"]
159    #[inline(always)]
160    pub fn variant(&self) -> DVMRRJ_A {
161        match self.bits {
162            false => DVMRRJ_A::_0,
163            true => DVMRRJ_A::_1,
164        }
165    }
166    #[doc = "Checks if the value of the field is `_0`"]
167    #[inline(always)]
168    pub fn is_0(&self) -> bool {
169        *self == DVMRRJ_A::_0
170    }
171    #[doc = "Checks if the value of the field is `_1`"]
172    #[inline(always)]
173    pub fn is_1(&self) -> bool {
174        *self == DVMRRJ_A::_1
175    }
176}
177#[doc = "Field `DVMRRJ` writer - Device In-Band Master Request Reject"]
178pub type DVMRRJ_W<'a, const O: u8> = crate::BitWriter<'a, u32, DATBAS_SPEC, DVMRRJ_A, O>;
179impl<'a, const O: u8> DVMRRJ_W<'a, O> {
180    #[doc = "This Device shall ACK Master Requests."]
181    #[inline(always)]
182    pub fn _0(self) -> &'a mut W {
183        self.variant(DVMRRJ_A::_0)
184    }
185    #[doc = "This Device shall NACK Master Requests and send the auto-disable command."]
186    #[inline(always)]
187    pub fn _1(self) -> &'a mut W {
188        self.variant(DVMRRJ_A::_1)
189    }
190}
191#[doc = "Field `DVIBITS` reader - Device IBI Time-stamp"]
192pub type DVIBITS_R = crate::BitReader<DVIBITS_A>;
193#[doc = "Device IBI Time-stamp\n\nValue on reset: 0"]
194#[derive(Clone, Copy, Debug, PartialEq, Eq)]
195pub enum DVIBITS_A {
196    #[doc = "0: The Master shall not time-stamp IBIs from this Device with Master Time-stamps."]
197    _0 = 0,
198    #[doc = "1: The Master shall time-stamp IBIs for this Device with Master Time-stamps."]
199    _1 = 1,
200}
201impl From<DVIBITS_A> for bool {
202    #[inline(always)]
203    fn from(variant: DVIBITS_A) -> Self {
204        variant as u8 != 0
205    }
206}
207impl DVIBITS_R {
208    #[doc = "Get enumerated values variant"]
209    #[inline(always)]
210    pub fn variant(&self) -> DVIBITS_A {
211        match self.bits {
212            false => DVIBITS_A::_0,
213            true => DVIBITS_A::_1,
214        }
215    }
216    #[doc = "Checks if the value of the field is `_0`"]
217    #[inline(always)]
218    pub fn is_0(&self) -> bool {
219        *self == DVIBITS_A::_0
220    }
221    #[doc = "Checks if the value of the field is `_1`"]
222    #[inline(always)]
223    pub fn is_1(&self) -> bool {
224        *self == DVIBITS_A::_1
225    }
226}
227#[doc = "Field `DVIBITS` writer - Device IBI Time-stamp"]
228pub type DVIBITS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DATBAS_SPEC, DVIBITS_A, O>;
229impl<'a, const O: u8> DVIBITS_W<'a, O> {
230    #[doc = "The Master shall not time-stamp IBIs from this Device with Master Time-stamps."]
231    #[inline(always)]
232    pub fn _0(self) -> &'a mut W {
233        self.variant(DVIBITS_A::_0)
234    }
235    #[doc = "The Master shall time-stamp IBIs for this Device with Master Time-stamps."]
236    #[inline(always)]
237    pub fn _1(self) -> &'a mut W {
238        self.variant(DVIBITS_A::_1)
239    }
240}
241#[doc = "Field `DVDYAD` reader - Device I3C Dynamic Address"]
242pub type DVDYAD_R = crate::FieldReader<u8, u8>;
243#[doc = "Field `DVDYAD` writer - Device I3C Dynamic Address"]
244pub type DVDYAD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DATBAS_SPEC, u8, u8, 8, O>;
245#[doc = "Field `DVNACK` reader - Device NACK Retry Count"]
246pub type DVNACK_R = crate::FieldReader<u8, u8>;
247#[doc = "Field `DVNACK` writer - Device NACK Retry Count"]
248pub type DVNACK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DATBAS_SPEC, u8, u8, 2, O>;
249#[doc = "Field `DVTYP` reader - Device Type"]
250pub type DVTYP_R = crate::BitReader<DVTYP_A>;
251#[doc = "Device Type\n\nValue on reset: 0"]
252#[derive(Clone, Copy, Debug, PartialEq, Eq)]
253pub enum DVTYP_A {
254    #[doc = "0: I3C Device"]
255    _0 = 0,
256    #[doc = "1: I2C Device"]
257    _1 = 1,
258}
259impl From<DVTYP_A> for bool {
260    #[inline(always)]
261    fn from(variant: DVTYP_A) -> Self {
262        variant as u8 != 0
263    }
264}
265impl DVTYP_R {
266    #[doc = "Get enumerated values variant"]
267    #[inline(always)]
268    pub fn variant(&self) -> DVTYP_A {
269        match self.bits {
270            false => DVTYP_A::_0,
271            true => DVTYP_A::_1,
272        }
273    }
274    #[doc = "Checks if the value of the field is `_0`"]
275    #[inline(always)]
276    pub fn is_0(&self) -> bool {
277        *self == DVTYP_A::_0
278    }
279    #[doc = "Checks if the value of the field is `_1`"]
280    #[inline(always)]
281    pub fn is_1(&self) -> bool {
282        *self == DVTYP_A::_1
283    }
284}
285#[doc = "Field `DVTYP` writer - Device Type"]
286pub type DVTYP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DATBAS_SPEC, DVTYP_A, O>;
287impl<'a, const O: u8> DVTYP_W<'a, O> {
288    #[doc = "I3C Device"]
289    #[inline(always)]
290    pub fn _0(self) -> &'a mut W {
291        self.variant(DVTYP_A::_0)
292    }
293    #[doc = "I2C Device"]
294    #[inline(always)]
295    pub fn _1(self) -> &'a mut W {
296        self.variant(DVTYP_A::_1)
297    }
298}
299impl R {
300    #[doc = "Bits 0:6 - Device Static Address"]
301    #[inline(always)]
302    pub fn dvstad(&self) -> DVSTAD_R {
303        DVSTAD_R::new((self.bits & 0x7f) as u8)
304    }
305    #[doc = "Bit 12 - Device IBI Payload"]
306    #[inline(always)]
307    pub fn dvibipl(&self) -> DVIBIPL_R {
308        DVIBIPL_R::new(((self.bits >> 12) & 1) != 0)
309    }
310    #[doc = "Bit 13 - Device In-Band Slave Interrupt Request Reject"]
311    #[inline(always)]
312    pub fn dvsirrj(&self) -> DVSIRRJ_R {
313        DVSIRRJ_R::new(((self.bits >> 13) & 1) != 0)
314    }
315    #[doc = "Bit 14 - Device In-Band Master Request Reject"]
316    #[inline(always)]
317    pub fn dvmrrj(&self) -> DVMRRJ_R {
318        DVMRRJ_R::new(((self.bits >> 14) & 1) != 0)
319    }
320    #[doc = "Bit 15 - Device IBI Time-stamp"]
321    #[inline(always)]
322    pub fn dvibits(&self) -> DVIBITS_R {
323        DVIBITS_R::new(((self.bits >> 15) & 1) != 0)
324    }
325    #[doc = "Bits 16:23 - Device I3C Dynamic Address"]
326    #[inline(always)]
327    pub fn dvdyad(&self) -> DVDYAD_R {
328        DVDYAD_R::new(((self.bits >> 16) & 0xff) as u8)
329    }
330    #[doc = "Bits 29:30 - Device NACK Retry Count"]
331    #[inline(always)]
332    pub fn dvnack(&self) -> DVNACK_R {
333        DVNACK_R::new(((self.bits >> 29) & 3) as u8)
334    }
335    #[doc = "Bit 31 - Device Type"]
336    #[inline(always)]
337    pub fn dvtyp(&self) -> DVTYP_R {
338        DVTYP_R::new(((self.bits >> 31) & 1) != 0)
339    }
340}
341impl W {
342    #[doc = "Bits 0:6 - Device Static Address"]
343    #[inline(always)]
344    #[must_use]
345    pub fn dvstad(&mut self) -> DVSTAD_W<0> {
346        DVSTAD_W::new(self)
347    }
348    #[doc = "Bit 12 - Device IBI Payload"]
349    #[inline(always)]
350    #[must_use]
351    pub fn dvibipl(&mut self) -> DVIBIPL_W<12> {
352        DVIBIPL_W::new(self)
353    }
354    #[doc = "Bit 13 - Device In-Band Slave Interrupt Request Reject"]
355    #[inline(always)]
356    #[must_use]
357    pub fn dvsirrj(&mut self) -> DVSIRRJ_W<13> {
358        DVSIRRJ_W::new(self)
359    }
360    #[doc = "Bit 14 - Device In-Band Master Request Reject"]
361    #[inline(always)]
362    #[must_use]
363    pub fn dvmrrj(&mut self) -> DVMRRJ_W<14> {
364        DVMRRJ_W::new(self)
365    }
366    #[doc = "Bit 15 - Device IBI Time-stamp"]
367    #[inline(always)]
368    #[must_use]
369    pub fn dvibits(&mut self) -> DVIBITS_W<15> {
370        DVIBITS_W::new(self)
371    }
372    #[doc = "Bits 16:23 - Device I3C Dynamic Address"]
373    #[inline(always)]
374    #[must_use]
375    pub fn dvdyad(&mut self) -> DVDYAD_W<16> {
376        DVDYAD_W::new(self)
377    }
378    #[doc = "Bits 29:30 - Device NACK Retry Count"]
379    #[inline(always)]
380    #[must_use]
381    pub fn dvnack(&mut self) -> DVNACK_W<29> {
382        DVNACK_W::new(self)
383    }
384    #[doc = "Bit 31 - Device Type"]
385    #[inline(always)]
386    #[must_use]
387    pub fn dvtyp(&mut self) -> DVTYP_W<31> {
388        DVTYP_W::new(self)
389    }
390    #[doc = "Writes raw bits to the register."]
391    #[inline(always)]
392    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
393        self.0.bits(bits);
394        self
395    }
396}
397#[doc = "Device Address Table Basic Register %s\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 [datbas](index.html) module"]
398pub struct DATBAS_SPEC;
399impl crate::RegisterSpec for DATBAS_SPEC {
400    type Ux = u32;
401}
402#[doc = "`read()` method returns [datbas::R](R) reader structure"]
403impl crate::Readable for DATBAS_SPEC {
404    type Reader = R;
405}
406#[doc = "`write(|w| ..)` method takes [datbas::W](W) writer structure"]
407impl crate::Writable for DATBAS_SPEC {
408    type Writer = W;
409    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
410    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
411}
412#[doc = "`reset()` method sets DATBAS%s to value 0"]
413impl crate::Resettable for DATBAS_SPEC {
414    const RESET_VALUE: Self::Ux = 0;
415}