nrf52832_pac/ficr/info/
package.rs

1#[doc = "Register `PACKAGE` reader"]
2pub struct R(crate::R<PACKAGE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PACKAGE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PACKAGE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PACKAGE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `PACKAGE` reader - Package option"]
17pub type PACKAGE_R = crate::FieldReader<u32, PACKAGE_A>;
18#[doc = "Package option\n\nValue on reset: 8192"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u32)]
21pub enum PACKAGE_A {
22    #[doc = "8192: QFxx - 48-pin QFN"]
23    QF = 8192,
24    #[doc = "8193: CHxx - 7x8 WLCSP 56 balls"]
25    CH = 8193,
26    #[doc = "8194: CIxx - 7x8 WLCSP 56 balls"]
27    CI = 8194,
28    #[doc = "8197: CKxx - 7x8 WLCSP 56 balls with backside coating for light protection"]
29    CK = 8197,
30    #[doc = "4294967295: Unspecified"]
31    UNSPECIFIED = 4294967295,
32}
33impl From<PACKAGE_A> for u32 {
34    #[inline(always)]
35    fn from(variant: PACKAGE_A) -> Self {
36        variant as _
37    }
38}
39impl PACKAGE_R {
40    #[doc = "Get enumerated values variant"]
41    #[inline(always)]
42    pub fn variant(&self) -> Option<PACKAGE_A> {
43        match self.bits {
44            8192 => Some(PACKAGE_A::QF),
45            8193 => Some(PACKAGE_A::CH),
46            8194 => Some(PACKAGE_A::CI),
47            8197 => Some(PACKAGE_A::CK),
48            4294967295 => Some(PACKAGE_A::UNSPECIFIED),
49            _ => None,
50        }
51    }
52    #[doc = "Checks if the value of the field is `QF`"]
53    #[inline(always)]
54    pub fn is_qf(&self) -> bool {
55        *self == PACKAGE_A::QF
56    }
57    #[doc = "Checks if the value of the field is `CH`"]
58    #[inline(always)]
59    pub fn is_ch(&self) -> bool {
60        *self == PACKAGE_A::CH
61    }
62    #[doc = "Checks if the value of the field is `CI`"]
63    #[inline(always)]
64    pub fn is_ci(&self) -> bool {
65        *self == PACKAGE_A::CI
66    }
67    #[doc = "Checks if the value of the field is `CK`"]
68    #[inline(always)]
69    pub fn is_ck(&self) -> bool {
70        *self == PACKAGE_A::CK
71    }
72    #[doc = "Checks if the value of the field is `UNSPECIFIED`"]
73    #[inline(always)]
74    pub fn is_unspecified(&self) -> bool {
75        *self == PACKAGE_A::UNSPECIFIED
76    }
77}
78impl R {
79    #[doc = "Bits 0:31 - Package option"]
80    #[inline(always)]
81    pub fn package(&self) -> PACKAGE_R {
82        PACKAGE_R::new(self.bits)
83    }
84}
85#[doc = "Package option\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 [package](index.html) module"]
86pub struct PACKAGE_SPEC;
87impl crate::RegisterSpec for PACKAGE_SPEC {
88    type Ux = u32;
89}
90#[doc = "`read()` method returns [package::R](R) reader structure"]
91impl crate::Readable for PACKAGE_SPEC {
92    type Reader = R;
93}
94#[doc = "`reset()` method sets PACKAGE to value 0x2000"]
95impl crate::Resettable for PACKAGE_SPEC {
96    #[inline(always)]
97    fn reset_value() -> Self::Ux {
98        0x2000
99    }
100}