bl602_pac/hbn/
hbn_bor_cfg.rs1#[doc = "Register `HBN_BOR_CFG` reader"]
2pub struct R(crate::R<HBN_BOR_CFG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HBN_BOR_CFG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HBN_BOR_CFG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HBN_BOR_CFG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HBN_BOR_CFG` writer"]
17pub struct W(crate::W<HBN_BOR_CFG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<HBN_BOR_CFG_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_BOR_CFG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<HBN_BOR_CFG_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_BOR_CFG_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_BOR_CFG_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_BOR_CFG_SPEC, bool, O>;
49#[doc = "Field `r_bor_out` reader - "]
50pub type R_BOR_OUT_R = crate::BitReader<bool>;
51impl R {
52 #[doc = "Bit 0"]
53 #[inline(always)]
54 pub fn bor_sel(&self) -> BOR_SEL_R {
55 BOR_SEL_R::new((self.bits & 1) != 0)
56 }
57 #[doc = "Bit 1"]
58 #[inline(always)]
59 pub fn bor_vth(&self) -> BOR_VTH_R {
60 BOR_VTH_R::new(((self.bits >> 1) & 1) != 0)
61 }
62 #[doc = "Bit 2"]
63 #[inline(always)]
64 pub fn pu_bor(&self) -> PU_BOR_R {
65 PU_BOR_R::new(((self.bits >> 2) & 1) != 0)
66 }
67 #[doc = "Bit 3"]
68 #[inline(always)]
69 pub fn r_bor_out(&self) -> R_BOR_OUT_R {
70 R_BOR_OUT_R::new(((self.bits >> 3) & 1) != 0)
71 }
72}
73impl W {
74 #[doc = "Bit 0"]
75 #[inline(always)]
76 #[must_use]
77 pub fn bor_sel(&mut self) -> BOR_SEL_W<0> {
78 BOR_SEL_W::new(self)
79 }
80 #[doc = "Bit 1"]
81 #[inline(always)]
82 #[must_use]
83 pub fn bor_vth(&mut self) -> BOR_VTH_W<1> {
84 BOR_VTH_W::new(self)
85 }
86 #[doc = "Bit 2"]
87 #[inline(always)]
88 #[must_use]
89 pub fn pu_bor(&mut self) -> PU_BOR_W<2> {
90 PU_BOR_W::new(self)
91 }
92 #[doc = "Writes raw bits to the register."]
93 #[inline(always)]
94 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
95 self.0.bits(bits);
96 self
97 }
98}
99#[doc = "HBN_BOR_CFG.\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_bor_cfg](index.html) module"]
100pub struct HBN_BOR_CFG_SPEC;
101impl crate::RegisterSpec for HBN_BOR_CFG_SPEC {
102 type Ux = u32;
103}
104#[doc = "`read()` method returns [hbn_bor_cfg::R](R) reader structure"]
105impl crate::Readable for HBN_BOR_CFG_SPEC {
106 type Reader = R;
107}
108#[doc = "`write(|w| ..)` method takes [hbn_bor_cfg::W](W) writer structure"]
109impl crate::Writable for HBN_BOR_CFG_SPEC {
110 type Writer = W;
111 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
112 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
113}
114#[doc = "`reset()` method sets HBN_BOR_CFG to value 0x02"]
115impl crate::Resettable for HBN_BOR_CFG_SPEC {
116 const RESET_VALUE: Self::Ux = 0x02;
117}