Commit d983c32
Merge #231
231: Implement unsafe overclocking safety overrides r=TeXitoi a=rukai
I am porting a C firmware that slightly overclocks the following values on an stm32f439.
* SYSCLK 192MHz (max 180MHz)
* APB1/PCLK1/PPRE1_register 48Mhz (max 45MHz)
* APB2/PCLK2/PPRE2_register 96Mhz (max 90MHz)
I need to maintain these clock speeds in the rust port, so my usage will look like this:
```rust
let clocks = unsafe {
rcc.cfgr
.use_hse(4.mhz())
.sysclk(192.mhz())
.hclk(192.mhz())
.pclk1(48.mhz())
.pclk2(96.mhz())
.sysclk_allow_overclock()
.pclk1_allow_overclock()
.pclk2_allow_overclock()
.freeze()
};
```
Would love to hear suggestions for better naming of the builder method names.
Co-authored-by: Rukai <[email protected]>1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
288 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
289 | 301 | | |
290 | 302 | | |
291 | 303 | | |
292 | 304 | | |
293 | | - | |
| 305 | + | |
294 | 306 | | |
295 | 307 | | |
296 | 308 | | |
| |||
324 | 336 | | |
325 | 337 | | |
326 | 338 | | |
327 | | - | |
| 339 | + | |
328 | 340 | | |
329 | 341 | | |
330 | 342 | | |
| |||
341 | 353 | | |
342 | 354 | | |
343 | 355 | | |
344 | | - | |
| 356 | + | |
345 | 357 | | |
346 | 358 | | |
347 | 359 | | |
| |||
0 commit comments