bl602_pac/hbn/
hbn_glb.rs

1#[doc = "Register `HBN_GLB` reader"]
2pub struct R(crate::R<HBN_GLB_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<HBN_GLB_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<HBN_GLB_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<HBN_GLB_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `HBN_GLB` writer"]
17pub struct W(crate::W<HBN_GLB_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<HBN_GLB_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_GLB_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<HBN_GLB_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `hbn_root_clk_sel` reader - "]
38pub type HBN_ROOT_CLK_SEL_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `hbn_root_clk_sel` writer - "]
40pub type HBN_ROOT_CLK_SEL_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, HBN_GLB_SPEC, u8, u8, 2, O>;
42#[doc = "Field `hbn_uart_clk_sel` reader - "]
43pub type HBN_UART_CLK_SEL_R = crate::BitReader<bool>;
44#[doc = "Field `hbn_uart_clk_sel` writer - "]
45pub type HBN_UART_CLK_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HBN_GLB_SPEC, bool, O>;
46#[doc = "Field `hbn_f32k_sel` reader - "]
47pub type HBN_F32K_SEL_R = crate::FieldReader<u8, u8>;
48#[doc = "Field `hbn_f32k_sel` writer - "]
49pub type HBN_F32K_SEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HBN_GLB_SPEC, u8, u8, 2, O>;
50#[doc = "Field `hbn_pu_rc32k` reader - "]
51pub type HBN_PU_RC32K_R = crate::BitReader<bool>;
52#[doc = "Field `hbn_pu_rc32k` writer - "]
53pub type HBN_PU_RC32K_W<'a, const O: u8> = crate::BitWriter<'a, u32, HBN_GLB_SPEC, bool, O>;
54#[doc = "Field `sw_ldo11soc_vout_sel_aon` reader - "]
55pub type SW_LDO11SOC_VOUT_SEL_AON_R = crate::FieldReader<u8, u8>;
56#[doc = "Field `sw_ldo11soc_vout_sel_aon` writer - "]
57pub type SW_LDO11SOC_VOUT_SEL_AON_W<'a, const O: u8> =
58    crate::FieldWriter<'a, u32, HBN_GLB_SPEC, u8, u8, 4, O>;
59#[doc = "Field `sw_ldo11_rt_vout_sel` reader - "]
60pub type SW_LDO11_RT_VOUT_SEL_R = crate::FieldReader<u8, u8>;
61#[doc = "Field `sw_ldo11_rt_vout_sel` writer - "]
62pub type SW_LDO11_RT_VOUT_SEL_W<'a, const O: u8> =
63    crate::FieldWriter<'a, u32, HBN_GLB_SPEC, u8, u8, 4, O>;
64#[doc = "Field `sw_ldo11_aon_vout_sel` reader - "]
65pub type SW_LDO11_AON_VOUT_SEL_R = crate::FieldReader<u8, u8>;
66#[doc = "Field `sw_ldo11_aon_vout_sel` writer - "]
67pub type SW_LDO11_AON_VOUT_SEL_W<'a, const O: u8> =
68    crate::FieldWriter<'a, u32, HBN_GLB_SPEC, u8, u8, 4, O>;
69impl R {
70    #[doc = "Bits 0:1"]
71    #[inline(always)]
72    pub fn hbn_root_clk_sel(&self) -> HBN_ROOT_CLK_SEL_R {
73        HBN_ROOT_CLK_SEL_R::new((self.bits & 3) as u8)
74    }
75    #[doc = "Bit 2"]
76    #[inline(always)]
77    pub fn hbn_uart_clk_sel(&self) -> HBN_UART_CLK_SEL_R {
78        HBN_UART_CLK_SEL_R::new(((self.bits >> 2) & 1) != 0)
79    }
80    #[doc = "Bits 3:4"]
81    #[inline(always)]
82    pub fn hbn_f32k_sel(&self) -> HBN_F32K_SEL_R {
83        HBN_F32K_SEL_R::new(((self.bits >> 3) & 3) as u8)
84    }
85    #[doc = "Bit 5"]
86    #[inline(always)]
87    pub fn hbn_pu_rc32k(&self) -> HBN_PU_RC32K_R {
88        HBN_PU_RC32K_R::new(((self.bits >> 5) & 1) != 0)
89    }
90    #[doc = "Bits 16:19"]
91    #[inline(always)]
92    pub fn sw_ldo11soc_vout_sel_aon(&self) -> SW_LDO11SOC_VOUT_SEL_AON_R {
93        SW_LDO11SOC_VOUT_SEL_AON_R::new(((self.bits >> 16) & 0x0f) as u8)
94    }
95    #[doc = "Bits 24:27"]
96    #[inline(always)]
97    pub fn sw_ldo11_rt_vout_sel(&self) -> SW_LDO11_RT_VOUT_SEL_R {
98        SW_LDO11_RT_VOUT_SEL_R::new(((self.bits >> 24) & 0x0f) as u8)
99    }
100    #[doc = "Bits 28:31"]
101    #[inline(always)]
102    pub fn sw_ldo11_aon_vout_sel(&self) -> SW_LDO11_AON_VOUT_SEL_R {
103        SW_LDO11_AON_VOUT_SEL_R::new(((self.bits >> 28) & 0x0f) as u8)
104    }
105}
106impl W {
107    #[doc = "Bits 0:1"]
108    #[inline(always)]
109    #[must_use]
110    pub fn hbn_root_clk_sel(&mut self) -> HBN_ROOT_CLK_SEL_W<0> {
111        HBN_ROOT_CLK_SEL_W::new(self)
112    }
113    #[doc = "Bit 2"]
114    #[inline(always)]
115    #[must_use]
116    pub fn hbn_uart_clk_sel(&mut self) -> HBN_UART_CLK_SEL_W<2> {
117        HBN_UART_CLK_SEL_W::new(self)
118    }
119    #[doc = "Bits 3:4"]
120    #[inline(always)]
121    #[must_use]
122    pub fn hbn_f32k_sel(&mut self) -> HBN_F32K_SEL_W<3> {
123        HBN_F32K_SEL_W::new(self)
124    }
125    #[doc = "Bit 5"]
126    #[inline(always)]
127    #[must_use]
128    pub fn hbn_pu_rc32k(&mut self) -> HBN_PU_RC32K_W<5> {
129        HBN_PU_RC32K_W::new(self)
130    }
131    #[doc = "Bits 16:19"]
132    #[inline(always)]
133    #[must_use]
134    pub fn sw_ldo11soc_vout_sel_aon(&mut self) -> SW_LDO11SOC_VOUT_SEL_AON_W<16> {
135        SW_LDO11SOC_VOUT_SEL_AON_W::new(self)
136    }
137    #[doc = "Bits 24:27"]
138    #[inline(always)]
139    #[must_use]
140    pub fn sw_ldo11_rt_vout_sel(&mut self) -> SW_LDO11_RT_VOUT_SEL_W<24> {
141        SW_LDO11_RT_VOUT_SEL_W::new(self)
142    }
143    #[doc = "Bits 28:31"]
144    #[inline(always)]
145    #[must_use]
146    pub fn sw_ldo11_aon_vout_sel(&mut self) -> SW_LDO11_AON_VOUT_SEL_W<28> {
147        SW_LDO11_AON_VOUT_SEL_W::new(self)
148    }
149    #[doc = "Writes raw bits to the register."]
150    #[inline(always)]
151    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
152        self.0.bits(bits);
153        self
154    }
155}
156#[doc = "HBN_GLB.\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_glb](index.html) module"]
157pub struct HBN_GLB_SPEC;
158impl crate::RegisterSpec for HBN_GLB_SPEC {
159    type Ux = u32;
160}
161#[doc = "`read()` method returns [hbn_glb::R](R) reader structure"]
162impl crate::Readable for HBN_GLB_SPEC {
163    type Reader = R;
164}
165#[doc = "`write(|w| ..)` method takes [hbn_glb::W](W) writer structure"]
166impl crate::Writable for HBN_GLB_SPEC {
167    type Writer = W;
168    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
169    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
170}
171#[doc = "`reset()` method sets HBN_GLB to value 0xaa0a_0020"]
172impl crate::Resettable for HBN_GLB_SPEC {
173    const RESET_VALUE: Self::Ux = 0xaa0a_0020;
174}