bl61x_pac/hbn/
global.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#[doc = "Register `global` reader"]
pub type R = crate::R<GLOBAL_SPEC>;
#[doc = "Register `global` writer"]
pub type W = crate::W<GLOBAL_SPEC>;
#[doc = "Field `hbn_root_clk_sel` reader - "]
pub type HBN_ROOT_CLK_SEL_R = crate::FieldReader;
#[doc = "Field `hbn_root_clk_sel` writer - "]
pub type HBN_ROOT_CLK_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `hbn_uart_clk_sel` reader - "]
pub type HBN_UART_CLK_SEL_R = crate::BitReader;
#[doc = "Field `hbn_uart_clk_sel` writer - "]
pub type HBN_UART_CLK_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `hbn_f32k_sel` reader - "]
pub type HBN_F32K_SEL_R = crate::FieldReader;
#[doc = "Field `hbn_f32k_sel` writer - "]
pub type HBN_F32K_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
#[doc = "Field `hbn_pu_rc32k` reader - "]
pub type HBN_PU_RC32K_R = crate::BitReader;
#[doc = "Field `hbn_pu_rc32k` writer - "]
pub type HBN_PU_RC32K_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `hbn_reset_event` reader - "]
pub type HBN_RESET_EVENT_R = crate::FieldReader;
#[doc = "Field `hbn_reset_event` writer - "]
pub type HBN_RESET_EVENT_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
#[doc = "Field `hbn_uart_clk_sel2` reader - "]
pub type HBN_UART_CLK_SEL2_R = crate::BitReader;
#[doc = "Field `hbn_uart_clk_sel2` writer - "]
pub type HBN_UART_CLK_SEL2_W<'a, REG> = crate::BitWriter<'a, REG>;
#[doc = "Field `sw_ldo11soc_vout_sel_aon` reader - "]
pub type SW_LDO11SOC_VOUT_SEL_AON_R = crate::FieldReader;
#[doc = "Field `sw_ldo11soc_vout_sel_aon` writer - "]
pub type SW_LDO11SOC_VOUT_SEL_AON_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Field `sw_ldo11_rt_vout_sel` reader - "]
pub type SW_LDO11_RT_VOUT_SEL_R = crate::FieldReader;
#[doc = "Field `sw_ldo11_rt_vout_sel` writer - "]
pub type SW_LDO11_RT_VOUT_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Field `sw_ldo11_aon_vout_sel` reader - "]
pub type SW_LDO11_AON_VOUT_SEL_R = crate::FieldReader;
#[doc = "Field `sw_ldo11_aon_vout_sel` writer - "]
pub type SW_LDO11_AON_VOUT_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
impl R {
    #[doc = "Bits 0:1"]
    #[inline(always)]
    pub fn hbn_root_clk_sel(&self) -> HBN_ROOT_CLK_SEL_R {
        HBN_ROOT_CLK_SEL_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bit 2"]
    #[inline(always)]
    pub fn hbn_uart_clk_sel(&self) -> HBN_UART_CLK_SEL_R {
        HBN_UART_CLK_SEL_R::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bits 3:4"]
    #[inline(always)]
    pub fn hbn_f32k_sel(&self) -> HBN_F32K_SEL_R {
        HBN_F32K_SEL_R::new(((self.bits >> 3) & 3) as u8)
    }
    #[doc = "Bit 5"]
    #[inline(always)]
    pub fn hbn_pu_rc32k(&self) -> HBN_PU_RC32K_R {
        HBN_PU_RC32K_R::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bits 7:11"]
    #[inline(always)]
    pub fn hbn_reset_event(&self) -> HBN_RESET_EVENT_R {
        HBN_RESET_EVENT_R::new(((self.bits >> 7) & 0x1f) as u8)
    }
    #[doc = "Bit 15"]
    #[inline(always)]
    pub fn hbn_uart_clk_sel2(&self) -> HBN_UART_CLK_SEL2_R {
        HBN_UART_CLK_SEL2_R::new(((self.bits >> 15) & 1) != 0)
    }
    #[doc = "Bits 16:19"]
    #[inline(always)]
    pub fn sw_ldo11soc_vout_sel_aon(&self) -> SW_LDO11SOC_VOUT_SEL_AON_R {
        SW_LDO11SOC_VOUT_SEL_AON_R::new(((self.bits >> 16) & 0x0f) as u8)
    }
    #[doc = "Bits 24:27"]
    #[inline(always)]
    pub fn sw_ldo11_rt_vout_sel(&self) -> SW_LDO11_RT_VOUT_SEL_R {
        SW_LDO11_RT_VOUT_SEL_R::new(((self.bits >> 24) & 0x0f) as u8)
    }
    #[doc = "Bits 28:31"]
    #[inline(always)]
    pub fn sw_ldo11_aon_vout_sel(&self) -> SW_LDO11_AON_VOUT_SEL_R {
        SW_LDO11_AON_VOUT_SEL_R::new(((self.bits >> 28) & 0x0f) as u8)
    }
}
impl W {
    #[doc = "Bits 0:1"]
    #[inline(always)]
    #[must_use]
    pub fn hbn_root_clk_sel(&mut self) -> HBN_ROOT_CLK_SEL_W<GLOBAL_SPEC> {
        HBN_ROOT_CLK_SEL_W::new(self, 0)
    }
    #[doc = "Bit 2"]
    #[inline(always)]
    #[must_use]
    pub fn hbn_uart_clk_sel(&mut self) -> HBN_UART_CLK_SEL_W<GLOBAL_SPEC> {
        HBN_UART_CLK_SEL_W::new(self, 2)
    }
    #[doc = "Bits 3:4"]
    #[inline(always)]
    #[must_use]
    pub fn hbn_f32k_sel(&mut self) -> HBN_F32K_SEL_W<GLOBAL_SPEC> {
        HBN_F32K_SEL_W::new(self, 3)
    }
    #[doc = "Bit 5"]
    #[inline(always)]
    #[must_use]
    pub fn hbn_pu_rc32k(&mut self) -> HBN_PU_RC32K_W<GLOBAL_SPEC> {
        HBN_PU_RC32K_W::new(self, 5)
    }
    #[doc = "Bits 7:11"]
    #[inline(always)]
    #[must_use]
    pub fn hbn_reset_event(&mut self) -> HBN_RESET_EVENT_W<GLOBAL_SPEC> {
        HBN_RESET_EVENT_W::new(self, 7)
    }
    #[doc = "Bit 15"]
    #[inline(always)]
    #[must_use]
    pub fn hbn_uart_clk_sel2(&mut self) -> HBN_UART_CLK_SEL2_W<GLOBAL_SPEC> {
        HBN_UART_CLK_SEL2_W::new(self, 15)
    }
    #[doc = "Bits 16:19"]
    #[inline(always)]
    #[must_use]
    pub fn sw_ldo11soc_vout_sel_aon(&mut self) -> SW_LDO11SOC_VOUT_SEL_AON_W<GLOBAL_SPEC> {
        SW_LDO11SOC_VOUT_SEL_AON_W::new(self, 16)
    }
    #[doc = "Bits 24:27"]
    #[inline(always)]
    #[must_use]
    pub fn sw_ldo11_rt_vout_sel(&mut self) -> SW_LDO11_RT_VOUT_SEL_W<GLOBAL_SPEC> {
        SW_LDO11_RT_VOUT_SEL_W::new(self, 24)
    }
    #[doc = "Bits 28:31"]
    #[inline(always)]
    #[must_use]
    pub fn sw_ldo11_aon_vout_sel(&mut self) -> SW_LDO11_AON_VOUT_SEL_W<GLOBAL_SPEC> {
        SW_LDO11_AON_VOUT_SEL_W::new(self, 28)
    }
    #[doc = r" Writes raw bits to the register."]
    #[doc = r""]
    #[doc = r" # Safety"]
    #[doc = r""]
    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
}
#[doc = "Global hibernate configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`global::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`global::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct GLOBAL_SPEC;
impl crate::RegisterSpec for GLOBAL_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [`global::R`](R) reader structure"]
impl crate::Readable for GLOBAL_SPEC {}
#[doc = "`write(|w| ..)` method takes [`global::W`](W) writer structure"]
impl crate::Writable for GLOBAL_SPEC {
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets global to value 0"]
impl crate::Resettable for GLOBAL_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}