aboutsummaryrefslogtreecommitdiff
path: root/embassy-rp/src/pio_programs/clock_divider.rs
Commit message (Collapse)AuthorAgeFilesLines
* clock_divider: use core::assert in const fnEric Seppanen2025-12-131-3/+3
| | | | defmt::assert gives a compile error in const context.
* improve pio clock divider mathEric Seppanen2025-12-131-11/+32
| | | | | | | | | | | | | | Ensure that the fractional part of the clock divider is accurately calculated. This does additional u32 division/mod operations, which I think is better than using u64 for its extra precision. Also: - Add additional asserts to catch out-of-bounds results. - Make the version that accepts the system clock as a parameter const and public, so if anyone wants to hardcode the system frequency they can avoid any runtime computation. - Remove the `inline` attributes because the function has grown quite a bit.
* add unit test for calculate_pio_clock_dividerEric Seppanen2025-12-131-1/+29
| | | | | The test will fail, because the current implementation doesn't calculate the fractional part.
* Add PIO clock divider utility and refactor related modules1-rafael-12025-05-031-0/+25