nrf5340_app_pac/ficr_s/info/
codesize.rs1#[doc = "Register `CODESIZE` reader"]
2pub struct R(crate::R<CODESIZE_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CODESIZE_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CODESIZE_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CODESIZE_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `CODESIZE` reader - Code memory size in number of pages"]
17pub type CODESIZE_R = crate::FieldReader<u32, CODESIZE_A>;
18#[doc = "Code memory size in number of pages\n\nValue on reset: 256"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u32)]
21pub enum CODESIZE_A {
22 #[doc = "256: 256 pages"]
23 P256 = 256,
24}
25impl From<CODESIZE_A> for u32 {
26 #[inline(always)]
27 fn from(variant: CODESIZE_A) -> Self {
28 variant as _
29 }
30}
31impl CODESIZE_R {
32 #[doc = "Get enumerated values variant"]
33 #[inline(always)]
34 pub fn variant(&self) -> Option<CODESIZE_A> {
35 match self.bits {
36 256 => Some(CODESIZE_A::P256),
37 _ => None,
38 }
39 }
40 #[doc = "Checks if the value of the field is `P256`"]
41 #[inline(always)]
42 pub fn is_p256(&self) -> bool {
43 *self == CODESIZE_A::P256
44 }
45}
46impl R {
47 #[doc = "Bits 0:31 - Code memory size in number of pages"]
48 #[inline(always)]
49 pub fn codesize(&self) -> CODESIZE_R {
50 CODESIZE_R::new(self.bits)
51 }
52}
53#[doc = "Code memory size\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 [codesize](index.html) module"]
54pub struct CODESIZE_SPEC;
55impl crate::RegisterSpec for CODESIZE_SPEC {
56 type Ux = u32;
57}
58#[doc = "`read()` method returns [codesize::R](R) reader structure"]
59impl crate::Readable for CODESIZE_SPEC {
60 type Reader = R;
61}
62#[doc = "`reset()` method sets CODESIZE to value 0x0100"]
63impl crate::Resettable for CODESIZE_SPEC {
64 #[inline(always)]
65 fn reset_value() -> Self::Ux {
66 0x0100
67 }
68}