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