nrf52840_pac/ficr/info/
variant.rs
1#[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 - Build code (hardware version and production configuration). Encoded as ASCII."]
17pub type VARIANT_R = crate::FieldReader<u32, VARIANT_A>;
18#[doc = "Build code (hardware version and production configuration). Encoded as ASCII.\n\nValue on reset: 4294967295"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u32)]
21pub enum VARIANT_A {
22 #[doc = "1094795585: AAAA"]
23 AAAA = 1094795585,
24 #[doc = "1111572801: BAAA"]
25 BAAA = 1111572801,
26 #[doc = "1128350017: CAAA"]
27 CAAA = 1128350017,
28 #[doc = "1094795841: AABA"]
29 AABA = 1094795841,
30 #[doc = "1094795842: AABB"]
31 AABB = 1094795842,
32 #[doc = "1094796097: AACA"]
33 AACA = 1094796097,
34 #[doc = "1094795586: AAAB"]
35 AAAB = 1094795586,
36 #[doc = "4294967295: Unspecified"]
37 UNSPECIFIED = 4294967295,
38}
39impl From<VARIANT_A> for u32 {
40 #[inline(always)]
41 fn from(variant: VARIANT_A) -> Self {
42 variant as _
43 }
44}
45impl VARIANT_R {
46 #[doc = "Get enumerated values variant"]
47 #[inline(always)]
48 pub fn variant(&self) -> Option<VARIANT_A> {
49 match self.bits {
50 1094795585 => Some(VARIANT_A::AAAA),
51 1111572801 => Some(VARIANT_A::BAAA),
52 1128350017 => Some(VARIANT_A::CAAA),
53 1094795841 => Some(VARIANT_A::AABA),
54 1094795842 => Some(VARIANT_A::AABB),
55 1094796097 => Some(VARIANT_A::AACA),
56 1094795586 => Some(VARIANT_A::AAAB),
57 4294967295 => Some(VARIANT_A::UNSPECIFIED),
58 _ => None,
59 }
60 }
61 #[doc = "Checks if the value of the field is `AAAA`"]
62 #[inline(always)]
63 pub fn is_aaaa(&self) -> bool {
64 *self == VARIANT_A::AAAA
65 }
66 #[doc = "Checks if the value of the field is `BAAA`"]
67 #[inline(always)]
68 pub fn is_baaa(&self) -> bool {
69 *self == VARIANT_A::BAAA
70 }
71 #[doc = "Checks if the value of the field is `CAAA`"]
72 #[inline(always)]
73 pub fn is_caaa(&self) -> bool {
74 *self == VARIANT_A::CAAA
75 }
76 #[doc = "Checks if the value of the field is `AABA`"]
77 #[inline(always)]
78 pub fn is_aaba(&self) -> bool {
79 *self == VARIANT_A::AABA
80 }
81 #[doc = "Checks if the value of the field is `AABB`"]
82 #[inline(always)]
83 pub fn is_aabb(&self) -> bool {
84 *self == VARIANT_A::AABB
85 }
86 #[doc = "Checks if the value of the field is `AACA`"]
87 #[inline(always)]
88 pub fn is_aaca(&self) -> bool {
89 *self == VARIANT_A::AACA
90 }
91 #[doc = "Checks if the value of the field is `AAAB`"]
92 #[inline(always)]
93 pub fn is_aaab(&self) -> bool {
94 *self == VARIANT_A::AAAB
95 }
96 #[doc = "Checks if the value of the field is `UNSPECIFIED`"]
97 #[inline(always)]
98 pub fn is_unspecified(&self) -> bool {
99 *self == VARIANT_A::UNSPECIFIED
100 }
101}
102impl R {
103 #[doc = "Bits 0:31 - Build code (hardware version and production configuration). Encoded as ASCII."]
104 #[inline(always)]
105 pub fn variant(&self) -> VARIANT_R {
106 VARIANT_R::new(self.bits)
107 }
108}
109#[doc = "Build code (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"]
110pub struct VARIANT_SPEC;
111impl crate::RegisterSpec for VARIANT_SPEC {
112 type Ux = u32;
113}
114#[doc = "`read()` method returns [variant::R](R) reader structure"]
115impl crate::Readable for VARIANT_SPEC {
116 type Reader = R;
117}
118#[doc = "`reset()` method sets VARIANT to value 0xffff_ffff"]
119impl crate::Resettable for VARIANT_SPEC {
120 #[inline(always)]
121 fn reset_value() -> Self::Ux {
122 0xffff_ffff
123 }
124}