stm32f1_staging/stm32f103/flash/
obr.rs

1///Register `OBR` reader
2pub type R = crate::R<OBRrs>;
3///Field `OPTERR` reader - Option byte error
4pub type OPTERR_R = crate::BitReader;
5///Field `RDPRT` reader - Read protection
6pub type RDPRT_R = crate::BitReader;
7///Field `WDG_SW` reader - WDG_SW
8pub type WDG_SW_R = crate::BitReader;
9///Field `nRST_STOP` reader - nRST_STOP
10pub type N_RST_STOP_R = crate::BitReader;
11///Field `nRST_STDBY` reader - nRST_STDBY
12pub type N_RST_STDBY_R = crate::BitReader;
13///Field `Data0` reader - Data0
14pub type DATA0_R = crate::FieldReader;
15///Field `Data1` reader - Data1
16pub type DATA1_R = crate::FieldReader;
17impl R {
18    ///Bit 0 - Option byte error
19    #[inline(always)]
20    pub fn opterr(&self) -> OPTERR_R {
21        OPTERR_R::new((self.bits & 1) != 0)
22    }
23    ///Bit 1 - Read protection
24    #[inline(always)]
25    pub fn rdprt(&self) -> RDPRT_R {
26        RDPRT_R::new(((self.bits >> 1) & 1) != 0)
27    }
28    ///Bit 2 - WDG_SW
29    #[inline(always)]
30    pub fn wdg_sw(&self) -> WDG_SW_R {
31        WDG_SW_R::new(((self.bits >> 2) & 1) != 0)
32    }
33    ///Bit 3 - nRST_STOP
34    #[inline(always)]
35    pub fn n_rst_stop(&self) -> N_RST_STOP_R {
36        N_RST_STOP_R::new(((self.bits >> 3) & 1) != 0)
37    }
38    ///Bit 4 - nRST_STDBY
39    #[inline(always)]
40    pub fn n_rst_stdby(&self) -> N_RST_STDBY_R {
41        N_RST_STDBY_R::new(((self.bits >> 4) & 1) != 0)
42    }
43    ///Bits 10:17 - Data0
44    #[inline(always)]
45    pub fn data0(&self) -> DATA0_R {
46        DATA0_R::new(((self.bits >> 10) & 0xff) as u8)
47    }
48    ///Bits 18:25 - Data1
49    #[inline(always)]
50    pub fn data1(&self) -> DATA1_R {
51        DATA1_R::new(((self.bits >> 18) & 0xff) as u8)
52    }
53}
54impl core::fmt::Debug for R {
55    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
56        f.debug_struct("OBR")
57            .field("opterr", &self.opterr())
58            .field("rdprt", &self.rdprt())
59            .field("wdg_sw", &self.wdg_sw())
60            .field("n_rst_stop", &self.n_rst_stop())
61            .field("n_rst_stdby", &self.n_rst_stdby())
62            .field("data0", &self.data0())
63            .field("data1", &self.data1())
64            .finish()
65    }
66}
67/**Option byte register
68
69You can [`read`](crate::Reg::read) this register and get [`obr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
70
71See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F103.html#FLASH:OBR)*/
72pub struct OBRrs;
73impl crate::RegisterSpec for OBRrs {
74    type Ux = u32;
75}
76///`read()` method returns [`obr::R`](R) reader structure
77impl crate::Readable for OBRrs {}
78///`reset()` method sets OBR to value 0x03ff_fffc
79impl crate::Resettable for OBRrs {
80    const RESET_VALUE: u32 = 0x03ff_fffc;
81}