1#[doc = "Register `SCAPABILITIES2` reader"]
2pub type R = crate::R<Scapabilities2Spec>;
3#[doc = "Field `MAPCNT` reader - Map Count"]
4pub type MapcntR = crate::FieldReader;
5#[doc = "I2C 10-bit Address\n\nValue on reset: 0"]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum I2c10b {
9 #[doc = "0: Not supported"]
10 Disable = 0,
11 #[doc = "1: Supported"]
12 Enable = 1,
13}
14impl From<I2c10b> for bool {
15 #[inline(always)]
16 fn from(variant: I2c10b) -> Self {
17 variant as u8 != 0
18 }
19}
20#[doc = "Field `I2C10B` reader - I2C 10-bit Address"]
21pub type I2c10bR = crate::BitReader<I2c10b>;
22impl I2c10bR {
23 #[doc = "Get enumerated values variant"]
24 #[inline(always)]
25 pub const fn variant(&self) -> I2c10b {
26 match self.bits {
27 false => I2c10b::Disable,
28 true => I2c10b::Enable,
29 }
30 }
31 #[doc = "Not supported"]
32 #[inline(always)]
33 pub fn is_disable(&self) -> bool {
34 *self == I2c10b::Disable
35 }
36 #[doc = "Supported"]
37 #[inline(always)]
38 pub fn is_enable(&self) -> bool {
39 *self == I2c10b::Enable
40 }
41}
42#[doc = "I2C Device ID\n\nValue on reset: 0"]
43#[cfg_attr(feature = "defmt", derive(defmt::Format))]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum I2cdevid {
46 #[doc = "0: Not supported"]
47 Disable = 0,
48 #[doc = "1: Supported"]
49 Enable = 1,
50}
51impl From<I2cdevid> for bool {
52 #[inline(always)]
53 fn from(variant: I2cdevid) -> Self {
54 variant as u8 != 0
55 }
56}
57#[doc = "Field `I2CDEVID` reader - I2C Device ID"]
58pub type I2cdevidR = crate::BitReader<I2cdevid>;
59impl I2cdevidR {
60 #[doc = "Get enumerated values variant"]
61 #[inline(always)]
62 pub const fn variant(&self) -> I2cdevid {
63 match self.bits {
64 false => I2cdevid::Disable,
65 true => I2cdevid::Enable,
66 }
67 }
68 #[doc = "Not supported"]
69 #[inline(always)]
70 pub fn is_disable(&self) -> bool {
71 *self == I2cdevid::Disable
72 }
73 #[doc = "Supported"]
74 #[inline(always)]
75 pub fn is_enable(&self) -> bool {
76 *self == I2cdevid::Enable
77 }
78}
79#[doc = "In-Band Interrupt EXTDATA\n\nValue on reset: 1"]
80#[cfg_attr(feature = "defmt", derive(defmt::Format))]
81#[derive(Clone, Copy, Debug, PartialEq, Eq)]
82pub enum Ibiext {
83 #[doc = "0: Not supported"]
84 Disable = 0,
85 #[doc = "1: Supported"]
86 Enable = 1,
87}
88impl From<Ibiext> for bool {
89 #[inline(always)]
90 fn from(variant: Ibiext) -> Self {
91 variant as u8 != 0
92 }
93}
94#[doc = "Field `IBIEXT` reader - In-Band Interrupt EXTDATA"]
95pub type IbiextR = crate::BitReader<Ibiext>;
96impl IbiextR {
97 #[doc = "Get enumerated values variant"]
98 #[inline(always)]
99 pub const fn variant(&self) -> Ibiext {
100 match self.bits {
101 false => Ibiext::Disable,
102 true => Ibiext::Enable,
103 }
104 }
105 #[doc = "Not supported"]
106 #[inline(always)]
107 pub fn is_disable(&self) -> bool {
108 *self == Ibiext::Disable
109 }
110 #[doc = "Supported"]
111 #[inline(always)]
112 pub fn is_enable(&self) -> bool {
113 *self == Ibiext::Enable
114 }
115}
116#[doc = "In-Band Interrupt Extended Register\n\nValue on reset: 1"]
117#[cfg_attr(feature = "defmt", derive(defmt::Format))]
118#[derive(Clone, Copy, Debug, PartialEq, Eq)]
119pub enum Ibixreg {
120 #[doc = "0: Not supported"]
121 Disable = 0,
122 #[doc = "1: Supported"]
123 Enable = 1,
124}
125impl From<Ibixreg> for bool {
126 #[inline(always)]
127 fn from(variant: Ibixreg) -> Self {
128 variant as u8 != 0
129 }
130}
131#[doc = "Field `IBIXREG` reader - In-Band Interrupt Extended Register"]
132pub type IbixregR = crate::BitReader<Ibixreg>;
133impl IbixregR {
134 #[doc = "Get enumerated values variant"]
135 #[inline(always)]
136 pub const fn variant(&self) -> Ibixreg {
137 match self.bits {
138 false => Ibixreg::Disable,
139 true => Ibixreg::Enable,
140 }
141 }
142 #[doc = "Not supported"]
143 #[inline(always)]
144 pub fn is_disable(&self) -> bool {
145 *self == Ibixreg::Disable
146 }
147 #[doc = "Supported"]
148 #[inline(always)]
149 pub fn is_enable(&self) -> bool {
150 *self == Ibixreg::Enable
151 }
152}
153#[doc = "Target Reset\n\nValue on reset: 0"]
154#[cfg_attr(feature = "defmt", derive(defmt::Format))]
155#[derive(Clone, Copy, Debug, PartialEq, Eq)]
156pub enum Slvrst {
157 #[doc = "0: Not supported"]
158 Disable = 0,
159 #[doc = "1: Supported"]
160 Enable = 1,
161}
162impl From<Slvrst> for bool {
163 #[inline(always)]
164 fn from(variant: Slvrst) -> Self {
165 variant as u8 != 0
166 }
167}
168#[doc = "Field `SLVRST` reader - Target Reset"]
169pub type SlvrstR = crate::BitReader<Slvrst>;
170impl SlvrstR {
171 #[doc = "Get enumerated values variant"]
172 #[inline(always)]
173 pub const fn variant(&self) -> Slvrst {
174 match self.bits {
175 false => Slvrst::Disable,
176 true => Slvrst::Enable,
177 }
178 }
179 #[doc = "Not supported"]
180 #[inline(always)]
181 pub fn is_disable(&self) -> bool {
182 *self == Slvrst::Disable
183 }
184 #[doc = "Supported"]
185 #[inline(always)]
186 pub fn is_enable(&self) -> bool {
187 *self == Slvrst::Enable
188 }
189}
190#[doc = "Group\n\nValue on reset: 0"]
191#[cfg_attr(feature = "defmt", derive(defmt::Format))]
192#[derive(Clone, Copy, Debug, PartialEq, Eq)]
193#[repr(u8)]
194pub enum Group {
195 #[doc = "0: v1.1 group addressing not supported"]
196 Notsupported = 0,
197 #[doc = "1: One group supported"]
198 One = 1,
199 #[doc = "2: Two groups supported"]
200 Two = 2,
201 #[doc = "3: Three groups supported"]
202 Three = 3,
203}
204impl From<Group> for u8 {
205 #[inline(always)]
206 fn from(variant: Group) -> Self {
207 variant as _
208 }
209}
210impl crate::FieldSpec for Group {
211 type Ux = u8;
212}
213impl crate::IsEnum for Group {}
214#[doc = "Field `GROUP` reader - Group"]
215pub type GroupR = crate::FieldReader<Group>;
216impl GroupR {
217 #[doc = "Get enumerated values variant"]
218 #[inline(always)]
219 pub const fn variant(&self) -> Group {
220 match self.bits {
221 0 => Group::Notsupported,
222 1 => Group::One,
223 2 => Group::Two,
224 3 => Group::Three,
225 _ => unreachable!(),
226 }
227 }
228 #[doc = "v1.1 group addressing not supported"]
229 #[inline(always)]
230 pub fn is_notsupported(&self) -> bool {
231 *self == Group::Notsupported
232 }
233 #[doc = "One group supported"]
234 #[inline(always)]
235 pub fn is_one(&self) -> bool {
236 *self == Group::One
237 }
238 #[doc = "Two groups supported"]
239 #[inline(always)]
240 pub fn is_two(&self) -> bool {
241 *self == Group::Two
242 }
243 #[doc = "Three groups supported"]
244 #[inline(always)]
245 pub fn is_three(&self) -> bool {
246 *self == Group::Three
247 }
248}
249#[doc = "SETAASA\n\nValue on reset: 0"]
250#[cfg_attr(feature = "defmt", derive(defmt::Format))]
251#[derive(Clone, Copy, Debug, PartialEq, Eq)]
252pub enum Aasa {
253 #[doc = "0: SETAASA not supported"]
254 Notsupported = 0,
255 #[doc = "1: SETAASA supported"]
256 Supported = 1,
257}
258impl From<Aasa> for bool {
259 #[inline(always)]
260 fn from(variant: Aasa) -> Self {
261 variant as u8 != 0
262 }
263}
264#[doc = "Field `AASA` reader - SETAASA"]
265pub type AasaR = crate::BitReader<Aasa>;
266impl AasaR {
267 #[doc = "Get enumerated values variant"]
268 #[inline(always)]
269 pub const fn variant(&self) -> Aasa {
270 match self.bits {
271 false => Aasa::Notsupported,
272 true => Aasa::Supported,
273 }
274 }
275 #[doc = "SETAASA not supported"]
276 #[inline(always)]
277 pub fn is_notsupported(&self) -> bool {
278 *self == Aasa::Notsupported
279 }
280 #[doc = "SETAASA supported"]
281 #[inline(always)]
282 pub fn is_supported(&self) -> bool {
283 *self == Aasa::Supported
284 }
285}
286#[doc = "Target-Target(s)-Tunnel Subscriber Capable\n\nValue on reset: 0"]
287#[cfg_attr(feature = "defmt", derive(defmt::Format))]
288#[derive(Clone, Copy, Debug, PartialEq, Eq)]
289pub enum Sstsub {
290 #[doc = "0: Not subscriber capable"]
291 Notsupported = 0,
292 #[doc = "1: Subscriber capable"]
293 Supported = 1,
294}
295impl From<Sstsub> for bool {
296 #[inline(always)]
297 fn from(variant: Sstsub) -> Self {
298 variant as u8 != 0
299 }
300}
301#[doc = "Field `SSTSUB` reader - Target-Target(s)-Tunnel Subscriber Capable"]
302pub type SstsubR = crate::BitReader<Sstsub>;
303impl SstsubR {
304 #[doc = "Get enumerated values variant"]
305 #[inline(always)]
306 pub const fn variant(&self) -> Sstsub {
307 match self.bits {
308 false => Sstsub::Notsupported,
309 true => Sstsub::Supported,
310 }
311 }
312 #[doc = "Not subscriber capable"]
313 #[inline(always)]
314 pub fn is_notsupported(&self) -> bool {
315 *self == Sstsub::Notsupported
316 }
317 #[doc = "Subscriber capable"]
318 #[inline(always)]
319 pub fn is_supported(&self) -> bool {
320 *self == Sstsub::Supported
321 }
322}
323#[doc = "Target-Target(s)-Tunnel Write Capable\n\nValue on reset: 0"]
324#[cfg_attr(feature = "defmt", derive(defmt::Format))]
325#[derive(Clone, Copy, Debug, PartialEq, Eq)]
326pub enum Sstwr {
327 #[doc = "0: Not write capable"]
328 Notsupported = 0,
329 #[doc = "1: Write capable"]
330 Supported = 1,
331}
332impl From<Sstwr> for bool {
333 #[inline(always)]
334 fn from(variant: Sstwr) -> Self {
335 variant as u8 != 0
336 }
337}
338#[doc = "Field `SSTWR` reader - Target-Target(s)-Tunnel Write Capable"]
339pub type SstwrR = crate::BitReader<Sstwr>;
340impl SstwrR {
341 #[doc = "Get enumerated values variant"]
342 #[inline(always)]
343 pub const fn variant(&self) -> Sstwr {
344 match self.bits {
345 false => Sstwr::Notsupported,
346 true => Sstwr::Supported,
347 }
348 }
349 #[doc = "Not write capable"]
350 #[inline(always)]
351 pub fn is_notsupported(&self) -> bool {
352 *self == Sstwr::Notsupported
353 }
354 #[doc = "Write capable"]
355 #[inline(always)]
356 pub fn is_supported(&self) -> bool {
357 *self == Sstwr::Supported
358 }
359}
360impl R {
361 #[doc = "Bits 0:3 - Map Count"]
362 #[inline(always)]
363 pub fn mapcnt(&self) -> MapcntR {
364 MapcntR::new((self.bits & 0x0f) as u8)
365 }
366 #[doc = "Bit 4 - I2C 10-bit Address"]
367 #[inline(always)]
368 pub fn i2c10b(&self) -> I2c10bR {
369 I2c10bR::new(((self.bits >> 4) & 1) != 0)
370 }
371 #[doc = "Bit 6 - I2C Device ID"]
372 #[inline(always)]
373 pub fn i2cdevid(&self) -> I2cdevidR {
374 I2cdevidR::new(((self.bits >> 6) & 1) != 0)
375 }
376 #[doc = "Bit 8 - In-Band Interrupt EXTDATA"]
377 #[inline(always)]
378 pub fn ibiext(&self) -> IbiextR {
379 IbiextR::new(((self.bits >> 8) & 1) != 0)
380 }
381 #[doc = "Bit 9 - In-Band Interrupt Extended Register"]
382 #[inline(always)]
383 pub fn ibixreg(&self) -> IbixregR {
384 IbixregR::new(((self.bits >> 9) & 1) != 0)
385 }
386 #[doc = "Bit 17 - Target Reset"]
387 #[inline(always)]
388 pub fn slvrst(&self) -> SlvrstR {
389 SlvrstR::new(((self.bits >> 17) & 1) != 0)
390 }
391 #[doc = "Bits 18:19 - Group"]
392 #[inline(always)]
393 pub fn group(&self) -> GroupR {
394 GroupR::new(((self.bits >> 18) & 3) as u8)
395 }
396 #[doc = "Bit 21 - SETAASA"]
397 #[inline(always)]
398 pub fn aasa(&self) -> AasaR {
399 AasaR::new(((self.bits >> 21) & 1) != 0)
400 }
401 #[doc = "Bit 22 - Target-Target(s)-Tunnel Subscriber Capable"]
402 #[inline(always)]
403 pub fn sstsub(&self) -> SstsubR {
404 SstsubR::new(((self.bits >> 22) & 1) != 0)
405 }
406 #[doc = "Bit 23 - Target-Target(s)-Tunnel Write Capable"]
407 #[inline(always)]
408 pub fn sstwr(&self) -> SstwrR {
409 SstwrR::new(((self.bits >> 23) & 1) != 0)
410 }
411}
412#[cfg(feature = "debug")]
413impl core::fmt::Debug for R {
414 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
415 f.debug_struct("SCAPABILITIES2")
416 .field("mapcnt", &self.mapcnt())
417 .field("i2c10b", &self.i2c10b())
418 .field("i2cdevid", &self.i2cdevid())
419 .field("ibiext", &self.ibiext())
420 .field("ibixreg", &self.ibixreg())
421 .field("slvrst", &self.slvrst())
422 .field("group", &self.group())
423 .field("aasa", &self.aasa())
424 .field("sstsub", &self.sstsub())
425 .field("sstwr", &self.sstwr())
426 .finish()
427 }
428}
429#[doc = "Target Capabilities 2\n\nYou can [`read`](crate::Reg::read) this register and get [`scapabilities2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
430pub struct Scapabilities2Spec;
431impl crate::RegisterSpec for Scapabilities2Spec {
432 type Ux = u32;
433}
434#[doc = "`read()` method returns [`scapabilities2::R`](R) reader structure"]
435impl crate::Readable for Scapabilities2Spec {}
436#[doc = "`reset()` method sets SCAPABILITIES2 to value 0x0300"]
437impl crate::Resettable for Scapabilities2Spec {
438 const RESET_VALUE: u32 = 0x0300;
439}