atsamd21j/nvmctrl/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<StatusSpec>;
3#[doc = "Register `STATUS` writer"]
4pub type W = crate::W<StatusSpec>;
5#[doc = "Field `PRM` reader - Power Reduction Mode"]
6pub type PrmR = crate::BitReader;
7#[doc = "Field `LOAD` reader - NVM Page Buffer Active Loading"]
8pub type LoadR = crate::BitReader;
9#[doc = "Field `LOAD` writer - NVM Page Buffer Active Loading"]
10pub type LoadW<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `PROGE` reader - Programming Error Status"]
12pub type ProgeR = crate::BitReader;
13#[doc = "Field `PROGE` writer - Programming Error Status"]
14pub type ProgeW<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `LOCKE` reader - Lock Error Status"]
16pub type LockeR = crate::BitReader;
17#[doc = "Field `LOCKE` writer - Lock Error Status"]
18pub type LockeW<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `NVME` reader - NVM Error"]
20pub type NvmeR = crate::BitReader;
21#[doc = "Field `NVME` writer - NVM Error"]
22pub type NvmeW<'a, REG> = crate::BitWriter<'a, REG>;
23#[doc = "Field `SB` reader - Security Bit Status"]
24pub type SbR = crate::BitReader;
25impl R {
26    #[doc = "Bit 0 - Power Reduction Mode"]
27    #[inline(always)]
28    pub fn prm(&self) -> PrmR {
29        PrmR::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1 - NVM Page Buffer Active Loading"]
32    #[inline(always)]
33    pub fn load(&self) -> LoadR {
34        LoadR::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 2 - Programming Error Status"]
37    #[inline(always)]
38    pub fn proge(&self) -> ProgeR {
39        ProgeR::new(((self.bits >> 2) & 1) != 0)
40    }
41    #[doc = "Bit 3 - Lock Error Status"]
42    #[inline(always)]
43    pub fn locke(&self) -> LockeR {
44        LockeR::new(((self.bits >> 3) & 1) != 0)
45    }
46    #[doc = "Bit 4 - NVM Error"]
47    #[inline(always)]
48    pub fn nvme(&self) -> NvmeR {
49        NvmeR::new(((self.bits >> 4) & 1) != 0)
50    }
51    #[doc = "Bit 8 - Security Bit Status"]
52    #[inline(always)]
53    pub fn sb(&self) -> SbR {
54        SbR::new(((self.bits >> 8) & 1) != 0)
55    }
56}
57impl W {
58    #[doc = "Bit 1 - NVM Page Buffer Active Loading"]
59    #[inline(always)]
60    #[must_use]
61    pub fn load(&mut self) -> LoadW<StatusSpec> {
62        LoadW::new(self, 1)
63    }
64    #[doc = "Bit 2 - Programming Error Status"]
65    #[inline(always)]
66    #[must_use]
67    pub fn proge(&mut self) -> ProgeW<StatusSpec> {
68        ProgeW::new(self, 2)
69    }
70    #[doc = "Bit 3 - Lock Error Status"]
71    #[inline(always)]
72    #[must_use]
73    pub fn locke(&mut self) -> LockeW<StatusSpec> {
74        LockeW::new(self, 3)
75    }
76    #[doc = "Bit 4 - NVM Error"]
77    #[inline(always)]
78    #[must_use]
79    pub fn nvme(&mut self) -> NvmeW<StatusSpec> {
80        NvmeW::new(self, 4)
81    }
82}
83#[doc = "Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`status::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
84pub struct StatusSpec;
85impl crate::RegisterSpec for StatusSpec {
86    type Ux = u16;
87}
88#[doc = "`read()` method returns [`status::R`](R) reader structure"]
89impl crate::Readable for StatusSpec {}
90#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
91impl crate::Writable for StatusSpec {
92    type Safety = crate::Unsafe;
93    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
94    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
95}
96#[doc = "`reset()` method sets STATUS to value 0"]
97impl crate::Resettable for StatusSpec {
98    const RESET_VALUE: u16 = 0;
99}