stm32l4/stm32l4x1/flash/
sr.rs

1///Register `SR` reader
2pub type R = crate::R<SRrs>;
3///Register `SR` writer
4pub type W = crate::W<SRrs>;
5///Field `EOP` reader - End of operation
6pub type EOP_R = crate::BitReader;
7///Field `EOP` writer - End of operation
8pub type EOP_W<'a, REG> = crate::BitWriter<'a, REG>;
9///Field `OPERR` reader - Operation error
10pub type OPERR_R = crate::BitReader;
11///Field `OPERR` writer - Operation error
12pub type OPERR_W<'a, REG> = crate::BitWriter<'a, REG>;
13///Field `PROGERR` reader - Programming error
14pub type PROGERR_R = crate::BitReader;
15///Field `PROGERR` writer - Programming error
16pub type PROGERR_W<'a, REG> = crate::BitWriter<'a, REG>;
17///Field `WRPERR` reader - Write protected error
18pub type WRPERR_R = crate::BitReader;
19///Field `WRPERR` writer - Write protected error
20pub type WRPERR_W<'a, REG> = crate::BitWriter<'a, REG>;
21///Field `PGAERR` reader - Programming alignment error
22pub type PGAERR_R = crate::BitReader;
23///Field `PGAERR` writer - Programming alignment error
24pub type PGAERR_W<'a, REG> = crate::BitWriter<'a, REG>;
25///Field `SIZERR` reader - Size error
26pub type SIZERR_R = crate::BitReader;
27///Field `SIZERR` writer - Size error
28pub type SIZERR_W<'a, REG> = crate::BitWriter<'a, REG>;
29///Field `PGSERR` reader - Programming sequence error
30pub type PGSERR_R = crate::BitReader;
31///Field `PGSERR` writer - Programming sequence error
32pub type PGSERR_W<'a, REG> = crate::BitWriter<'a, REG>;
33///Field `MISERR` reader - Fast programming data miss error
34pub type MISERR_R = crate::BitReader;
35///Field `MISERR` writer - Fast programming data miss error
36pub type MISERR_W<'a, REG> = crate::BitWriter<'a, REG>;
37///Field `FASTERR` reader - Fast programming error
38pub type FASTERR_R = crate::BitReader;
39///Field `FASTERR` writer - Fast programming error
40pub type FASTERR_W<'a, REG> = crate::BitWriter<'a, REG>;
41///Field `RDERR` reader - PCROP read error
42pub type RDERR_R = crate::BitReader;
43///Field `RDERR` writer - PCROP read error
44pub type RDERR_W<'a, REG> = crate::BitWriter<'a, REG>;
45///Field `OPTVERR` reader - Option validity error
46pub type OPTVERR_R = crate::BitReader;
47///Field `OPTVERR` writer - Option validity error
48pub type OPTVERR_W<'a, REG> = crate::BitWriter<'a, REG>;
49///Field `BSY` reader - Busy
50pub type BSY_R = crate::BitReader;
51impl R {
52    ///Bit 0 - End of operation
53    #[inline(always)]
54    pub fn eop(&self) -> EOP_R {
55        EOP_R::new((self.bits & 1) != 0)
56    }
57    ///Bit 1 - Operation error
58    #[inline(always)]
59    pub fn operr(&self) -> OPERR_R {
60        OPERR_R::new(((self.bits >> 1) & 1) != 0)
61    }
62    ///Bit 3 - Programming error
63    #[inline(always)]
64    pub fn progerr(&self) -> PROGERR_R {
65        PROGERR_R::new(((self.bits >> 3) & 1) != 0)
66    }
67    ///Bit 4 - Write protected error
68    #[inline(always)]
69    pub fn wrperr(&self) -> WRPERR_R {
70        WRPERR_R::new(((self.bits >> 4) & 1) != 0)
71    }
72    ///Bit 5 - Programming alignment error
73    #[inline(always)]
74    pub fn pgaerr(&self) -> PGAERR_R {
75        PGAERR_R::new(((self.bits >> 5) & 1) != 0)
76    }
77    ///Bit 6 - Size error
78    #[inline(always)]
79    pub fn sizerr(&self) -> SIZERR_R {
80        SIZERR_R::new(((self.bits >> 6) & 1) != 0)
81    }
82    ///Bit 7 - Programming sequence error
83    #[inline(always)]
84    pub fn pgserr(&self) -> PGSERR_R {
85        PGSERR_R::new(((self.bits >> 7) & 1) != 0)
86    }
87    ///Bit 8 - Fast programming data miss error
88    #[inline(always)]
89    pub fn miserr(&self) -> MISERR_R {
90        MISERR_R::new(((self.bits >> 8) & 1) != 0)
91    }
92    ///Bit 9 - Fast programming error
93    #[inline(always)]
94    pub fn fasterr(&self) -> FASTERR_R {
95        FASTERR_R::new(((self.bits >> 9) & 1) != 0)
96    }
97    ///Bit 14 - PCROP read error
98    #[inline(always)]
99    pub fn rderr(&self) -> RDERR_R {
100        RDERR_R::new(((self.bits >> 14) & 1) != 0)
101    }
102    ///Bit 15 - Option validity error
103    #[inline(always)]
104    pub fn optverr(&self) -> OPTVERR_R {
105        OPTVERR_R::new(((self.bits >> 15) & 1) != 0)
106    }
107    ///Bit 16 - Busy
108    #[inline(always)]
109    pub fn bsy(&self) -> BSY_R {
110        BSY_R::new(((self.bits >> 16) & 1) != 0)
111    }
112}
113impl core::fmt::Debug for R {
114    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
115        f.debug_struct("SR")
116            .field("eop", &self.eop())
117            .field("operr", &self.operr())
118            .field("progerr", &self.progerr())
119            .field("wrperr", &self.wrperr())
120            .field("pgaerr", &self.pgaerr())
121            .field("sizerr", &self.sizerr())
122            .field("pgserr", &self.pgserr())
123            .field("miserr", &self.miserr())
124            .field("fasterr", &self.fasterr())
125            .field("rderr", &self.rderr())
126            .field("optverr", &self.optverr())
127            .field("bsy", &self.bsy())
128            .finish()
129    }
130}
131impl W {
132    ///Bit 0 - End of operation
133    #[inline(always)]
134    pub fn eop(&mut self) -> EOP_W<SRrs> {
135        EOP_W::new(self, 0)
136    }
137    ///Bit 1 - Operation error
138    #[inline(always)]
139    pub fn operr(&mut self) -> OPERR_W<SRrs> {
140        OPERR_W::new(self, 1)
141    }
142    ///Bit 3 - Programming error
143    #[inline(always)]
144    pub fn progerr(&mut self) -> PROGERR_W<SRrs> {
145        PROGERR_W::new(self, 3)
146    }
147    ///Bit 4 - Write protected error
148    #[inline(always)]
149    pub fn wrperr(&mut self) -> WRPERR_W<SRrs> {
150        WRPERR_W::new(self, 4)
151    }
152    ///Bit 5 - Programming alignment error
153    #[inline(always)]
154    pub fn pgaerr(&mut self) -> PGAERR_W<SRrs> {
155        PGAERR_W::new(self, 5)
156    }
157    ///Bit 6 - Size error
158    #[inline(always)]
159    pub fn sizerr(&mut self) -> SIZERR_W<SRrs> {
160        SIZERR_W::new(self, 6)
161    }
162    ///Bit 7 - Programming sequence error
163    #[inline(always)]
164    pub fn pgserr(&mut self) -> PGSERR_W<SRrs> {
165        PGSERR_W::new(self, 7)
166    }
167    ///Bit 8 - Fast programming data miss error
168    #[inline(always)]
169    pub fn miserr(&mut self) -> MISERR_W<SRrs> {
170        MISERR_W::new(self, 8)
171    }
172    ///Bit 9 - Fast programming error
173    #[inline(always)]
174    pub fn fasterr(&mut self) -> FASTERR_W<SRrs> {
175        FASTERR_W::new(self, 9)
176    }
177    ///Bit 14 - PCROP read error
178    #[inline(always)]
179    pub fn rderr(&mut self) -> RDERR_W<SRrs> {
180        RDERR_W::new(self, 14)
181    }
182    ///Bit 15 - Option validity error
183    #[inline(always)]
184    pub fn optverr(&mut self) -> OPTVERR_W<SRrs> {
185        OPTVERR_W::new(self, 15)
186    }
187}
188/**Status register
189
190You can [`read`](crate::Reg::read) this register and get [`sr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
191
192See register [structure](https://stm32-rs.github.io/stm32-rs/STM32L4x1.html#FLASH:SR)*/
193pub struct SRrs;
194impl crate::RegisterSpec for SRrs {
195    type Ux = u32;
196}
197///`read()` method returns [`sr::R`](R) reader structure
198impl crate::Readable for SRrs {}
199///`write(|w| ..)` method takes [`sr::W`](W) writer structure
200impl crate::Writable for SRrs {
201    type Safety = crate::Unsafe;
202}
203///`reset()` method sets SR to value 0
204impl crate::Resettable for SRrs {}