atsamd51p/sdhc0/
dbgr.rs
1#[doc = "Register `DBGR` reader"]
2pub type R = crate::R<DbgrSpec>;
3#[doc = "Register `DBGR` writer"]
4pub type W = crate::W<DbgrSpec>;
5#[doc = "Non-intrusive debug enable\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum Nidbgselect {
8 #[doc = "0: Debugging is intrusive (reads of BDPR from debugger are considered and increment the internal buffer pointer)"]
9 Idbg = 0,
10 #[doc = "1: Debugging is not intrusive (reads of BDPR from debugger are discarded and do not increment the internal buffer pointer)"]
11 Nidbg = 1,
12}
13impl From<Nidbgselect> for bool {
14 #[inline(always)]
15 fn from(variant: Nidbgselect) -> Self {
16 variant as u8 != 0
17 }
18}
19#[doc = "Field `NIDBG` reader - Non-intrusive debug enable"]
20pub type NidbgR = crate::BitReader<Nidbgselect>;
21impl NidbgR {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> Nidbgselect {
25 match self.bits {
26 false => Nidbgselect::Idbg,
27 true => Nidbgselect::Nidbg,
28 }
29 }
30 #[doc = "Debugging is intrusive (reads of BDPR from debugger are considered and increment the internal buffer pointer)"]
31 #[inline(always)]
32 pub fn is_idbg(&self) -> bool {
33 *self == Nidbgselect::Idbg
34 }
35 #[doc = "Debugging is not intrusive (reads of BDPR from debugger are discarded and do not increment the internal buffer pointer)"]
36 #[inline(always)]
37 pub fn is_nidbg(&self) -> bool {
38 *self == Nidbgselect::Nidbg
39 }
40}
41#[doc = "Field `NIDBG` writer - Non-intrusive debug enable"]
42pub type NidbgW<'a, REG> = crate::BitWriter<'a, REG, Nidbgselect>;
43impl<'a, REG> NidbgW<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "Debugging is intrusive (reads of BDPR from debugger are considered and increment the internal buffer pointer)"]
48 #[inline(always)]
49 pub fn idbg(self) -> &'a mut crate::W<REG> {
50 self.variant(Nidbgselect::Idbg)
51 }
52 #[doc = "Debugging is not intrusive (reads of BDPR from debugger are discarded and do not increment the internal buffer pointer)"]
53 #[inline(always)]
54 pub fn nidbg(self) -> &'a mut crate::W<REG> {
55 self.variant(Nidbgselect::Nidbg)
56 }
57}
58impl R {
59 #[doc = "Bit 0 - Non-intrusive debug enable"]
60 #[inline(always)]
61 pub fn nidbg(&self) -> NidbgR {
62 NidbgR::new((self.bits & 1) != 0)
63 }
64}
65impl W {
66 #[doc = "Bit 0 - Non-intrusive debug enable"]
67 #[inline(always)]
68 #[must_use]
69 pub fn nidbg(&mut self) -> NidbgW<DbgrSpec> {
70 NidbgW::new(self, 0)
71 }
72}
73#[doc = "Debug\n\nYou can [`read`](crate::Reg::read) this register and get [`dbgr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dbgr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
74pub struct DbgrSpec;
75impl crate::RegisterSpec for DbgrSpec {
76 type Ux = u8;
77}
78#[doc = "`read()` method returns [`dbgr::R`](R) reader structure"]
79impl crate::Readable for DbgrSpec {}
80#[doc = "`write(|w| ..)` method takes [`dbgr::W`](W) writer structure"]
81impl crate::Writable for DbgrSpec {
82 type Safety = crate::Unsafe;
83 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
84 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
85}
86#[doc = "`reset()` method sets DBGR to value 0"]
87impl crate::Resettable for DbgrSpec {
88 const RESET_VALUE: u8 = 0;
89}