atsam4s8c_pac/pmc/
pmc_fsmr.rs

1#[doc = "Register `PMC_FSMR` reader"]
2pub struct R(crate::R<PMC_FSMR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PMC_FSMR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PMC_FSMR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PMC_FSMR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PMC_FSMR` writer"]
17pub struct W(crate::W<PMC_FSMR_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PMC_FSMR_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<PMC_FSMR_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PMC_FSMR_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `FSTT0` reader - Fast Start-up Input Enable 0"]
38pub type FSTT0_R = crate::BitReader<bool>;
39#[doc = "Field `FSTT0` writer - Fast Start-up Input Enable 0"]
40pub type FSTT0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
41#[doc = "Field `FSTT1` reader - Fast Start-up Input Enable 1"]
42pub type FSTT1_R = crate::BitReader<bool>;
43#[doc = "Field `FSTT1` writer - Fast Start-up Input Enable 1"]
44pub type FSTT1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
45#[doc = "Field `FSTT2` reader - Fast Start-up Input Enable 2"]
46pub type FSTT2_R = crate::BitReader<bool>;
47#[doc = "Field `FSTT2` writer - Fast Start-up Input Enable 2"]
48pub type FSTT2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
49#[doc = "Field `FSTT3` reader - Fast Start-up Input Enable 3"]
50pub type FSTT3_R = crate::BitReader<bool>;
51#[doc = "Field `FSTT3` writer - Fast Start-up Input Enable 3"]
52pub type FSTT3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
53#[doc = "Field `FSTT4` reader - Fast Start-up Input Enable 4"]
54pub type FSTT4_R = crate::BitReader<bool>;
55#[doc = "Field `FSTT4` writer - Fast Start-up Input Enable 4"]
56pub type FSTT4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
57#[doc = "Field `FSTT5` reader - Fast Start-up Input Enable 5"]
58pub type FSTT5_R = crate::BitReader<bool>;
59#[doc = "Field `FSTT5` writer - Fast Start-up Input Enable 5"]
60pub type FSTT5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
61#[doc = "Field `FSTT6` reader - Fast Start-up Input Enable 6"]
62pub type FSTT6_R = crate::BitReader<bool>;
63#[doc = "Field `FSTT6` writer - Fast Start-up Input Enable 6"]
64pub type FSTT6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
65#[doc = "Field `FSTT7` reader - Fast Start-up Input Enable 7"]
66pub type FSTT7_R = crate::BitReader<bool>;
67#[doc = "Field `FSTT7` writer - Fast Start-up Input Enable 7"]
68pub type FSTT7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
69#[doc = "Field `FSTT8` reader - Fast Start-up Input Enable 8"]
70pub type FSTT8_R = crate::BitReader<bool>;
71#[doc = "Field `FSTT8` writer - Fast Start-up Input Enable 8"]
72pub type FSTT8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
73#[doc = "Field `FSTT9` reader - Fast Start-up Input Enable 9"]
74pub type FSTT9_R = crate::BitReader<bool>;
75#[doc = "Field `FSTT9` writer - Fast Start-up Input Enable 9"]
76pub type FSTT9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
77#[doc = "Field `FSTT10` reader - Fast Start-up Input Enable 10"]
78pub type FSTT10_R = crate::BitReader<bool>;
79#[doc = "Field `FSTT10` writer - Fast Start-up Input Enable 10"]
80pub type FSTT10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
81#[doc = "Field `FSTT11` reader - Fast Start-up Input Enable 11"]
82pub type FSTT11_R = crate::BitReader<bool>;
83#[doc = "Field `FSTT11` writer - Fast Start-up Input Enable 11"]
84pub type FSTT11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
85#[doc = "Field `FSTT12` reader - Fast Start-up Input Enable 12"]
86pub type FSTT12_R = crate::BitReader<bool>;
87#[doc = "Field `FSTT12` writer - Fast Start-up Input Enable 12"]
88pub type FSTT12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
89#[doc = "Field `FSTT13` reader - Fast Start-up Input Enable 13"]
90pub type FSTT13_R = crate::BitReader<bool>;
91#[doc = "Field `FSTT13` writer - Fast Start-up Input Enable 13"]
92pub type FSTT13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
93#[doc = "Field `FSTT14` reader - Fast Start-up Input Enable 14"]
94pub type FSTT14_R = crate::BitReader<bool>;
95#[doc = "Field `FSTT14` writer - Fast Start-up Input Enable 14"]
96pub type FSTT14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
97#[doc = "Field `FSTT15` reader - Fast Start-up Input Enable 15"]
98pub type FSTT15_R = crate::BitReader<bool>;
99#[doc = "Field `FSTT15` writer - Fast Start-up Input Enable 15"]
100pub type FSTT15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
101#[doc = "Field `RTTAL` reader - RTT Alarm Enable"]
102pub type RTTAL_R = crate::BitReader<bool>;
103#[doc = "Field `RTTAL` writer - RTT Alarm Enable"]
104pub type RTTAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
105#[doc = "Field `RTCAL` reader - RTC Alarm Enable"]
106pub type RTCAL_R = crate::BitReader<bool>;
107#[doc = "Field `RTCAL` writer - RTC Alarm Enable"]
108pub type RTCAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
109#[doc = "Field `USBAL` reader - USB Alarm Enable"]
110pub type USBAL_R = crate::BitReader<bool>;
111#[doc = "Field `USBAL` writer - USB Alarm Enable"]
112pub type USBAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
113#[doc = "Field `LPM` reader - Low-power Mode"]
114pub type LPM_R = crate::BitReader<bool>;
115#[doc = "Field `LPM` writer - Low-power Mode"]
116pub type LPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMC_FSMR_SPEC, bool, O>;
117#[doc = "Field `FLPM` reader - Flash Low-power Mode"]
118pub type FLPM_R = crate::FieldReader<u8, FLPM_A>;
119#[doc = "Flash Low-power Mode\n\nValue on reset: 0"]
120#[derive(Clone, Copy, Debug, PartialEq, Eq)]
121#[repr(u8)]
122pub enum FLPM_A {
123    #[doc = "0: Flash is in Standby Mode when system enters Wait Mode"]
124    FLASH_STANDBY = 0,
125    #[doc = "1: Flash is in deep-power-down mode when system enters Wait Mode"]
126    FLASH_DEEP_POWERDOWN = 1,
127    #[doc = "2: idle mode"]
128    FLASH_IDLE = 2,
129}
130impl From<FLPM_A> for u8 {
131    #[inline(always)]
132    fn from(variant: FLPM_A) -> Self {
133        variant as _
134    }
135}
136impl FLPM_R {
137    #[doc = "Get enumerated values variant"]
138    #[inline(always)]
139    pub fn variant(&self) -> Option<FLPM_A> {
140        match self.bits {
141            0 => Some(FLPM_A::FLASH_STANDBY),
142            1 => Some(FLPM_A::FLASH_DEEP_POWERDOWN),
143            2 => Some(FLPM_A::FLASH_IDLE),
144            _ => None,
145        }
146    }
147    #[doc = "Checks if the value of the field is `FLASH_STANDBY`"]
148    #[inline(always)]
149    pub fn is_flash_standby(&self) -> bool {
150        *self == FLPM_A::FLASH_STANDBY
151    }
152    #[doc = "Checks if the value of the field is `FLASH_DEEP_POWERDOWN`"]
153    #[inline(always)]
154    pub fn is_flash_deep_powerdown(&self) -> bool {
155        *self == FLPM_A::FLASH_DEEP_POWERDOWN
156    }
157    #[doc = "Checks if the value of the field is `FLASH_IDLE`"]
158    #[inline(always)]
159    pub fn is_flash_idle(&self) -> bool {
160        *self == FLPM_A::FLASH_IDLE
161    }
162}
163#[doc = "Field `FLPM` writer - Flash Low-power Mode"]
164pub type FLPM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PMC_FSMR_SPEC, u8, FLPM_A, 2, O>;
165impl<'a, const O: u8> FLPM_W<'a, O> {
166    #[doc = "Flash is in Standby Mode when system enters Wait Mode"]
167    #[inline(always)]
168    pub fn flash_standby(self) -> &'a mut W {
169        self.variant(FLPM_A::FLASH_STANDBY)
170    }
171    #[doc = "Flash is in deep-power-down mode when system enters Wait Mode"]
172    #[inline(always)]
173    pub fn flash_deep_powerdown(self) -> &'a mut W {
174        self.variant(FLPM_A::FLASH_DEEP_POWERDOWN)
175    }
176    #[doc = "idle mode"]
177    #[inline(always)]
178    pub fn flash_idle(self) -> &'a mut W {
179        self.variant(FLPM_A::FLASH_IDLE)
180    }
181}
182impl R {
183    #[doc = "Bit 0 - Fast Start-up Input Enable 0"]
184    #[inline(always)]
185    pub fn fstt0(&self) -> FSTT0_R {
186        FSTT0_R::new((self.bits & 1) != 0)
187    }
188    #[doc = "Bit 1 - Fast Start-up Input Enable 1"]
189    #[inline(always)]
190    pub fn fstt1(&self) -> FSTT1_R {
191        FSTT1_R::new(((self.bits >> 1) & 1) != 0)
192    }
193    #[doc = "Bit 2 - Fast Start-up Input Enable 2"]
194    #[inline(always)]
195    pub fn fstt2(&self) -> FSTT2_R {
196        FSTT2_R::new(((self.bits >> 2) & 1) != 0)
197    }
198    #[doc = "Bit 3 - Fast Start-up Input Enable 3"]
199    #[inline(always)]
200    pub fn fstt3(&self) -> FSTT3_R {
201        FSTT3_R::new(((self.bits >> 3) & 1) != 0)
202    }
203    #[doc = "Bit 4 - Fast Start-up Input Enable 4"]
204    #[inline(always)]
205    pub fn fstt4(&self) -> FSTT4_R {
206        FSTT4_R::new(((self.bits >> 4) & 1) != 0)
207    }
208    #[doc = "Bit 5 - Fast Start-up Input Enable 5"]
209    #[inline(always)]
210    pub fn fstt5(&self) -> FSTT5_R {
211        FSTT5_R::new(((self.bits >> 5) & 1) != 0)
212    }
213    #[doc = "Bit 6 - Fast Start-up Input Enable 6"]
214    #[inline(always)]
215    pub fn fstt6(&self) -> FSTT6_R {
216        FSTT6_R::new(((self.bits >> 6) & 1) != 0)
217    }
218    #[doc = "Bit 7 - Fast Start-up Input Enable 7"]
219    #[inline(always)]
220    pub fn fstt7(&self) -> FSTT7_R {
221        FSTT7_R::new(((self.bits >> 7) & 1) != 0)
222    }
223    #[doc = "Bit 8 - Fast Start-up Input Enable 8"]
224    #[inline(always)]
225    pub fn fstt8(&self) -> FSTT8_R {
226        FSTT8_R::new(((self.bits >> 8) & 1) != 0)
227    }
228    #[doc = "Bit 9 - Fast Start-up Input Enable 9"]
229    #[inline(always)]
230    pub fn fstt9(&self) -> FSTT9_R {
231        FSTT9_R::new(((self.bits >> 9) & 1) != 0)
232    }
233    #[doc = "Bit 10 - Fast Start-up Input Enable 10"]
234    #[inline(always)]
235    pub fn fstt10(&self) -> FSTT10_R {
236        FSTT10_R::new(((self.bits >> 10) & 1) != 0)
237    }
238    #[doc = "Bit 11 - Fast Start-up Input Enable 11"]
239    #[inline(always)]
240    pub fn fstt11(&self) -> FSTT11_R {
241        FSTT11_R::new(((self.bits >> 11) & 1) != 0)
242    }
243    #[doc = "Bit 12 - Fast Start-up Input Enable 12"]
244    #[inline(always)]
245    pub fn fstt12(&self) -> FSTT12_R {
246        FSTT12_R::new(((self.bits >> 12) & 1) != 0)
247    }
248    #[doc = "Bit 13 - Fast Start-up Input Enable 13"]
249    #[inline(always)]
250    pub fn fstt13(&self) -> FSTT13_R {
251        FSTT13_R::new(((self.bits >> 13) & 1) != 0)
252    }
253    #[doc = "Bit 14 - Fast Start-up Input Enable 14"]
254    #[inline(always)]
255    pub fn fstt14(&self) -> FSTT14_R {
256        FSTT14_R::new(((self.bits >> 14) & 1) != 0)
257    }
258    #[doc = "Bit 15 - Fast Start-up Input Enable 15"]
259    #[inline(always)]
260    pub fn fstt15(&self) -> FSTT15_R {
261        FSTT15_R::new(((self.bits >> 15) & 1) != 0)
262    }
263    #[doc = "Bit 16 - RTT Alarm Enable"]
264    #[inline(always)]
265    pub fn rttal(&self) -> RTTAL_R {
266        RTTAL_R::new(((self.bits >> 16) & 1) != 0)
267    }
268    #[doc = "Bit 17 - RTC Alarm Enable"]
269    #[inline(always)]
270    pub fn rtcal(&self) -> RTCAL_R {
271        RTCAL_R::new(((self.bits >> 17) & 1) != 0)
272    }
273    #[doc = "Bit 18 - USB Alarm Enable"]
274    #[inline(always)]
275    pub fn usbal(&self) -> USBAL_R {
276        USBAL_R::new(((self.bits >> 18) & 1) != 0)
277    }
278    #[doc = "Bit 20 - Low-power Mode"]
279    #[inline(always)]
280    pub fn lpm(&self) -> LPM_R {
281        LPM_R::new(((self.bits >> 20) & 1) != 0)
282    }
283    #[doc = "Bits 21:22 - Flash Low-power Mode"]
284    #[inline(always)]
285    pub fn flpm(&self) -> FLPM_R {
286        FLPM_R::new(((self.bits >> 21) & 3) as u8)
287    }
288}
289impl W {
290    #[doc = "Bit 0 - Fast Start-up Input Enable 0"]
291    #[inline(always)]
292    #[must_use]
293    pub fn fstt0(&mut self) -> FSTT0_W<0> {
294        FSTT0_W::new(self)
295    }
296    #[doc = "Bit 1 - Fast Start-up Input Enable 1"]
297    #[inline(always)]
298    #[must_use]
299    pub fn fstt1(&mut self) -> FSTT1_W<1> {
300        FSTT1_W::new(self)
301    }
302    #[doc = "Bit 2 - Fast Start-up Input Enable 2"]
303    #[inline(always)]
304    #[must_use]
305    pub fn fstt2(&mut self) -> FSTT2_W<2> {
306        FSTT2_W::new(self)
307    }
308    #[doc = "Bit 3 - Fast Start-up Input Enable 3"]
309    #[inline(always)]
310    #[must_use]
311    pub fn fstt3(&mut self) -> FSTT3_W<3> {
312        FSTT3_W::new(self)
313    }
314    #[doc = "Bit 4 - Fast Start-up Input Enable 4"]
315    #[inline(always)]
316    #[must_use]
317    pub fn fstt4(&mut self) -> FSTT4_W<4> {
318        FSTT4_W::new(self)
319    }
320    #[doc = "Bit 5 - Fast Start-up Input Enable 5"]
321    #[inline(always)]
322    #[must_use]
323    pub fn fstt5(&mut self) -> FSTT5_W<5> {
324        FSTT5_W::new(self)
325    }
326    #[doc = "Bit 6 - Fast Start-up Input Enable 6"]
327    #[inline(always)]
328    #[must_use]
329    pub fn fstt6(&mut self) -> FSTT6_W<6> {
330        FSTT6_W::new(self)
331    }
332    #[doc = "Bit 7 - Fast Start-up Input Enable 7"]
333    #[inline(always)]
334    #[must_use]
335    pub fn fstt7(&mut self) -> FSTT7_W<7> {
336        FSTT7_W::new(self)
337    }
338    #[doc = "Bit 8 - Fast Start-up Input Enable 8"]
339    #[inline(always)]
340    #[must_use]
341    pub fn fstt8(&mut self) -> FSTT8_W<8> {
342        FSTT8_W::new(self)
343    }
344    #[doc = "Bit 9 - Fast Start-up Input Enable 9"]
345    #[inline(always)]
346    #[must_use]
347    pub fn fstt9(&mut self) -> FSTT9_W<9> {
348        FSTT9_W::new(self)
349    }
350    #[doc = "Bit 10 - Fast Start-up Input Enable 10"]
351    #[inline(always)]
352    #[must_use]
353    pub fn fstt10(&mut self) -> FSTT10_W<10> {
354        FSTT10_W::new(self)
355    }
356    #[doc = "Bit 11 - Fast Start-up Input Enable 11"]
357    #[inline(always)]
358    #[must_use]
359    pub fn fstt11(&mut self) -> FSTT11_W<11> {
360        FSTT11_W::new(self)
361    }
362    #[doc = "Bit 12 - Fast Start-up Input Enable 12"]
363    #[inline(always)]
364    #[must_use]
365    pub fn fstt12(&mut self) -> FSTT12_W<12> {
366        FSTT12_W::new(self)
367    }
368    #[doc = "Bit 13 - Fast Start-up Input Enable 13"]
369    #[inline(always)]
370    #[must_use]
371    pub fn fstt13(&mut self) -> FSTT13_W<13> {
372        FSTT13_W::new(self)
373    }
374    #[doc = "Bit 14 - Fast Start-up Input Enable 14"]
375    #[inline(always)]
376    #[must_use]
377    pub fn fstt14(&mut self) -> FSTT14_W<14> {
378        FSTT14_W::new(self)
379    }
380    #[doc = "Bit 15 - Fast Start-up Input Enable 15"]
381    #[inline(always)]
382    #[must_use]
383    pub fn fstt15(&mut self) -> FSTT15_W<15> {
384        FSTT15_W::new(self)
385    }
386    #[doc = "Bit 16 - RTT Alarm Enable"]
387    #[inline(always)]
388    #[must_use]
389    pub fn rttal(&mut self) -> RTTAL_W<16> {
390        RTTAL_W::new(self)
391    }
392    #[doc = "Bit 17 - RTC Alarm Enable"]
393    #[inline(always)]
394    #[must_use]
395    pub fn rtcal(&mut self) -> RTCAL_W<17> {
396        RTCAL_W::new(self)
397    }
398    #[doc = "Bit 18 - USB Alarm Enable"]
399    #[inline(always)]
400    #[must_use]
401    pub fn usbal(&mut self) -> USBAL_W<18> {
402        USBAL_W::new(self)
403    }
404    #[doc = "Bit 20 - Low-power Mode"]
405    #[inline(always)]
406    #[must_use]
407    pub fn lpm(&mut self) -> LPM_W<20> {
408        LPM_W::new(self)
409    }
410    #[doc = "Bits 21:22 - Flash Low-power Mode"]
411    #[inline(always)]
412    #[must_use]
413    pub fn flpm(&mut self) -> FLPM_W<21> {
414        FLPM_W::new(self)
415    }
416    #[doc = "Writes raw bits to the register."]
417    #[inline(always)]
418    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
419        self.0.bits(bits);
420        self
421    }
422}
423#[doc = "Fast Start-up Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pmc_fsmr](index.html) module"]
424pub struct PMC_FSMR_SPEC;
425impl crate::RegisterSpec for PMC_FSMR_SPEC {
426    type Ux = u32;
427}
428#[doc = "`read()` method returns [pmc_fsmr::R](R) reader structure"]
429impl crate::Readable for PMC_FSMR_SPEC {
430    type Reader = R;
431}
432#[doc = "`write(|w| ..)` method takes [pmc_fsmr::W](W) writer structure"]
433impl crate::Writable for PMC_FSMR_SPEC {
434    type Writer = W;
435    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
436    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
437}
438#[doc = "`reset()` method sets PMC_FSMR to value 0"]
439impl crate::Resettable for PMC_FSMR_SPEC {
440    const RESET_VALUE: Self::Ux = 0;
441}