atsamd51n/dsu/
statusb.rs

1#[doc = "Register `STATUSB` reader"]
2pub type R = crate::R<StatusbSpec>;
3#[doc = "Field `PROT` reader - Protected"]
4pub type ProtR = crate::BitReader;
5#[doc = "Field `DBGPRES` reader - Debugger Present"]
6pub type DbgpresR = crate::BitReader;
7#[doc = "Field `DCCD0` reader - Debug Communication Channel 0 Dirty"]
8pub type Dccd0R = crate::BitReader;
9#[doc = "Field `DCCD1` reader - Debug Communication Channel 1 Dirty"]
10pub type Dccd1R = crate::BitReader;
11#[doc = "Field `HPE` reader - Hot-Plugging Enable"]
12pub type HpeR = crate::BitReader;
13#[doc = "Field `CELCK` reader - Chip Erase Locked"]
14pub type CelckR = crate::BitReader;
15impl R {
16    #[doc = "Bit 0 - Protected"]
17    #[inline(always)]
18    pub fn prot(&self) -> ProtR {
19        ProtR::new((self.bits & 1) != 0)
20    }
21    #[doc = "Bit 1 - Debugger Present"]
22    #[inline(always)]
23    pub fn dbgpres(&self) -> DbgpresR {
24        DbgpresR::new(((self.bits >> 1) & 1) != 0)
25    }
26    #[doc = "Bit 2 - Debug Communication Channel 0 Dirty"]
27    #[inline(always)]
28    pub fn dccd0(&self) -> Dccd0R {
29        Dccd0R::new(((self.bits >> 2) & 1) != 0)
30    }
31    #[doc = "Bit 3 - Debug Communication Channel 1 Dirty"]
32    #[inline(always)]
33    pub fn dccd1(&self) -> Dccd1R {
34        Dccd1R::new(((self.bits >> 3) & 1) != 0)
35    }
36    #[doc = "Bit 4 - Hot-Plugging Enable"]
37    #[inline(always)]
38    pub fn hpe(&self) -> HpeR {
39        HpeR::new(((self.bits >> 4) & 1) != 0)
40    }
41    #[doc = "Bit 5 - Chip Erase Locked"]
42    #[inline(always)]
43    pub fn celck(&self) -> CelckR {
44        CelckR::new(((self.bits >> 5) & 1) != 0)
45    }
46}
47#[doc = "Status B\n\nYou can [`read`](crate::Reg::read) this register and get [`statusb::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
48pub struct StatusbSpec;
49impl crate::RegisterSpec for StatusbSpec {
50    type Ux = u8;
51}
52#[doc = "`read()` method returns [`statusb::R`](R) reader structure"]
53impl crate::Readable for StatusbSpec {}
54#[doc = "`reset()` method sets STATUSB to value 0"]
55impl crate::Resettable for StatusbSpec {
56    const RESET_VALUE: u8 = 0;
57}