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

adding spi slave #487

Merged
merged 1 commit into from
Apr 24, 2022
Merged

adding spi slave #487

merged 1 commit into from
Apr 24, 2022

Conversation

Arnaud078
Copy link
Contributor

as mentionned in issue #483

@Arnaud078 Arnaud078 marked this pull request as draft April 23, 2022 18:25
@Arnaud078 Arnaud078 marked this pull request as ready for review April 23, 2022 19:21
@Arnaud078
Copy link
Contributor Author

I tested that roundtripping between all the modes is fine with :
let spi3 = Spi::new_slave(spi, (sck, miso, mosi), mode, 8_000_000.Hz(), &clocks);
let spi3 = spi3.to_master_operation();
let spi3 = spi3.to_bidi_transfer_mode();
let spi3 = spi3.to_slave_operation();
let spi3 = spi3.to_normal_transfer_mode();

Slave mode is able to transmit.

I can't test that nothing was broken in bidi or master mode though.

@burrbull
Copy link
Contributor

Could you add any tested example?

@Arnaud078
Copy link
Contributor Author

added tested example of spi slave with dma in rtic

@burrbull
Copy link
Contributor

Add example to Cargo.toml with rtic feature.

What about embedded-hal traits? Are they usefull for master mode only?

@burrbull
Copy link
Contributor

rustfmt

@Arnaud078
Copy link
Contributor Author

Added example to Cargo.toml. I am not sure it will solve all the build errors though, I am using undeclared crates :/

I checked embedded-hal, but I don't see any reference to slave or master mode. I don't think I can reference other traits than what was already referenced. I think we can add the 2 new type structs there (Master & Slave), as it is now duplicated in stm32f1xx and stm32f4xx.

@burrbull
Copy link
Contributor

bors r+

@bors bors bot merged commit 84ef991 into stm32-rs:master Apr 24, 2022
@Arnaud078 Arnaud078 deleted the spi_slave branch April 24, 2022 10:45
@Arnaud078 Arnaud078 mentioned this pull request Apr 24, 2022
@Arnaud078
Copy link
Contributor Author

Great ! Thank you for your time.

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.

2 participants