atsaml21e17b/nvmctrl/
status.rs1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<STATUS_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `STATUS` writer"]
17pub struct W(crate::W<STATUS_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<STATUS_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<STATUS_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<STATUS_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `PRM` reader - Power Reduction Mode"]
38pub type PRM_R = crate::BitReader<bool>;
39#[doc = "Field `LOAD` reader - NVM Page Buffer Active Loading"]
40pub type LOAD_R = crate::BitReader<bool>;
41#[doc = "Field `LOAD` writer - NVM Page Buffer Active Loading"]
42pub type LOAD_W<'a, const O: u8> = crate::BitWriter<'a, u16, STATUS_SPEC, bool, O>;
43#[doc = "Field `PROGE` reader - Programming Error Status"]
44pub type PROGE_R = crate::BitReader<bool>;
45#[doc = "Field `PROGE` writer - Programming Error Status"]
46pub type PROGE_W<'a, const O: u8> = crate::BitWriter<'a, u16, STATUS_SPEC, bool, O>;
47#[doc = "Field `LOCKE` reader - Lock Error Status"]
48pub type LOCKE_R = crate::BitReader<bool>;
49#[doc = "Field `LOCKE` writer - Lock Error Status"]
50pub type LOCKE_W<'a, const O: u8> = crate::BitWriter<'a, u16, STATUS_SPEC, bool, O>;
51#[doc = "Field `NVME` reader - NVM Error"]
52pub type NVME_R = crate::BitReader<bool>;
53#[doc = "Field `NVME` writer - NVM Error"]
54pub type NVME_W<'a, const O: u8> = crate::BitWriter<'a, u16, STATUS_SPEC, bool, O>;
55#[doc = "Field `SB` reader - Security Bit Status"]
56pub type SB_R = crate::BitReader<bool>;
57impl R {
58 #[doc = "Bit 0 - Power Reduction Mode"]
59 #[inline(always)]
60 pub fn prm(&self) -> PRM_R {
61 PRM_R::new((self.bits & 1) != 0)
62 }
63 #[doc = "Bit 1 - NVM Page Buffer Active Loading"]
64 #[inline(always)]
65 pub fn load(&self) -> LOAD_R {
66 LOAD_R::new(((self.bits >> 1) & 1) != 0)
67 }
68 #[doc = "Bit 2 - Programming Error Status"]
69 #[inline(always)]
70 pub fn proge(&self) -> PROGE_R {
71 PROGE_R::new(((self.bits >> 2) & 1) != 0)
72 }
73 #[doc = "Bit 3 - Lock Error Status"]
74 #[inline(always)]
75 pub fn locke(&self) -> LOCKE_R {
76 LOCKE_R::new(((self.bits >> 3) & 1) != 0)
77 }
78 #[doc = "Bit 4 - NVM Error"]
79 #[inline(always)]
80 pub fn nvme(&self) -> NVME_R {
81 NVME_R::new(((self.bits >> 4) & 1) != 0)
82 }
83 #[doc = "Bit 8 - Security Bit Status"]
84 #[inline(always)]
85 pub fn sb(&self) -> SB_R {
86 SB_R::new(((self.bits >> 8) & 1) != 0)
87 }
88}
89impl W {
90 #[doc = "Bit 1 - NVM Page Buffer Active Loading"]
91 #[inline(always)]
92 #[must_use]
93 pub fn load(&mut self) -> LOAD_W<1> {
94 LOAD_W::new(self)
95 }
96 #[doc = "Bit 2 - Programming Error Status"]
97 #[inline(always)]
98 #[must_use]
99 pub fn proge(&mut self) -> PROGE_W<2> {
100 PROGE_W::new(self)
101 }
102 #[doc = "Bit 3 - Lock Error Status"]
103 #[inline(always)]
104 #[must_use]
105 pub fn locke(&mut self) -> LOCKE_W<3> {
106 LOCKE_W::new(self)
107 }
108 #[doc = "Bit 4 - NVM Error"]
109 #[inline(always)]
110 #[must_use]
111 pub fn nvme(&mut self) -> NVME_W<4> {
112 NVME_W::new(self)
113 }
114 #[doc = "Writes raw bits to the register."]
115 #[inline(always)]
116 pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
117 self.0.bits(bits);
118 self
119 }
120}
121#[doc = "Status\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 [status](index.html) module"]
122pub struct STATUS_SPEC;
123impl crate::RegisterSpec for STATUS_SPEC {
124 type Ux = u16;
125}
126#[doc = "`read()` method returns [status::R](R) reader structure"]
127impl crate::Readable for STATUS_SPEC {
128 type Reader = R;
129}
130#[doc = "`write(|w| ..)` method takes [status::W](W) writer structure"]
131impl crate::Writable for STATUS_SPEC {
132 type Writer = W;
133 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
134 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
135}
136#[doc = "`reset()` method sets STATUS to value 0"]
137impl crate::Resettable for STATUS_SPEC {
138 const RESET_VALUE: Self::Ux = 0;
139}