Skip to content
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

flipperzero: SPI interface #113

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

flipperzero: SPI interface #113

wants to merge 5 commits into from

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Oct 9, 2023

No description provided.

@str4d str4d mentioned this pull request Oct 15, 2023
Base automatically changed from i2c to main October 15, 2023 04:45
@QuantumEF
Copy link

Something I wanted to add here since I have book looking into this:
There seem to be 2 physical busses denoted as "bus_r" and "bus_d"
Because of this, I think there should be 2 SPIBus structs of some sort, one for "bus_r" and the other of course "bus_d" each implementing the SpiBus trait from the EmbeddedHal crate. Of course I still am not sure how it should be gone about implementing the SPI device trait. Based on what I am seeing, it might be best to implement each device with the SPI Bus trait since it seems like the higher level function calls that are exposed use the lower level items to lock the furi_hal_spi_bus_r_mutex "in targets/f7/furi_hal/furi_hal_spi_config.c"
As mentioned in a different post elsewhere, I am willing to help out with this. I probably need someone to help me understand how the bindings work, because it might be useful to try use and expose lower level function calls and static variables.
Further, based on how function calls like furi_hal_spi_bus_tx they are already using some sort of spin lock for transmitting data, so it would make sense to expose those calls with the non-blocking crate to provide an async interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants