atsamd11c/dsu/
statusa.rs

1#[doc = "Register `STATUSA` reader"]
2pub type R = crate::R<StatusaSpec>;
3#[doc = "Register `STATUSA` writer"]
4pub type W = crate::W<StatusaSpec>;
5#[doc = "Field `DONE` reader - Done"]
6pub type DoneR = crate::BitReader;
7#[doc = "Field `DONE` writer - Done"]
8pub type DoneW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CRSTEXT` reader - CPU Reset Phase Extension"]
10pub type CrstextR = crate::BitReader;
11#[doc = "Field `CRSTEXT` writer - CPU Reset Phase Extension"]
12pub type CrstextW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `BERR` reader - Bus Error"]
14pub type BerrR = crate::BitReader;
15#[doc = "Field `BERR` writer - Bus Error"]
16pub type BerrW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `FAIL` reader - Failure"]
18pub type FailR = crate::BitReader;
19#[doc = "Field `FAIL` writer - Failure"]
20pub type FailW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `PERR` reader - Protection Error"]
22pub type PerrR = crate::BitReader;
23#[doc = "Field `PERR` writer - Protection Error"]
24pub type PerrW<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 0 - Done"]
27    #[inline(always)]
28    pub fn done(&self) -> DoneR {
29        DoneR::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1 - CPU Reset Phase Extension"]
32    #[inline(always)]
33    pub fn crstext(&self) -> CrstextR {
34        CrstextR::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 2 - Bus Error"]
37    #[inline(always)]
38    pub fn berr(&self) -> BerrR {
39        BerrR::new(((self.bits >> 2) & 1) != 0)
40    }
41    #[doc = "Bit 3 - Failure"]
42    #[inline(always)]
43    pub fn fail(&self) -> FailR {
44        FailR::new(((self.bits >> 3) & 1) != 0)
45    }
46    #[doc = "Bit 4 - Protection Error"]
47    #[inline(always)]
48    pub fn perr(&self) -> PerrR {
49        PerrR::new(((self.bits >> 4) & 1) != 0)
50    }
51}
52impl W {
53    #[doc = "Bit 0 - Done"]
54    #[inline(always)]
55    #[must_use]
56    pub fn done(&mut self) -> DoneW<StatusaSpec> {
57        DoneW::new(self, 0)
58    }
59    #[doc = "Bit 1 - CPU Reset Phase Extension"]
60    #[inline(always)]
61    #[must_use]
62    pub fn crstext(&mut self) -> CrstextW<StatusaSpec> {
63        CrstextW::new(self, 1)
64    }
65    #[doc = "Bit 2 - Bus Error"]
66    #[inline(always)]
67    #[must_use]
68    pub fn berr(&mut self) -> BerrW<StatusaSpec> {
69        BerrW::new(self, 2)
70    }
71    #[doc = "Bit 3 - Failure"]
72    #[inline(always)]
73    #[must_use]
74    pub fn fail(&mut self) -> FailW<StatusaSpec> {
75        FailW::new(self, 3)
76    }
77    #[doc = "Bit 4 - Protection Error"]
78    #[inline(always)]
79    #[must_use]
80    pub fn perr(&mut self) -> PerrW<StatusaSpec> {
81        PerrW::new(self, 4)
82    }
83}
84#[doc = "Status A\n\nYou can [`read`](crate::Reg::read) this register and get [`statusa::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`statusa::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
85pub struct StatusaSpec;
86impl crate::RegisterSpec for StatusaSpec {
87    type Ux = u8;
88}
89#[doc = "`read()` method returns [`statusa::R`](R) reader structure"]
90impl crate::Readable for StatusaSpec {}
91#[doc = "`write(|w| ..)` method takes [`statusa::W`](W) writer structure"]
92impl crate::Writable for StatusaSpec {
93    type Safety = crate::Unsafe;
94    const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
95    const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
96}
97#[doc = "`reset()` method sets STATUSA to value 0"]
98impl crate::Resettable for StatusaSpec {
99    const RESET_VALUE: u8 = 0;
100}