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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#[doc = "DCDC"]
#[repr(C)]
pub struct RegisterBlock {
    #[doc = "DCDC Register 0"]
    pub REG0: crate::RWRegister<u32>,
    #[doc = "DCDC Register 1"]
    pub REG1: crate::RWRegister<u32>,
    #[doc = "DCDC Register 2"]
    pub REG2: crate::RWRegister<u32>,
    #[doc = "DCDC Register 3"]
    pub REG3: crate::RWRegister<u32>,
}
#[doc = "DCDC Register 0"]
pub mod REG0 {
    #[doc = "power down the zero cross detection function for discontinuous conductor mode"]
    pub mod PWD_ZCD {
        pub const offset: u32 = 0;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Disable automatic clock switch from internal osc to xtal clock."]
    pub mod DISABLE_AUTO_CLK_SWITCH {
        pub const offset: u32 = 1;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "select 24 MHz Crystal clock for DCDC, when dcdc_disable_auto_clk_switch is set."]
    pub mod SEL_CLK {
        pub const offset: u32 = 2;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Power down internal osc. Only set this bit, when 24 MHz crystal osc is available"]
    pub mod PWD_OSC_INT {
        pub const offset: u32 = 3;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "The power down signal of the current detector."]
    pub mod PWD_CUR_SNS_CMP {
        pub const offset: u32 = 4;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Set the threshold of current detector, if the peak current of the inductor exceeds the threshold, the current detector will assert"]
    pub mod CUR_SNS_THRSH {
        pub const offset: u32 = 5;
        pub const mask: u32 = 0x07 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "power down overcurrent detection comparator"]
    pub mod PWD_OVERCUR_DET {
        pub const offset: u32 = 8;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "The threshold of over current detection in run mode and power save mode: run mode power save mode 0x0 1 A 0"]
    pub mod OVERCUR_TRIG_ADJ {
        pub const offset: u32 = 9;
        pub const mask: u32 = 0x03 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "set to \"1\" to power down the low voltage detection comparator"]
    pub mod PWD_CMP_BATT_DET {
        pub const offset: u32 = 11;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "adjust value to poslimit_buck register"]
    pub mod ADJ_POSLIMIT_BUCK {
        pub const offset: u32 = 12;
        pub const mask: u32 = 0x0f << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "enable the overload detection in power save mode, if current is larger than the overloading threshold (typical value is 50 mA), DCDC will switch to the run mode automatically"]
    pub mod EN_LP_OVERLOAD_SNS {
        pub const offset: u32 = 16;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "power down overvoltage detection comparator"]
    pub mod PWD_HIGH_VOLT_DET {
        pub const offset: u32 = 17;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "the threshold of the counting number of charging times during the period that lp_overload_freq_sel sets in power save mode"]
    pub mod LP_OVERLOAD_THRSH {
        pub const offset: u32 = 18;
        pub const mask: u32 = 0x03 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "the period of counting the charging times in power save mode 0: eight 32k cycle 1: sixteen 32k cycle"]
    pub mod LP_OVERLOAD_FREQ_SEL {
        pub const offset: u32 = 20;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Adjust hysteretic value in low power from 12.5mV to 25mV"]
    pub mod LP_HIGH_HYS {
        pub const offset: u32 = 21;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "power down output range comparator"]
    pub mod PWD_CMP_OFFSET {
        pub const offset: u32 = 26;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "1'b1: Disable xtalok detection circuit 1'b0: Enable xtalok detection circuit"]
    pub mod XTALOK_DISABLE {
        pub const offset: u32 = 27;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "reset current alert signal"]
    pub mod CURRENT_ALERT_RESET {
        pub const offset: u32 = 28;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "set to 1 to switch internal ring osc to xtal 24M"]
    pub mod XTAL_24M_OK {
        pub const offset: u32 = 29;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Status register to indicate DCDC status. 1'b1: DCDC already settled 1'b0: DCDC is settling"]
    pub mod STS_DC_OK {
        pub const offset: u32 = 31;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
}
#[doc = "DCDC Register 1"]
pub mod REG1 {
    #[doc = "select the feedback point of the internal regulator"]
    pub mod REG_FBK_SEL {
        pub const offset: u32 = 7;
        pub const mask: u32 = 0x03 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "control the load resistor of the internal regulator of DCDC, the load resistor is connected as default \"1\", and need set to \"0\" to disconnect the load resistor"]
    pub mod REG_RLOAD_SW {
        pub const offset: u32 = 9;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "set the current bias of low power comparator 0x0: 50 nA 0x1: 100 nA 0x2: 200 nA 0x3: 400 nA"]
    pub mod LP_CMP_ISRC_SEL {
        pub const offset: u32 = 12;
        pub const mask: u32 = 0x03 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "increase the threshold detection for common mode analog comparator"]
    pub mod LOOPCTRL_HST_THRESH {
        pub const offset: u32 = 21;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Enable hysteresis in switching converter common mode analog comparators"]
    pub mod LOOPCTRL_EN_HYST {
        pub const offset: u32 = 23;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "trim bandgap voltage"]
    pub mod VBG_TRIM {
        pub const offset: u32 = 24;
        pub const mask: u32 = 0x1f << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
}
#[doc = "DCDC Register 2"]
pub mod REG2 {
    #[doc = "Ratio of integral control parameter to proportional control parameter in the switching DC-DC converter, and can be used to optimize efficiency and loop response"]
    pub mod LOOPCTRL_DC_C {
        pub const offset: u32 = 0;
        pub const mask: u32 = 0x03 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Magnitude of proportional control parameter in the switching DC-DC converter control loop."]
    pub mod LOOPCTRL_DC_R {
        pub const offset: u32 = 2;
        pub const mask: u32 = 0x0f << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Two's complement feed forward step in duty cycle in the switching DC-DC converter"]
    pub mod LOOPCTRL_DC_FF {
        pub const offset: u32 = 6;
        pub const mask: u32 = 0x07 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Enable analog circuit of DC-DC converter to respond faster under transient load conditions."]
    pub mod LOOPCTRL_EN_RCSCALE {
        pub const offset: u32 = 9;
        pub const mask: u32 = 0x07 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Increase the threshold detection for RC scale circuit."]
    pub mod LOOPCTRL_RCSCALE_THRSH {
        pub const offset: u32 = 12;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Invert the sign of the hysteresis in DC-DC analog comparators."]
    pub mod LOOPCTRL_HYST_SIGN {
        pub const offset: u32 = 13;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "This bit enables the DC-DC to improve efficiency and minimize ripple using the information from the BATT_VAL field"]
    pub mod BATTMONITOR_EN_BATADJ {
        pub const offset: u32 = 15;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Set to \"0\" : stop charging if the duty cycle is lower than what set by dcdc_neglimit_in"]
    pub mod DISABLE_PULSE_SKIP {
        pub const offset: u32 = 27;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Set high to improve the transition from heavy load to light load"]
    pub mod DCM_SET_CTRL {
        pub const offset: u32 = 28;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
}
#[doc = "DCDC Register 3"]
pub mod REG3 {
    #[doc = "Target value of VDD_SOC, 25 mV each step 0x0: 0.8V 0xE: 1.15V 0x1F:1.575V"]
    pub mod TRG {
        pub const offset: u32 = 0;
        pub const mask: u32 = 0x1f << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Target value of standby (low power) mode 0x0: 0"]
    pub mod TARGET_LP {
        pub const offset: u32 = 8;
        pub const mask: u32 = 0x07 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Set DCDC clock to half freqeuncy for continuous mode"]
    pub mod MINPWR_DC_HALFCLK {
        pub const offset: u32 = 24;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Ajust delay to reduce ground noise"]
    pub mod MISC_DELAY_TIMING {
        pub const offset: u32 = 27;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Reserved"]
    pub mod MISC_DISABLEFET_LOGIC {
        pub const offset: u32 = 28;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
    #[doc = "Disable stepping for the output VDD_SOC of DCDC"]
    pub mod DISABLE_STEP {
        pub const offset: u32 = 30;
        pub const mask: u32 = 0x01 << offset;
        pub mod R {}
        pub mod W {}
        pub mod RW {}
    }
}