stm32l4/stm32l4x5/flash/wrp2br.rs
1///Register `WRP2BR` reader
2pub type R = crate::R<WRP2BRrs>;
3///Register `WRP2BR` writer
4pub type W = crate::W<WRP2BRrs>;
5///Field `WRP2B_STRT` reader - Bank 2 WRP second area B start offset
6pub type WRP2B_STRT_R = crate::FieldReader;
7///Field `WRP2B_STRT` writer - Bank 2 WRP second area B start offset
8pub type WRP2B_STRT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9///Field `WRP2B_END` reader - Bank 2 WRP second area B end offset
10pub type WRP2B_END_R = crate::FieldReader;
11///Field `WRP2B_END` writer - Bank 2 WRP second area B end offset
12pub type WRP2B_END_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13impl R {
14 ///Bits 0:7 - Bank 2 WRP second area B start offset
15 #[inline(always)]
16 pub fn wrp2b_strt(&self) -> WRP2B_STRT_R {
17 WRP2B_STRT_R::new((self.bits & 0xff) as u8)
18 }
19 ///Bits 16:23 - Bank 2 WRP second area B end offset
20 #[inline(always)]
21 pub fn wrp2b_end(&self) -> WRP2B_END_R {
22 WRP2B_END_R::new(((self.bits >> 16) & 0xff) as u8)
23 }
24}
25impl core::fmt::Debug for R {
26 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27 f.debug_struct("WRP2BR")
28 .field("wrp2b_strt", &self.wrp2b_strt())
29 .field("wrp2b_end", &self.wrp2b_end())
30 .finish()
31 }
32}
33impl W {
34 ///Bits 0:7 - Bank 2 WRP second area B start offset
35 #[inline(always)]
36 pub fn wrp2b_strt(&mut self) -> WRP2B_STRT_W<WRP2BRrs> {
37 WRP2B_STRT_W::new(self, 0)
38 }
39 ///Bits 16:23 - Bank 2 WRP second area B end offset
40 #[inline(always)]
41 pub fn wrp2b_end(&mut self) -> WRP2B_END_W<WRP2BRrs> {
42 WRP2B_END_W::new(self, 16)
43 }
44}
45/**Flash Bank 2 WRP area B address register
46
47You can [`read`](crate::Reg::read) this register and get [`wrp2br::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wrp2br::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
48
49See register [structure](https://stm32-rs.github.io/stm32-rs/STM32L4x5.html#FLASH:WRP2BR)*/
50pub struct WRP2BRrs;
51impl crate::RegisterSpec for WRP2BRrs {
52 type Ux = u32;
53}
54///`read()` method returns [`wrp2br::R`](R) reader structure
55impl crate::Readable for WRP2BRrs {}
56///`write(|w| ..)` method takes [`wrp2br::W`](W) writer structure
57impl crate::Writable for WRP2BRrs {
58 type Safety = crate::Unsafe;
59}
60///`reset()` method sets WRP2BR to value 0xff00_ff00
61impl crate::Resettable for WRP2BRrs {
62 const RESET_VALUE: u32 = 0xff00_ff00;
63}