-
Notifications
You must be signed in to change notification settings - Fork 220
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
Proposal: SPI HalfDuplex and Device traits #144
Comments
IMHO half duplex will see most usage among features you mentioned. |
hey, thanks for opening an issue, a few questions and comments:
|
@ryankurte half duplex references a bidirectional mode where MISO and MOSI are shared (one signal). Master then generally needs to:
Please see BIDIMODE and BIDIOE bits from STML0x3 manual (SPI control register 1): |
@dzarda Sure, but why do you need special traits for that case? The traits only care about the data transfer, not the initialisation or the hardware connected to it. So unless I'm missing something here you only need to have a HAL impl that provides a half-duplex setup but the usage would be exactly the same. |
Ahh, that makes sense, thanks!
I guess we're missing a |
Here: https://github.com/stm32-rs/stm32f7xx-hal/blob/master/src/spi.rs |
Not sure, you still have to clock out a number of |
blocking::spi::Write - sure, that could be used for sending data. But the receive functionality is simply absent. It's not a matter of efficiency AFAIK, I don't see a way of mapping this onto current API. |
I evaluated the idea on the STM32L0x3 where the "bidirectional" receive behaviour is to output SCK clock with BIDIMODE=1 and BIDIOE=0. Not sure how to map this onto some API. More devices should be researched. |
Is there any update? |
Currently SPI have one model of work - Master + FullDuplex. But some mcu and mpu have more intelligence SPI implementation: HalfDuplex, variable length of transfer (4 - 16 bit), Device mode.
I thinks we need to add HalfDuplex and Device trait for current SPI interface. Also I think that adding of 8:16 bit transfer is not difficult.
The text was updated successfully, but these errors were encountered: