Skip to content

Fix SPI::setClockDivider implementation #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2018

Conversation

fpistm
Copy link
Member

@fpistm fpistm commented Nov 23, 2018

Fix #299

@fpistm fpistm self-assigned this Dec 7, 2018
@fpistm fpistm added the fix 🩹 Bug fix label Dec 7, 2018
@fpistm fpistm added this to the 1.5.0 milestone Dec 7, 2018
As said in Arduino API:
https://www.arduino.cc/en/Reference/SPISetClockDivider

"On the Due, the system clock can be divided by values
from 1 to 255. The default value is 21, which sets the clock
to 4 MHz like other Arduino boards."

So in fact, it should be possible to divide the clock by any value.
Then HAL will use the best prescaler to fit requested Freq.

Moreover, it is not possible to define SPI_CLOCK_DIVx to match
the 16MHz value for avr as SPI frequency depends of system clock
configuration.

Fix stm32duino#299

Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm merged commit 7b48eff into stm32duino:master Dec 21, 2018
@fpistm fpistm deleted the SPI_clock_div branch December 21, 2018 09:22
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Fix SPI::setClockDivider implementation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix 🩹 Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant