Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu/stm32/periph_spi: improve clock divider calculation
With only 8 possible clock dividers, we can just loop over the values and shift the clock. In addition to being much easier to read, using shifts over divisions can be a lot faster on CPUs without hardware division. In addition an `assert()` is added that checks if the API contract regarding the SPI frequency is honored. If the requested clock is too low to be generated, we should rather have a blown assertion than hard to trace communication errors.
- Loading branch information