-
Notifications
You must be signed in to change notification settings - Fork 990
feather-stm32f405: add SPI support #1377
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
feather-stm32f405: add SPI support #1377
Conversation
Also, @ardnew please note merge conflict that will need resolution via rebase against |
b6be329
to
e6d7ba8
Compare
Seems like the requested changes have all been made to the PR, is that correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks clean, however I'm wondering about this:
- The SPI peripheral is enabled at the end of the
Configure
call - The SPI peripheral is enabled at the start of
Transfer
, if it isn't enabled already - The SPI peripheral is disabled at the end of
Transfer
.
Is it intentional to disable the SPI peripheral between transferring each byte? Why do you enable it then in Configure
?
It was intentional on my part, yes, as this is what the STM32 HAL/LL drivers do before and after each transfer - I'm not sure why exactly they do it though. Clears pending flags? Paranoid attempt to minimize bus traffic? Helps prevent the user from re-configuring the interface while its enabled?
Good catch, indeed one of these is unnecessary. I think enabling/disabling for each transfer is the safer option, if not the most efficient. But I also think its a little pedantic and would be fine leaving it enabled between transfers unless someone objects. |
I do not think that you want to enable/disable on event call to |
Hi @ardnew any update on removing the register enable from the |
@deadprogram Sorry -- got a little distracted with other efforts! Requested change implemented. |
Thanks @ardnew now squash/merging. |
This adds support for the three SPI peripherals on the target
feather-stm32f405
.This included extending the STM32 family's SPI implementation to now support the following options:- Direction (full/half duplex)- Hardware or software chip/slave-select- 8-bit or 16-bit data frame format