atsam4ls8a_pac/smap/
sr.rs1#[doc = "Register `SR` reader"]
2pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `DONE` reader - Operation done"]
17pub type DONE_R = crate::BitReader<bool>;
18#[doc = "Field `HCR` reader - Hold Core reset"]
19pub type HCR_R = crate::BitReader<bool>;
20#[doc = "Field `BERR` reader - Bus error"]
21pub type BERR_R = crate::BitReader<bool>;
22#[doc = "Field `FAIL` reader - Failure"]
23pub type FAIL_R = crate::BitReader<bool>;
24#[doc = "Field `LCK` reader - Lock"]
25pub type LCK_R = crate::BitReader<bool>;
26#[doc = "Field `EN` reader - Enabled"]
27pub type EN_R = crate::BitReader<bool>;
28#[doc = "Field `PROT` reader - Protected"]
29pub type PROT_R = crate::BitReader<bool>;
30#[doc = "Field `DBGP` reader - Debugger Present"]
31pub type DBGP_R = crate::BitReader<bool>;
32#[doc = "Field `STATE` reader - State"]
33pub type STATE_R = crate::FieldReader<u8, u8>;
34impl R {
35 #[doc = "Bit 0 - Operation done"]
36 #[inline(always)]
37 pub fn done(&self) -> DONE_R {
38 DONE_R::new((self.bits & 1) != 0)
39 }
40 #[doc = "Bit 1 - Hold Core reset"]
41 #[inline(always)]
42 pub fn hcr(&self) -> HCR_R {
43 HCR_R::new(((self.bits >> 1) & 1) != 0)
44 }
45 #[doc = "Bit 2 - Bus error"]
46 #[inline(always)]
47 pub fn berr(&self) -> BERR_R {
48 BERR_R::new(((self.bits >> 2) & 1) != 0)
49 }
50 #[doc = "Bit 3 - Failure"]
51 #[inline(always)]
52 pub fn fail(&self) -> FAIL_R {
53 FAIL_R::new(((self.bits >> 3) & 1) != 0)
54 }
55 #[doc = "Bit 4 - Lock"]
56 #[inline(always)]
57 pub fn lck(&self) -> LCK_R {
58 LCK_R::new(((self.bits >> 4) & 1) != 0)
59 }
60 #[doc = "Bit 8 - Enabled"]
61 #[inline(always)]
62 pub fn en(&self) -> EN_R {
63 EN_R::new(((self.bits >> 8) & 1) != 0)
64 }
65 #[doc = "Bit 9 - Protected"]
66 #[inline(always)]
67 pub fn prot(&self) -> PROT_R {
68 PROT_R::new(((self.bits >> 9) & 1) != 0)
69 }
70 #[doc = "Bit 10 - Debugger Present"]
71 #[inline(always)]
72 pub fn dbgp(&self) -> DBGP_R {
73 DBGP_R::new(((self.bits >> 10) & 1) != 0)
74 }
75 #[doc = "Bits 24:26 - State"]
76 #[inline(always)]
77 pub fn state(&self) -> STATE_R {
78 STATE_R::new(((self.bits >> 24) & 7) as u8)
79 }
80}
81#[doc = "Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sr](index.html) module"]
82pub struct SR_SPEC;
83impl crate::RegisterSpec for SR_SPEC {
84 type Ux = u32;
85}
86#[doc = "`read()` method returns [sr::R](R) reader structure"]
87impl crate::Readable for SR_SPEC {
88 type Reader = R;
89}
90#[doc = "`reset()` method sets SR to value 0"]
91impl crate::Resettable for SR_SPEC {
92 const RESET_VALUE: Self::Ux = 0;
93}