Skip to content

STM32: SPI clock rate fix and cleanup #2307

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 4 commits into from
Nov 21, 2019
Merged

STM32: SPI clock rate fix and cleanup #2307

merged 4 commits into from
Nov 21, 2019

Conversation

hierophect
Copy link
Collaborator

@hierophect hierophect commented Nov 20, 2019

This PR corrects an issue in the STM32 port where an incorrect bus clock was used to calculate frequency on several instances of the SPI peripheral, halving the clock rate. The module now correctly selects a bus clock based on SPI instance. Thanks @dhalbert for finding this!

Since SPI was one of the first modules created for the port, I've also taken the opportunity to clean it up a bit to bring it more in line with the other modules.

resolves #2304

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested frequencies on two SPI peripherals. Looks good! Granularity is coarse, as you note. e.g. 10MHz gives 5.something; have to go to 11 MHz to get 10.42

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dhalbert dhalbert merged commit e06dc72 into adafruit:master Nov 21, 2019
@hierophect hierophect deleted the stm32-spi-cleanup branch November 21, 2019 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stm32f4: SPI clock rates
2 participants