forked from arduino/Arduino
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SPIClass::getSettings to precalculate SPI settings
This allows specifying the clock rate in Mhz, instead of having to use a clock divider constant. The code will automatically select the fastest clock speed supported that is not faster than the specified clock rate (so callers can just pass in the maximum supported clock rate of the SPI slave, even when they know the maximum speed of their AVR chip is a lot less). Care is taken to ensure that when a constant clock is passed, the calculation is done at compiletime without any overhead.
- Loading branch information
1 parent
0451bdb
commit d29a0dc
Showing
1 changed file
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters