lpc55s6x_pac/flash_key_store/
sbkey_header1.rs1#[doc = "Reader of register SBKEY_HEADER1"]
2pub type R = crate::R<u32, super::SBKEY_HEADER1>;
3#[doc = "Writer for register SBKEY_HEADER1"]
4pub type W = crate::W<u32, super::SBKEY_HEADER1>;
5#[doc = "Register SBKEY_HEADER1 `reset()`'s with value 0"]
6impl crate::ResetValue for super::SBKEY_HEADER1 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `TYPE`"]
14pub type TYPE_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `TYPE`"]
16pub struct TYPE_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> TYPE_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u8) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
24        self.w
25    }
26}
27#[doc = "Reader of field `INDEX`"]
28pub type INDEX_R = crate::R<u8, u8>;
29#[doc = "Write proxy for field `INDEX`"]
30pub struct INDEX_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> INDEX_W<'a> {
34    #[doc = r"Writes raw bits to the field"]
35    #[inline(always)]
36    pub unsafe fn bits(self, value: u8) -> &'a mut W {
37        self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u32) & 0x0f) << 8);
38        self.w
39    }
40}
41#[doc = "Reader of field `SIZE`"]
42pub type SIZE_R = crate::R<u8, u8>;
43#[doc = "Write proxy for field `SIZE`"]
44pub struct SIZE_W<'a> {
45    w: &'a mut W,
46}
47impl<'a> SIZE_W<'a> {
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub unsafe fn bits(self, value: u8) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x3f << 24)) | (((value as u32) & 0x3f) << 24);
52        self.w
53    }
54}
55impl R {
56    #[doc = "Bits 0:1 - ."]
57    #[inline(always)]
58    pub fn type_(&self) -> TYPE_R {
59        TYPE_R::new((self.bits & 0x03) as u8)
60    }
61    #[doc = "Bits 8:11 - ."]
62    #[inline(always)]
63    pub fn index(&self) -> INDEX_R {
64        INDEX_R::new(((self.bits >> 8) & 0x0f) as u8)
65    }
66    #[doc = "Bits 24:29 - ."]
67    #[inline(always)]
68    pub fn size(&self) -> SIZE_R {
69        SIZE_R::new(((self.bits >> 24) & 0x3f) as u8)
70    }
71}
72impl W {
73    #[doc = "Bits 0:1 - ."]
74    #[inline(always)]
75    pub fn type_(&mut self) -> TYPE_W {
76        TYPE_W { w: self }
77    }
78    #[doc = "Bits 8:11 - ."]
79    #[inline(always)]
80    pub fn index(&mut self) -> INDEX_W {
81        INDEX_W { w: self }
82    }
83    #[doc = "Bits 24:29 - ."]
84    #[inline(always)]
85    pub fn size(&mut self) -> SIZE_W {
86        SIZE_W { w: self }
87    }
88}