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

[Feature Request] SPI 74HC595 shift register as part of matrix scanning #87

Open
ramonimbao opened this issue Oct 6, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ramonimbao
Copy link

ZMK has support for 74HC595 shift registers as parts of its matrix scanning as of adding additional GPIO. This works really well for small boards with few GPIO available like the Seeed Studio XIAO NRF52840. I have boards here I can test for this. I'd like to be able to contribute but I am unfamiliar with embedded Rust, and my Rust skills are definitely rusty 😅

@HaoboGu HaoboGu added the enhancement New feature or request label Oct 6, 2024
@HaoboGu
Copy link
Owner

HaoboGu commented Oct 6, 2024

I'm happy to see more matrix types are supported :D

You can combine embedded_hal::spi and MatrixTrait to write a platform diagnostic 74HC595 matrix scanning algorithm. If you have any question about implementing it, just feel free to ask

@HaoboGu
Copy link
Owner

HaoboGu commented Oct 6, 2024

If you knew Rust before, learning embedded stuff is not that hard. I think some basic embedded and spi protocol knowledge is all you need to implement it.

@ramonimbao
Copy link
Author

Was searching around for crates to reference and I found this crate: shiftreg-spi. It seems like exactly what's needed since it implements the OutputPin trait. Does this mean we'll be able to mix it in with a normal matrix alongside other microcontroller GPIO pins? That's exactly how some of my boards are set up.

@HaoboGu
Copy link
Owner

HaoboGu commented Oct 7, 2024

Was searching around for crates to reference and I found this crate: shiftreg-spi. It seems like exactly what's needed since it implements the OutputPin trait. Does this mean we'll be able to mix it in with a normal matrix alongside other microcontroller GPIO pins? That's exactly how some of my boards are set up.

Yes, it seems that you even don't need to change any RMK code. If I understand it correctly, you can just put the OutputPin list to the matrix, that should work.

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

No branches or pull requests

2 participants