bl808_pac/debug/
control.rs1#[doc = "Register `control` reader"]
2pub struct R(crate::R<CONTROL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CONTROL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CONTROL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CONTROL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `control` writer"]
17pub struct W(crate::W<CONTROL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CONTROL_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<CONTROL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CONTROL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `password_busy` reader - ??"]
38pub type PASSWORD_BUSY_R = crate::BitReader<bool>;
39#[doc = "Field `password_trigger` reader - ??"]
40pub type PASSWORD_TRIGGER_R = crate::BitReader<bool>;
41#[doc = "Field `password_trigger` writer - ??"]
42pub type PASSWORD_TRIGGER_W<'a, const O: u8> = crate::BitWriter<'a, u32, CONTROL_SPEC, bool, O>;
43#[doc = "Field `password_count` reader - ??"]
44pub type PASSWORD_COUNT_R = crate::FieldReader<u32, u32>;
45#[doc = "Field `password_count` writer - ??"]
46pub type PASSWORD_COUNT_W<'a, const O: u8> =
47 crate::FieldWriter<'a, u32, CONTROL_SPEC, u32, u32, 20, O>;
48#[doc = "Field `debug_mode` reader - ??"]
49pub type DEBUG_MODE_R = crate::FieldReader<u8, u8>;
50#[doc = "Field `debug_enable` reader - Read if debug module is enabled"]
51pub type DEBUG_ENABLE_R = crate::FieldReader<u8, u8>;
52impl R {
53 #[doc = "Bit 0 - ??"]
54 #[inline(always)]
55 pub fn password_busy(&self) -> PASSWORD_BUSY_R {
56 PASSWORD_BUSY_R::new((self.bits & 1) != 0)
57 }
58 #[doc = "Bit 1 - ??"]
59 #[inline(always)]
60 pub fn password_trigger(&self) -> PASSWORD_TRIGGER_R {
61 PASSWORD_TRIGGER_R::new(((self.bits >> 1) & 1) != 0)
62 }
63 #[doc = "Bits 4:23 - ??"]
64 #[inline(always)]
65 pub fn password_count(&self) -> PASSWORD_COUNT_R {
66 PASSWORD_COUNT_R::new(((self.bits >> 4) & 0x000f_ffff) as u32)
67 }
68 #[doc = "Bits 24:27 - ??"]
69 #[inline(always)]
70 pub fn debug_mode(&self) -> DEBUG_MODE_R {
71 DEBUG_MODE_R::new(((self.bits >> 24) & 0x0f) as u8)
72 }
73 #[doc = "Bits 28:31 - Read if debug module is enabled"]
74 #[inline(always)]
75 pub fn debug_enable(&self) -> DEBUG_ENABLE_R {
76 DEBUG_ENABLE_R::new(((self.bits >> 28) & 0x0f) as u8)
77 }
78}
79impl W {
80 #[doc = "Bit 1 - ??"]
81 #[inline(always)]
82 pub fn password_trigger(&mut self) -> PASSWORD_TRIGGER_W<1> {
83 PASSWORD_TRIGGER_W::new(self)
84 }
85 #[doc = "Bits 4:23 - ??"]
86 #[inline(always)]
87 pub fn password_count(&mut self) -> PASSWORD_COUNT_W<4> {
88 PASSWORD_COUNT_W::new(self)
89 }
90 #[doc = "Writes raw bits to the register."]
91 #[inline(always)]
92 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
93 self.0.bits(bits);
94 self
95 }
96}
97#[doc = "Module control register\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 [control](index.html) module"]
98pub struct CONTROL_SPEC;
99impl crate::RegisterSpec for CONTROL_SPEC {
100 type Ux = u32;
101}
102#[doc = "`read()` method returns [control::R](R) reader structure"]
103impl crate::Readable for CONTROL_SPEC {
104 type Reader = R;
105}
106#[doc = "`write(|w| ..)` method takes [control::W](W) writer structure"]
107impl crate::Writable for CONTROL_SPEC {
108 type Writer = W;
109}
110#[doc = "`reset()` method sets control to value 0"]
111impl crate::Resettable for CONTROL_SPEC {
112 #[inline(always)]
113 fn reset_value() -> Self::Ux {
114 0
115 }
116}