stm32wb_pac/flash/
pcrop1aer.rs1#[doc = "Reader of register PCROP1AER"]
2pub type R = crate::R<u32, super::PCROP1AER>;
3#[doc = "Writer for register PCROP1AER"]
4pub type W = crate::W<u32, super::PCROP1AER>;
5#[doc = "Register PCROP1AER `reset()`'s with value 0x7fff_fe00"]
6impl crate::ResetValue for super::PCROP1AER {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0x7fff_fe00
11 }
12}
13#[doc = "Reader of field `PCROP1A_END`"]
14pub type PCROP1A_END_R = crate::R<u16, u16>;
15#[doc = "Write proxy for field `PCROP1A_END`"]
16pub struct PCROP1A_END_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> PCROP1A_END_W<'a> {
20 #[doc = r"Writes raw bits to the field"]
21 #[inline(always)]
22 pub unsafe fn bits(self, value: u16) -> &'a mut W {
23 self.w.bits = (self.w.bits & !0x01ff) | ((value as u32) & 0x01ff);
24 self.w
25 }
26}
27#[doc = "Reader of field `PCROP_RDP`"]
28pub type PCROP_RDP_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `PCROP_RDP`"]
30pub struct PCROP_RDP_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> PCROP_RDP_W<'a> {
34 #[doc = r"Sets the field bit"]
35 #[inline(always)]
36 pub fn set_bit(self) -> &'a mut W {
37 self.bit(true)
38 }
39 #[doc = r"Clears the field bit"]
40 #[inline(always)]
41 pub fn clear_bit(self) -> &'a mut W {
42 self.bit(false)
43 }
44 #[doc = r"Writes raw bits to the field"]
45 #[inline(always)]
46 pub fn bit(self, value: bool) -> &'a mut W {
47 self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
48 self.w
49 }
50}
51impl R {
52 #[doc = "Bits 0:8 - Bank 1 PCROP area end offset"]
53 #[inline(always)]
54 pub fn pcrop1a_end(&self) -> PCROP1A_END_R {
55 PCROP1A_END_R::new((self.bits & 0x01ff) as u16)
56 }
57 #[doc = "Bit 31 - PCROP area preserved when RDP level decreased"]
58 #[inline(always)]
59 pub fn pcrop_rdp(&self) -> PCROP_RDP_R {
60 PCROP_RDP_R::new(((self.bits >> 31) & 0x01) != 0)
61 }
62}
63impl W {
64 #[doc = "Bits 0:8 - Bank 1 PCROP area end offset"]
65 #[inline(always)]
66 pub fn pcrop1a_end(&mut self) -> PCROP1A_END_W {
67 PCROP1A_END_W { w: self }
68 }
69 #[doc = "Bit 31 - PCROP area preserved when RDP level decreased"]
70 #[inline(always)]
71 pub fn pcrop_rdp(&mut self) -> PCROP_RDP_W {
72 PCROP_RDP_W { w: self }
73 }
74}