4 ms·
> Above guide uses inline assembly to blink a GPIO. No, the only inline ASM in this guide is to cause a debugger breakpoint. You also need inline ASM to enable
by kam 10y ago
> Above guide uses inline assembly to blink a GPIO.
No, the only inline ASM in this guide is to cause a debugger breakpoint. You also need inline ASM to enable/disable interrupts, and that's about it.
The code in this guide looks ugly because it's written to show how to use the hardware without any abstraction. Higher level APIs like f3 (https://docs.rs/f3/0.3.1/f3/ https://docs.rs/f3/0.3.1/f3/) exist, though not nearly for every chip or peripheral. Even in C, for anything outside the popular Arduino/mbed/etc boards, your choice is usually between buggy vendor bloatware and using the registers directly after carefully reading the datasheet.
- turbinerneiter 10y agoTrue, I was a bit hyperbolic.
- snovv_crash 10y agoFrom what I've seen, using registers is often simpler and easier than using the vendor GPIO libraries.