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

implementation of SpiDevice for auto NSS (chip select) #744

Open
lgjonathan opened this issue Feb 29, 2024 · 1 comment
Open

implementation of SpiDevice for auto NSS (chip select) #744

lgjonathan opened this issue Feb 29, 2024 · 1 comment

Comments

@lgjonathan
Copy link

Right now, the spi in the HAL only implements SpiBus, which leaves the CS(NSS) management to user software.
If the SpiDevice trait from embedded_hal is implemented, then the user don't have to care about the NSS management since it will be taken care by the hardware.

I'm relatively new to the embedded world and I was wondering if such implementation will be too complicated to pull off. If not, I'm willing to try implement it myself. Would HardwareCS from the stm32h7 be a good reference to begin with?

Thanks

@burrbull
Copy link
Contributor

burrbull commented Feb 29, 2024

It would be nice to have hardware NSS support.

But this does not mean you cannot use SpiDevice. You can.
With https://docs.rs/embedded-hal-bus/0.1.0/embedded_hal_bus/spi/index.html
This is still software NSS implementation. But it does all staff you need itself. The only you need is to wrap SpiBus + OutputPin in one of the xxDevices on initialization.

P.S. We need example in the repo as embedded-hal-bus documentation is not good enough.

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

No branches or pull requests

2 participants