nrf52832_pac/ficr/info/
variant.rs1#[doc = "Register `VARIANT` reader"]
2pub struct R(crate::R<VARIANT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<VARIANT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<VARIANT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<VARIANT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `VARIANT` reader - Part Variant, Hardware version and Production configuration, encoded as ASCII"]
17pub type VARIANT_R = crate::FieldReader<u32, VARIANT_A>;
18#[doc = "Part Variant, Hardware version and Production configuration, encoded as ASCII\n\nValue on reset: 1094795586"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u32)]
21pub enum VARIANT_A {
22 #[doc = "1094795585: AAAA"]
23 AAAA = 1094795585,
24 #[doc = "1094795586: AAAB"]
25 AAAB = 1094795586,
26 #[doc = "1094795841: AABA"]
27 AABA = 1094795841,
28 #[doc = "1094795842: AABB"]
29 AABB = 1094795842,
30 #[doc = "1094795824: AAB0"]
31 AAB0 = 1094795824,
32 #[doc = "1094796592: AAE0"]
33 AAE0 = 1094796592,
34 #[doc = "4294967295: Unspecified"]
35 UNSPECIFIED = 4294967295,
36}
37impl From<VARIANT_A> for u32 {
38 #[inline(always)]
39 fn from(variant: VARIANT_A) -> Self {
40 variant as _
41 }
42}
43impl VARIANT_R {
44 #[doc = "Get enumerated values variant"]
45 #[inline(always)]
46 pub fn variant(&self) -> Option<VARIANT_A> {
47 match self.bits {
48 1094795585 => Some(VARIANT_A::AAAA),
49 1094795586 => Some(VARIANT_A::AAAB),
50 1094795841 => Some(VARIANT_A::AABA),
51 1094795842 => Some(VARIANT_A::AABB),
52 1094795824 => Some(VARIANT_A::AAB0),
53 1094796592 => Some(VARIANT_A::AAE0),
54 4294967295 => Some(VARIANT_A::UNSPECIFIED),
55 _ => None,
56 }
57 }
58 #[doc = "Checks if the value of the field is `AAAA`"]
59 #[inline(always)]
60 pub fn is_aaaa(&self) -> bool {
61 *self == VARIANT_A::AAAA
62 }
63 #[doc = "Checks if the value of the field is `AAAB`"]
64 #[inline(always)]
65 pub fn is_aaab(&self) -> bool {
66 *self == VARIANT_A::AAAB
67 }
68 #[doc = "Checks if the value of the field is `AABA`"]
69 #[inline(always)]
70 pub fn is_aaba(&self) -> bool {
71 *self == VARIANT_A::AABA
72 }
73 #[doc = "Checks if the value of the field is `AABB`"]
74 #[inline(always)]
75 pub fn is_aabb(&self) -> bool {
76 *self == VARIANT_A::AABB
77 }
78 #[doc = "Checks if the value of the field is `AAB0`"]
79 #[inline(always)]
80 pub fn is_aab0(&self) -> bool {
81 *self == VARIANT_A::AAB0
82 }
83 #[doc = "Checks if the value of the field is `AAE0`"]
84 #[inline(always)]
85 pub fn is_aae0(&self) -> bool {
86 *self == VARIANT_A::AAE0
87 }
88 #[doc = "Checks if the value of the field is `UNSPECIFIED`"]
89 #[inline(always)]
90 pub fn is_unspecified(&self) -> bool {
91 *self == VARIANT_A::UNSPECIFIED
92 }
93}
94impl R {
95 #[doc = "Bits 0:31 - Part Variant, Hardware version and Production configuration, encoded as ASCII"]
96 #[inline(always)]
97 pub fn variant(&self) -> VARIANT_R {
98 VARIANT_R::new(self.bits)
99 }
100}
101#[doc = "Part Variant, Hardware version and Production configuration\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [variant](index.html) module"]
102pub struct VARIANT_SPEC;
103impl crate::RegisterSpec for VARIANT_SPEC {
104 type Ux = u32;
105}
106#[doc = "`read()` method returns [variant::R](R) reader structure"]
107impl crate::Readable for VARIANT_SPEC {
108 type Reader = R;
109}
110#[doc = "`reset()` method sets VARIANT to value 0x4141_4142"]
111impl crate::Resettable for VARIANT_SPEC {
112 #[inline(always)]
113 fn reset_value() -> Self::Ux {
114 0x4141_4142
115 }
116}