bl702_pac/hbn/
hbn_misc.rs1#[doc = "Register `HBN_MISC` reader"]
2pub struct R(crate::R<HBN_MISC_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HBN_MISC_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HBN_MISC_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HBN_MISC_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HBN_MISC` writer"]
17pub struct W(crate::W<HBN_MISC_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<HBN_MISC_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<HBN_MISC_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<HBN_MISC_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `bor_sel` reader - "]
38pub type BOR_SEL_R = crate::BitReader<bool>;
39#[doc = "Field `bor_sel` writer - "]
40pub type BOR_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HBN_MISC_SPEC, bool, O>;
41#[doc = "Field `bor_vth` reader - "]
42pub type BOR_VTH_R = crate::BitReader<bool>;
43#[doc = "Field `bor_vth` writer - "]
44pub type BOR_VTH_W<'a, const O: u8> = crate::BitWriter<'a, u32, HBN_MISC_SPEC, bool, O>;
45#[doc = "Field `pu_bor` reader - "]
46pub type PU_BOR_R = crate::BitReader<bool>;
47#[doc = "Field `pu_bor` writer - "]
48pub type PU_BOR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HBN_MISC_SPEC, bool, O>;
49#[doc = "Field `r_bor_out` reader - "]
50pub type R_BOR_OUT_R = crate::BitReader<bool>;
51#[doc = "Field `r_bor_out` writer - "]
52pub type R_BOR_OUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, HBN_MISC_SPEC, bool, O>;
53#[doc = "Field `hbn_flash_pullup_aon` reader - "]
54pub type HBN_FLASH_PULLUP_AON_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `hbn_flash_pullup_aon` writer - "]
56pub type HBN_FLASH_PULLUP_AON_W<'a, const O: u8> =
57 crate::FieldWriter<'a, u32, HBN_MISC_SPEC, u8, u8, 6, O>;
58#[doc = "Field `hbn_flash_pulldown_aon` reader - "]
59pub type HBN_FLASH_PULLDOWN_AON_R = crate::FieldReader<u8, u8>;
60#[doc = "Field `hbn_flash_pulldown_aon` writer - "]
61pub type HBN_FLASH_PULLDOWN_AON_W<'a, const O: u8> =
62 crate::FieldWriter<'a, u32, HBN_MISC_SPEC, u8, u8, 6, O>;
63impl R {
64 #[doc = "Bit 0"]
65 #[inline(always)]
66 pub fn bor_sel(&self) -> BOR_SEL_R {
67 BOR_SEL_R::new((self.bits & 1) != 0)
68 }
69 #[doc = "Bit 1"]
70 #[inline(always)]
71 pub fn bor_vth(&self) -> BOR_VTH_R {
72 BOR_VTH_R::new(((self.bits >> 1) & 1) != 0)
73 }
74 #[doc = "Bit 2"]
75 #[inline(always)]
76 pub fn pu_bor(&self) -> PU_BOR_R {
77 PU_BOR_R::new(((self.bits >> 2) & 1) != 0)
78 }
79 #[doc = "Bit 3"]
80 #[inline(always)]
81 pub fn r_bor_out(&self) -> R_BOR_OUT_R {
82 R_BOR_OUT_R::new(((self.bits >> 3) & 1) != 0)
83 }
84 #[doc = "Bits 16:21"]
85 #[inline(always)]
86 pub fn hbn_flash_pullup_aon(&self) -> HBN_FLASH_PULLUP_AON_R {
87 HBN_FLASH_PULLUP_AON_R::new(((self.bits >> 16) & 0x3f) as u8)
88 }
89 #[doc = "Bits 24:29"]
90 #[inline(always)]
91 pub fn hbn_flash_pulldown_aon(&self) -> HBN_FLASH_PULLDOWN_AON_R {
92 HBN_FLASH_PULLDOWN_AON_R::new(((self.bits >> 24) & 0x3f) as u8)
93 }
94}
95impl W {
96 #[doc = "Bit 0"]
97 #[inline(always)]
98 #[must_use]
99 pub fn bor_sel(&mut self) -> BOR_SEL_W<0> {
100 BOR_SEL_W::new(self)
101 }
102 #[doc = "Bit 1"]
103 #[inline(always)]
104 #[must_use]
105 pub fn bor_vth(&mut self) -> BOR_VTH_W<1> {
106 BOR_VTH_W::new(self)
107 }
108 #[doc = "Bit 2"]
109 #[inline(always)]
110 #[must_use]
111 pub fn pu_bor(&mut self) -> PU_BOR_W<2> {
112 PU_BOR_W::new(self)
113 }
114 #[doc = "Bit 3"]
115 #[inline(always)]
116 #[must_use]
117 pub fn r_bor_out(&mut self) -> R_BOR_OUT_W<3> {
118 R_BOR_OUT_W::new(self)
119 }
120 #[doc = "Bits 16:21"]
121 #[inline(always)]
122 #[must_use]
123 pub fn hbn_flash_pullup_aon(&mut self) -> HBN_FLASH_PULLUP_AON_W<16> {
124 HBN_FLASH_PULLUP_AON_W::new(self)
125 }
126 #[doc = "Bits 24:29"]
127 #[inline(always)]
128 #[must_use]
129 pub fn hbn_flash_pulldown_aon(&mut self) -> HBN_FLASH_PULLDOWN_AON_W<24> {
130 HBN_FLASH_PULLDOWN_AON_W::new(self)
131 }
132 #[doc = "Writes raw bits to the register."]
133 #[inline(always)]
134 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
135 self.0.bits(bits);
136 self
137 }
138}
139#[doc = "HBN_MISC.\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 [hbn_misc](index.html) module"]
140pub struct HBN_MISC_SPEC;
141impl crate::RegisterSpec for HBN_MISC_SPEC {
142 type Ux = u32;
143}
144#[doc = "`read()` method returns [hbn_misc::R](R) reader structure"]
145impl crate::Readable for HBN_MISC_SPEC {
146 type Reader = R;
147}
148#[doc = "`write(|w| ..)` method takes [hbn_misc::W](W) writer structure"]
149impl crate::Writable for HBN_MISC_SPEC {
150 type Writer = W;
151 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
152 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
153}
154#[doc = "`reset()` method sets HBN_MISC to value 0"]
155impl crate::Resettable for HBN_MISC_SPEC {
156 const RESET_VALUE: Self::Ux = 0;
157}