nrf5340_app_pac/ficr_s/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 - 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: 4294967295"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u32)]
21pub enum VARIANT_A {
22    #[doc = "1363886401: QKAA"]
23    QKAA = 1363886401,
24    #[doc = "4294967295: Unspecified"]
25    UNSPECIFIED = 4294967295,
26}
27impl From<VARIANT_A> for u32 {
28    #[inline(always)]
29    fn from(variant: VARIANT_A) -> Self {
30        variant as _
31    }
32}
33impl VARIANT_R {
34    #[doc = "Get enumerated values variant"]
35    #[inline(always)]
36    pub fn variant(&self) -> Option<VARIANT_A> {
37        match self.bits {
38            1363886401 => Some(VARIANT_A::QKAA),
39            4294967295 => Some(VARIANT_A::UNSPECIFIED),
40            _ => None,
41        }
42    }
43    #[doc = "Checks if the value of the field is `QKAA`"]
44    #[inline(always)]
45    pub fn is_qkaa(&self) -> bool {
46        *self == VARIANT_A::QKAA
47    }
48    #[doc = "Checks if the value of the field is `UNSPECIFIED`"]
49    #[inline(always)]
50    pub fn is_unspecified(&self) -> bool {
51        *self == VARIANT_A::UNSPECIFIED
52    }
53}
54impl R {
55    #[doc = "Bits 0:31 - Part Variant, Hardware version and Production configuration, encoded as ASCII"]
56    #[inline(always)]
57    pub fn variant(&self) -> VARIANT_R {
58        VARIANT_R::new(self.bits)
59    }
60}
61#[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"]
62pub struct VARIANT_SPEC;
63impl crate::RegisterSpec for VARIANT_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [variant::R](R) reader structure"]
67impl crate::Readable for VARIANT_SPEC {
68    type Reader = R;
69}
70#[doc = "`reset()` method sets VARIANT to value 0xffff_ffff"]
71impl crate::Resettable for VARIANT_SPEC {
72    #[inline(always)]
73    fn reset_value() -> Self::Ux {
74        0xffff_ffff
75    }
76}